return message;
}
if (message instanceof ObjectMessage) {
LOG.trace("Extracting body as a ObjectMessage from JMS message: {}", message);
ObjectMessage objectMessage = (ObjectMessage)message;
Object payload = objectMessage.getObject();
if (payload instanceof DefaultExchangeHolder) {
DefaultExchangeHolder holder = (DefaultExchangeHolder) payload;
DefaultExchangeHolder.unmarshal(exchange, holder);
return exchange.getIn().getBody();
} else {
return objectMessage.getObject();
}
} else if (message instanceof TextMessage) {
LOG.trace("Extracting body as a TextMessage from JMS message: {}", message);
TextMessage textMessage = (TextMessage)message;
return textMessage.getText();