I'm using spring integration jms channel to consume messages from the queue and process it.
Here is my inbound-channel-config.xml
<jms:message-driven-channel-adapter id="jmsIn"
destination="requestQueue"
channel="routingChannel"
connection-factory="cachingConnectionFactory"
error-channel="errorChannel"
concurrent-consumers="${jms_adapter_concurrent_consumers}" />
Here when i set concurrent-consumers to a value greater than 1, the messages that i consume gets corrupted while processing. I'm consuming XML and Json messages from the queue and while parsing the data, i could see that some of its contents are changed and set to some random value.
The above config works fine only when concurrent-consumers value is set to 1.
My question is, do i have to manually Synchronize (make thread safe) my code when i set concurrent-consumers to a value greater than 1?