long messageFormat = message.getLongProperty(MESSAGE_FORMAT);
Integer size = message.getIntProperty(PROTON_MESSAGE_SIZE_SS);
Header header = populateHeader(message, deliveryCount);
DeliveryAnnotations deliveryAnnotations = populateDeliveryAnnotations(message);
MessageAnnotations messageAnnotations = populateMessageAnnotations(message);
Properties props = populateProperties(message);
ApplicationProperties applicationProperties = populateApplicationProperties(message);
Section section = populateBody(message);
Footer footer = populateFooter(message);
Set<SimpleString> propertyNames = message.getPropertyNames();
for (SimpleString propertyName : propertyNames)
{
TypedProperties typedProperties = message.getTypedProperties();
String realName = propertyName.toString();
if (realName.startsWith(MESSAGE_ANNOTATIONS))
{
SimpleString value = (SimpleString) typedProperties.getProperty(propertyName);
Symbol symbol = Symbol.getSymbol(realName.replace(MESSAGE_ANNOTATIONS, ""));
messageAnnotations.getValue().put(symbol, value.toString());
}
}
MessageImpl protonMessage = new MessageImpl(header, deliveryAnnotations, messageAnnotations, props, applicationProperties, section, footer);
protonMessage.setMessageFormat(getMessageFormat(message.getLongProperty(new SimpleString(PROTON_MESSAGE_FORMAT))));
ByteBuffer buffer = ByteBuffer.wrap(new byte[size]);