本文整理了Java中org.apache.rocketmq.common.message.Message.setProperties()
方法的一些代码示例,展示了Message.setProperties()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.setProperties()
方法的具体详情如下:
包路径:org.apache.rocketmq.common.message.Message
类名称:Message
方法名:setProperties
暂无
代码示例来源:origin: apache/rocketmq
public static void setProperties(final Message msg, Map<String, String> properties) {
msg.setProperties(properties);
}
代码示例来源:origin: apache/rocketmq
public static Message decodeMessage(ByteBuffer byteBuffer) throws Exception {
Message message = new Message();
// 1 TOTALSIZE
byteBuffer.getInt();
// 2 MAGICCODE
byteBuffer.getInt();
// 3 BODYCRC
byteBuffer.getInt();
// 4 FLAG
int flag = byteBuffer.getInt();
message.setFlag(flag);
// 5 BODY
int bodyLen = byteBuffer.getInt();
byte[] body = new byte[bodyLen];
byteBuffer.get(body);
message.setBody(body);
// 6 properties
short propertiesLen = byteBuffer.getShort();
byte[] propertiesBytes = new byte[propertiesLen];
byteBuffer.get(propertiesBytes);
message.setProperties(string2messageProperties(new String(propertiesBytes, CHARSET_UTF8)));
return message;
}
代码示例来源:origin: apache/rocketmq
public static Message cloneMessage(final Message msg) {
Message newMsg = new Message(msg.getTopic(), msg.getBody());
newMsg.setFlag(msg.getFlag());
newMsg.setProperties(msg.getProperties());
return newMsg;
}
代码示例来源:origin: didi/DDMQ
public static void setProperties(final Message msg, Map<String, String> properties) {
msg.setProperties(properties);
}
代码示例来源:origin: didi/DDMQ
public static Message decodeMessage(ByteBuffer byteBuffer) throws Exception {
Message message = new Message();
// 1 TOTALSIZE
byteBuffer.getInt();
// 2 MAGICCODE
byteBuffer.getInt();
// 3 BODYCRC
byteBuffer.getInt();
// 4 FLAG
int flag = byteBuffer.getInt();
message.setFlag(flag);
// 5 BODY
int bodyLen = byteBuffer.getInt();
byte[] body = new byte[bodyLen];
byteBuffer.get(body);
message.setBody(body);
// 6 properties
short propertiesLen = byteBuffer.getShort();
byte[] propertiesBytes = new byte[propertiesLen];
byteBuffer.get(propertiesBytes);
message.setProperties(string2messageProperties(new String(propertiesBytes, CHARSET_UTF8)));
return message;
}
代码示例来源:origin: org.apache.rocketmq/rocketmq-common
public static void setProperties(final Message msg, Map<String, String> properties) {
msg.setProperties(properties);
}
代码示例来源:origin: org.apache.rocketmq/rocketmq-common
public static Message decodeMessage(ByteBuffer byteBuffer) throws Exception {
Message message = new Message();
// 1 TOTALSIZE
byteBuffer.getInt();
// 2 MAGICCODE
byteBuffer.getInt();
// 3 BODYCRC
byteBuffer.getInt();
// 4 FLAG
int flag = byteBuffer.getInt();
message.setFlag(flag);
// 5 BODY
int bodyLen = byteBuffer.getInt();
byte[] body = new byte[bodyLen];
byteBuffer.get(body);
message.setBody(body);
// 6 properties
short propertiesLen = byteBuffer.getShort();
byte[] propertiesBytes = new byte[propertiesLen];
byteBuffer.get(propertiesBytes);
message.setProperties(string2messageProperties(new String(propertiesBytes, CHARSET_UTF8)));
return message;
}
代码示例来源:origin: org.apache.rocketmq/rocketmq-common
public static Message cloneMessage(final Message msg) {
Message newMsg = new Message(msg.getTopic(), msg.getBody());
newMsg.setFlag(msg.getFlag());
newMsg.setProperties(msg.getProperties());
return newMsg;
}
内容来源于网络,如有侵权,请联系作者删除!