Repository: incubator-rocketmq Updated Branches: refs/heads/spec 90ba64810 -> ccdbdf575
[ROCKETMQ-17] Develop a vendor-neutral open standard for distributed messaging: refactor message class. https://issues.apache.org/jira/browse/ROCKETMQ-17 Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/ccdbdf57 Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/ccdbdf57 Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/ccdbdf57 Branch: refs/heads/spec Commit: ccdbdf575d1811cb3ff8aad41117959d53e845b3 Parents: 90ba648 Author: vintagewang <[email protected]> Authored: Tue Dec 27 16:31:02 2016 +0800 Committer: vintagewang <[email protected]> Committed: Tue Dec 27 16:31:02 2016 +0800 ---------------------------------------------------------------------- .../org/apache/openmessaging/BytesMessage.java | 27 +++++++++++++++++ .../java/org/apache/openmessaging/Message.java | 32 +++----------------- 2 files changed, 32 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/ccdbdf57/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/BytesMessage.java ---------------------------------------------------------------------- diff --git a/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/BytesMessage.java b/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/BytesMessage.java new file mode 100644 index 0000000..ac279da --- /dev/null +++ b/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/BytesMessage.java @@ -0,0 +1,27 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.openmessaging; + +/** + * @author [email protected] + */ +public interface BytesMessage extends Message { + byte[] getBody(); + + void setBody(final byte[] body); +} http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/ccdbdf57/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/Message.java ---------------------------------------------------------------------- diff --git a/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/Message.java b/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/Message.java index e89b8af..4339227 100644 --- a/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/Message.java +++ b/spec/code/messaging-user-level-api/java/src/main/java/org/apache/openmessaging/Message.java @@ -17,37 +17,15 @@ package org.apache.openmessaging; -import java.util.Map; - /** * @author [email protected] */ -public class Message { - private Map<String, String> header; - private Map<String, String> properties; - private byte[] body; - - public Map<String, String> getHeader() { - return header; - } - - public void setHeader(final Map<String, String> header) { - this.header = header; - } - - public Map<String, String> getProperties() { - return properties; - } +public interface Message { + Message putHeader(final String name, final String value); - public void setProperties(final Map<String, String> properties) { - this.properties = properties; - } + Message putProperty(final String name, final String value); - public byte[] getBody() { - return body; - } + String getHeader(final String name); - public void setBody(final byte[] body) { - this.body = body; - } + String getProperty(final String name); } \ No newline at end of file
