Announcement Announcement Module
Collapse
No announcement yet.
JMS Outbound Gateway Timeouts Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMS Outbound Gateway Timeouts

    Hi. I'm trying to understand the best way to handle JMS outbound gateway timeouts. As far as I can understand it, the options are as follows:

    1) Call the JMSOutbound gateway via a direct channel. Have the component calling the channel catch the exception thrown by the gateway in case of timeout. Seems a bit clunky.
    2) Set the "ERROR_CHANNEL" header before calling the JMS outbound gateway via a pollable channel. Implement a component on the other end of the error channel to handle the timeout error. Better, but still clunky.
    3) Put an upstream pub/sub channel in front of the JMS gateway (which still needs a pollable channel so the exception doesn't take out the calling thread) then have a aggregator downstream. The aggregator aggregates the message that would have gone into the gateway, as well as the reply, but in case the reply doesn't appear sends a message to the aggregators timeout channel. This works, but seems, well, clunky.
    4) Extend JMSOutboundGateway to add a timeout channel, similar to the aggregator.

    Am I missing something here? How do people normally handle this?

    Thanks

  • #2
    Originally posted by jcranney View Post
    3) Put an upstream pub/sub channel in front of the JMS gateway (which still needs a pollable channel so the exception doesn't take out the calling thread) then have a aggregator downstream. The aggregator aggregates the message that would have gone into the gateway, as well as the reply, but in case the reply doesn't appear sends a message to the aggregators timeout channel. This works, but seems, well, clunky.
    You can add a <dispatcher/> inside the channel and dig the original message out of the ErrorMessage that is sent to the error channel, you can also add a task-executor attribute on the pub-sub. Did you miss those options?

    I'm not entirely sure what you mean by "doesn't take out the calling thread", but it seems that you missed some async handoff options. If you think life could be easier if there were some changes to the jms outbound gateway, then please create a JIRA for it (with a few more code samples )

    Comment

    Working...
    X