Your expectation was incorrect. That config toggle existed from before the clients implementation of JMS 2.0 and only controls behaviour of send calls made without a CompletionListener in place. Specifically, it forces sync sends for non-persistent messages and inside a transactions. The explicitly async send using CompletionListener are *always* async. The CompletionListener is always fired from another thread, as required by the JMS spec, once a result is received from the server or once it is known none will be.
The different between sync and async is whether the send method returns before a final result for the send (e.g message accepted, message rejected) is known from the server. On 8 June 2018 at 17:03, akabhishek1 <mailbox.abhishek.ku...@gmail.com> wrote: > Hi Robbie, > While I am using - > *forceSyncSend=true* > and with a CompletionListener, I would expect the callback event to come on > the same thread that invoked the send(), however in my observation - I am > sending the message using the main thread and I am getting a response on to > the > JmsSession [ID:12c9fd67-aed5-4930-8da2-31cb3f99729d:1:1] completion > dispatcher > and that means any exception arising from the send() operation will not be > propagated to the main thread. > > *Is this behavior correct?* > > Does that mean that the difference of behavior between Sync and Async is the > callback of onCompletion() or onException() and nothing more...(as both are > working on their own threads) and only the server side code would be able to > understand the notification/exception but will not be able to propagate it > to the client....!!!! > > Attached is the code - TestQpidSendSync.java > <http://qpid.2158936.n2.nabble.com/file/t396358/TestQpidSendSync.java> > > /Steps to reproduce/ - > 1. Start the main > 2. Terminate the connection to the service bus while the main thread is > running > 3. it will attempt couple of times before throwing exceptions in the > CompletionListener's onException() > > > > -- > Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional commands, e-mail: users-h...@qpid.apache.org