jeanouii commented on PR #1728:
URL: https://github.com/apache/activemq/pull/1728#issuecomment-3997624139

   @cshannon Yes I took a look at the PR and previous discussions.
   
   Yes it explicitely addresses
   
   > 7.3.8. Use of the CompletionListener by the Jakarta Messaging provider
   > A session will only invoke one CompletionListener callback method at a 
time. For a given MessageProducer or 
   > JMSContext, callbacks (both onCompletion and onException) will be 
performed in the same order as the corresponding calls to the asynchronous send 
method.
   
   Some key points I should have written in the PR description.
   
   1. One callback at a time: the session holds an 
Executors.newSingleThreadExecutor(). As discussed in the last PR, this goes 
against parallelism but guarantees the constraint is met. Also we still have 
our `AsyncCallback` that can be used to increase concurrency.
   2. Preserve order: the send is synchronized on the client side with the 
sendMutex. And the mutex is held until future.get() completes, which guarantees 
the sequentiality. This was your proposal I just implemented.
   3. Callback not in the sender thread:  that's exactly why there is the 
single thread executor.
   
   BTW by reviewing the PR again in order to verify the 3 points, I discovered 
a possible deadlock which I just fixed in the last commit. The build is still 
green and the TCK all pass.
   
   Hope it helps
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to