i know this question is a very very basic fundamental concept in spring integration. but i got little confused about it. hope u guys can help me to figure it out.
i have a inbound file adapter like this
and another jms event driven adapter like this
and i am using a control bus to start these components when ever needs.
then i am using the error channel to monitor the exceptions. but only the file inbound related exceptions are coming through the error channel, not the jms related ones. it seems JMS related ones are propagated back to the sender.
in document it says
in i can not understand how file inbound become asynchronous and jms become synchronous. can you huys pls help me to understand this scenario?
When sending a Message to a channel, the component that ultimately handles that Message may or may not be operating within the same thread as the sender. If using a simple default DirectChannel (with the <channel> element that has no <queue> sub-element and no 'task-executor' attribute), the Message-handling will occur in the same thread as the Message-sending. In that case, if an Exception is thrown, it can be caught by the sender (or it may propagate past the sender if it is an uncaught RuntimeException). So far, everything is fine. This is the same behavior as an Exception-throwing operation in a normal call stack. However, when adding the asynchronous aspect, things become much more complicated. For instance, if the 'channel' element does provide a 'queue' sub-element, then the component that handles the Message will be operating in a different thread than the sender. The sender may have dropped the Message into the channel and moved on to other things. There is no way for the Exception to be thrown directly back to that sender using standard Exception throwing techniques. Instead, to handle errors for asynchronous processes requires an asynchronous error-handling mechanism as well.