Sunil Dutta
Sunil Dutta

Reputation: 79

Service activator not processing the message from channel after getting the soapfaultException

I am using the JMS inbound channel adapter which is consuming the messages from MQ and sending these messages to a channel. This channel is sending this message to a service activator and the SAis parsing this message and sending the object to the WS outbound gateway which will call a web service.

the Adapter is reading 50 messages after every 30 seconds and the service activator is sending them to WS outbound gateway. If the WS call is success then all the messages are processing successfully and if the WS is sending soapFaultException in that case Service activator is not processing rest of the messages and process them in next round i.e. after 30 secs, Not sure why. Please help

Upvotes: 1

Views: 512

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121177

I can assume only one scenario:

  1. Your JMS Inbound Channel Adapter is configured with poller for max-messages-per-poll="0"

  2. Therefore it polls in one JMS transaction as much messages as possible and sends them one by one to the channel.

  3. Since all of them are processed in the same thread, they are confirmed (acked, commited) into JMS only after the whole bunch.

  4. Having at least one exception during the batch process means rollback all messages to the queue.

You can process them in parallel using a taskExecutor or even better switch to the Message Driven Channel Adapter, where a TX around one message won't affect all others.

Upvotes: 1

Related Questions