cshannon commented on PR #1364:
URL: https://github.com/apache/activemq/pull/1364#issuecomment-2536480372

   I took a look at the existing Async API and it's not actually documented 
anywhere that I can see of how it is supposed to work. So I actually don't 
think it would be a problem to just have the old API follow the same behavior 
as the spec, the order of completion callback isn't defined anywhere and there 
is no spec for the AMQ api so if we made it process in order it would be fine.
   
   I think it's always going to be better to implement the spec 100% if 
possible. My primary hesitation was about unexpected behavior changes from the 
existing async API but since it isn't documented (as I mentioned) I don't think 
it's a problem if we complete the callbacks in order.
   
   So I am leaning towards the idea that we should try and figure out if we can 
add a way to actually do that so we are spec compliant. Right now the 
callbacks/requests are only tracked in a map in the response correlator, I 
think we'd need to add something extra to track the order of submission as well 
and make sure to only execute the callback on a completed request once there 
are no previous requests. We'd need to make sure we didn't have too much queued 
up at once so that means timeouts or even blocking the send if there is 
outstanding stuff. 
   
   Only simple way I think to meet the requirement is to only send one message 
at a time and wait for the response before sending the next one. This would 
make the behavior similar to a normal sync send but it would still complete 
async and is spec compliant.  The only requirement is the callback is not 
executed in the same thread but you could in theory just only allow one to be 
submitted at a time (wait for each send to complete before sending the next 
one). 
   
   I don't know that it's a good idea to simply use the existing async code and 
then say we will fix it later as that just establishes newly expected behavior 
that will either change which could cause users problems or more likely it will 
just be ignored and never fixed for real like ti should be.
   
   


-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to