I am evaluating Spring Batch and I would like to showcase the following scenario.
A job reads "something" (probably rows from a database) and create chunks of work. Each chunk is sent to a JMS queue. The listener of that JMS queue reads each chunk and processes it.
Regarding chunk status, I would expect the handler to update its chunk. If the handler fails X times (rollbacks), the message is sent to a DLQ to avoid poison messages and this DLQ simply updates the chunk as an error.
I had a look to StepIntegrationTests and it does mostly what I want (except the handling of the response is different, not sure it can be changed or why is it done that way).
I have upgraded the config to use JMS endpoints instead but I have the following config problems:
* There is no multi-threading, all chunks are processed in the thread that actually started the job
* If I don't set a poller on my jms out queue I got the "No poller has been defined for endpoint jmsOut"
What is wrong in my config?
where chunkHandler is the regular chunkHandler of the test and batchChunkInQueue and batchChunkOutQueue are regular activeMQ queues.
<integration:poller max-messages-per-poll="1" id="defaultPoller"
<bean id="messagingGateway" class="org.springframework.integration.gateway.SimpleMessagingGateway">
<property name="requestChannel" ref="requests"/>
<property name="replyChannel" ref="replies"/>
<property name="replyTimeout" value="1000"/>
<jms:message-driven-channel-adapter id="jmsIn" destination="batchChunkInQueue" channel="requests"/>
<jms:outbound-channel-adapter id="jmsOut" destination="batchChunkOutQueue" channel="replies"/>
<integration:service-activator input-channel="requests" output-channel="replies" ref="chunkHandler"/>