I am using below config to send JMS message with an Object payload( lets say HelloWorld object) but when I receive message using Message driven adapater the payload is converted into byte[].
Is there a way to prevent this? I see outbound adapter eventually calls SimpleMessageConverter method `createMessageForSerializable --> session.createObjectMessage(object)
<si:chain input-channel="errorChannelIn">
<si:router
expression="headers.jms_redelivered.equals(T(java.lang.Boolean).FALSE) ? 'errorQueueChannel' : 'channel2Name' "
apply-sequence="true">
<si:mapping value="errorQueueChannel" channel="errorChannel"/>
<si:mapping value="channel2Name" channel="channel2"/>
</si:router>
</si:chain>
<si-jms:outbound-channel-adapter id="errorQueueMessageSender"
channel="errorChannel"
connection-factory="connectionFactory" session-transacted="true" destination="errorQueue"
/>
However, when I send message using JmsTemplate then it perfectly sends message as messageObject and message driven adapter picks up the Object as payload. Code snippet below.
Any idea where am I going wrong.
jmsTemplate.send(new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
return session.createObjectMessage(messageObject);
}
});