[
https://issues.apache.org/jira/browse/AMQ-8324?focusedWorklogId=948760&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-948760
]
ASF GitHub Bot logged work on AMQ-8324:
---------------------------------------
Author: ASF GitHub Bot
Created on: 17/Dec/24 12:45
Start Date: 17/Dec/24 12:45
Worklog Time Spent: 10m
Work Description: cshannon commented on PR #1364:
URL: https://github.com/apache/activemq/pull/1364#issuecomment-2548368213
> I just pushed a commit that uses a single-threaded Executor to perform the
async send, and have that background thread wait until the current async send
is finished. So application sender thread is not blocked (meet threading
restriction) and async send is done one at a time. This will preserve ordering
across the session "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."
>
> TODO: Need to add a few more tests.
I actually don't think this is the correct design. I think we _want_ to
block the send call for now if we are just going to handle one at a time and
essentially treat it like sync. As far as I know there is nothing that says the
sender can't block and wait for the other thread to complete and it's much,
much simpler. You could simply submit a task to execute the callback and wait
for the future before continuing.
Besides that, I don't see a benefit of the design to try and have a
background thread that waits because:
1. It very much increases complexity. I only briefly looked at the PR but
the amount of extra handling involving count down lathes and things is going to
make this very hard to not have a ton of bugs.
2. You are not going to gain any performance. You have to wait for each
message to process one at a time anyways if you are waiting for the callback
handler.
3. If you are not blocking the sending thread and you keep letting the
sender send more messages how are you queueing that up and applying
backpressure?
Issue Time Tracking
-------------------
Worklog Id: (was: 948760)
Time Spent: 4h 50m (was: 4h 40m)
> Implement JMS 2.0 MessageProducer CompletionListener methods
> ------------------------------------------------------------
>
> Key: AMQ-8324
> URL: https://issues.apache.org/jira/browse/AMQ-8324
> Project: ActiveMQ Classic
> Issue Type: New Feature
> Reporter: Matt Pavlovich
> Assignee: Matt Pavlovich
> Priority: Major
> Labels: #jms2
> Fix For: 6.2.0
>
> Time Spent: 4h 50m
> Remaining Estimate: 0h
>
> CompletionListener, etc
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact