Spring Integration should do the JMS correlation, rather than fobbing it off on the poor benighted user.
The interceptor approach works, but even in M6 you need expose this in the user configuration, which doesn't seem right to me.
Spring Integration should do the JMS correlation, rather than fobbing it off on the poor benighted user.
The interceptor approach works, but even in M6 you need expose this in the user configuration, which doesn't seem right to me.
Thanks again for all of the feedback. Indeed, Spring Integration should handle the correlation behind the scenes. From my perspective, this is part of a larger design issue where we need to provide a clearer distinction between Channel Adapters and Gateways. In other words, the reason this currently places the burden on the developer is that for outbound JMS request/reply, we only have support for unidirectional Channel Adapters. If on the other hand, we provide an outbound JMS Gateway, the request/reply correlation will happen there in a single module that defines the request and reply channels. Neil is correct to say that these responsibilities should be encapsulated. For instance, the developer should not need to know about things such as ReplyMessageCorrelator. That is an internal component, while "channel-adapter" and "gateway" are part of the *public* API. So, please keep an eye on the JIRA issue, and feel free to provide feedback there or in this thread as we address the issue and you get a chance to try it out.
Thanks,
Mark
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf
Hi,
My case is much simpler, I have a JMS gateway reading from a queue into a channel.
I want to use an aggregator to combine several messages. I am getting the error:
"AggregatingMessageHandler requires the 'correlationId' property"
Was this issue resolved in a certain snapshot?
Thanks,
Marwan
Sorry to revive an old thread...
So how do you use the outbound gateway? Here is what I am trying to do in order to test a request/reply scenario:
- I am using a MessageChannelTemplate object to send a request message to a channel, which is set as the request-channel of an outbound gateway:
Code:requestChannelTemplate.send(requestMsg, requestChannel);I want the current thread to block until a reply is received.Code:<integration:channel id="requestChannel" /> <jms:outbound-gateway connection-factory="singleConnectionFactory" request-channel="requestChannel" request-destination-name="queue:request" reply-destination-name="queue:reply" />
- In a separate thread, send a JMS reply, simulating a response from an external system.
On the reply message, no matter what I set the JMS or Spring Integration correlation ID to, the request always times out. How is the reply message being correlated to the request? What do I need to do in order to get this to work?