Announcement Announcement Module
Collapse
No announcement yet.
ErrorHandling with SpringIntegration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ErrorHandling with SpringIntegration

    Hi,

    I am trying to achieve the following:

    A JMS consumer is communicating asynchronously with the Spring-Integration-driven backend. In my SI setup several services are usually executed consecutively before a response message is returned to the JMS consumer.

    I am not entirely sure how to design the error handling for this and would like to ask for input on that. Basically what I wanted to achieve is that the JMS consumer sets a JMS_replyTo flag in the messages and gets a reply on that channel back that either contains the response message or an exception. How do I realize this in SI? The happy case is quite simple since the JMS Inbound GW takes care of that but how do I realize that all services in the chain of execution send errors back on that JMS_replyTo queue as well? Any ideas? Obviously I can catch all exceptions on the errorChannel and then open a JMS connection from there posting the reply on the JMS_replyTo queue but I was wondering if there are simpler ways to achieve that plus I had difficulties receiving exceptions on the errorChannel when they come in via the JMS Inbound Gateway (the exceptions got "lost" and were not posted to the errorChannel even though I marked the inbound channel as pollable).

    Appreciate your help. Thanks.

  • #2
    We have just been polishing an implementation that involves an optional "error-channel" being configured on the JMS inbound-gateway. What that does is pass any Exceptions (caught at the gateway itself as a "last chance") within Messages that can be sent to that "error-channel". You could connect any flow you want, but often it's enough to provide a single <transformer> subscribed to that error-channel. Such a transformer can then modify the Exception to create some response Object that would then be returned to your JMSReplyTo.

    Does that sound like it will do the trick?

    Please let us know. We're in the final 2 days of 2.0 development.

    Thanks,
    Mark

    Comment


    • #3
      Hi Mark,

      Thanks for a quick reply.

      Originally posted by Mark Fisher View Post
      We have just been polishing an implementation that involves an optional "error-channel" being configured on the JMS inbound-gateway. What that does is pass any Exceptions (caught at the gateway itself as a "last chance") within Messages that can be sent to that "error-channel".
      Does that mean that if I register such a error-channel on the JMS Inbound GW and send it to a Transformer, it would catch any exceptions that occur further down the chains, regardless whether they following channels are pollable or not?

      And did I understand you right that the JMS GW takes care of sending the error message to the JMS_replyTo queue after it has called the transformer so basically regardless of whether the reply is contains an error or a proper response it will always end up on the JMS_replyTo queue? This would be fantastic.

      thanks.

      Comment

      Working...
      X