protected Message createMessage(Object object, MessageProperties messageProperties) {
try {
byte[] body = null;
if(object != null) {
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
StaxWriter writer = new StaxWriter(new QNameMap(), this.outputFactory.createXMLStreamWriter(outStream));
this.objectMapper.marshal(object, writer);
body = outStream.toByteArray();
}
messageProperties.setContentType(MessageProperties.CONTENT_TYPE_JSON);