I have a simple Junit test that creates a spring integration message and uses a AMQP outbound channel adapter.
The integration context looks like
toRabbitMessageChannel -> OutBoundAdapter
The payload takes an object of "MyEntity.class"
MyEntity entityRequest = new MyEntity();
The Message is being sent using the following code
I have autowired the message channel through the follow annotation
So the problem that I am facing is that the message goes out into my Rabbit queue but the payload is zero.
Payload 0 bytes Encoding: string
I single stepped the Junit test in the debugger and I see that the SimpleMessageConverter does not convert the object into a byte array.
In the function convertAndSend after the conversion is done
The "body" field of the "messagetoSend" object is NULL whereas the "message" field has the MyEntity object as set by the Junit test. My understanding is that the SimpleMessageConverter can take in any object and serialize it into a byte array. What am I doing wrong? Also I would like to understand on any transformation I would need to apply to get the object back on the receiving side.