if(! MessageProperties.CONTENT_TYPE_JSON.equalsIgnoreCase(contentType))
throw new MessageConversionException("Cannot understand a message of type "+contentType);
try {
ByteArrayInputStream inStream = new ByteArrayInputStream(body);
StaxReader reader = new StaxReader(new QNameMap(), this.inputFactory.createXMLStreamReader(inStream, messageEncoding));
return this.objectMapper.unmarshal(reader);
} catch (XMLStreamException ex) {
String typeId = (String) messageProperties.getHeaders().get(DefaultClassMapper.DEFAULT_CLASSID_FIELD_NAME);
LOG.error("XMLStreamException trying to unmarshal message of type {}", typeId, ex);
throw new MessageConversionException("Could not unmarshal message of type "+typeId, ex);