Multiple receive on JMS queues
Hi. we use Spring Integration with ActiveMQ to handle task and task flow in our application.
We are having a problem that the task bound to queues are being called multiple times.
To explain, here is the flow in the config:
The application receive an online order for a photobook (an XML file containing the data for it) and creates the photobook pages from it.
we have define channels, service-activator and beans like this:
We also have this:
<sijms:channel id="retrieveImagesChannel" queue-name="retrieveImagesQueue" error-handler="messagePublishError" />
<sijms:channel id="createPrintPagesChannel" queue-name="createPrintPagesQueue" error-handler="messagePublishError" />
<si:service-activator input-channel="retrieveImagesChannel" ref="retrieveImages" method="executeTask" output-channel="transformImagesChannel" />
<si:service-activator input-channel="createPrintPagesChannel" ref="createPrintPages" method="executeTask" output-channel="createPagesChannel" />
<bean id="retrieveImages" class="com.tvi.fusion.task.impl.RetrieveImages" />
<bean id="createPrintPages" class="com.tvi.fusion.task.impl.CreatePrintPages" />
And an errorHandler:
<si:poller default="true" >
(There's a bit more than this, but it does not concern my problem)
<!-- error message -->
<bean id="messagePublishError" class="org.springframework.integration.channel.MessagePublishingErrorHandler">
<property name="defaultErrorChannel" ref="jmsErrorChannel" />
This flow is working, everything can go from start to finish, but we are having a big problem:
The method executeTask in the RetrieveImages class is being called multiple times.
That's really not good. For each order, there should be one message put in the queue and one call to the method.
I have no idea why.
Any help on this would be appreciated.
NOTE: we are using v 2.0.0 M5.