public static void setProperties(final Message msg, Map<String, String> properties) { msg.setProperties(properties); }
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; }
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; }
public static void setProperties(final Message msg, Map<String, String> properties) { msg.setProperties(properties); }
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; }
public static void setProperties(final Message msg, Map<String, String> properties) { msg.setProperties(properties); }
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; }
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; }