Skip to content

Conversation

@mattrpav
Copy link
Contributor

No description provided.

@mattrpav mattrpav self-assigned this Aug 30, 2023
@tabish121
Copy link
Contributor

tabish121 commented Aug 30, 2023

I don't see any testing here so not sure this actually works (will likely work somewhat based on it using the hacked in asynchronous send bits from years ago) but it is not going to spec compliant. The asynchronous send API has a quite onerous set of requirements that need to be implemented and so some rigorous testing should be added for all those requirements.

Section 7.3 in the Jakarta 3.1 specification should be referenced when writing the tests as it lays out pretty well what needs to be handled.

One that needs special care is that ordering of the completions must be done in order of the sends themselves, so if intermixing PERSISTENT and NON_PERSISTENT sends (also adding in the complexities of responses when using anonymous senders to multiple destinations) you need to ensure that a response for a later sent message does not trigger a completion until every send that came before it has completed.

Also there are restrictions on what the user code can do with both the sent message and the JMS resources. Messages need to be made read only until the completion has fired, and client code cannot call things like session close, connection close, or transaction commit / rollback on its own session inside of the completion.

There's other rules like when JMS APIs should block until all completions are actioned before proceeding etc.

All of the specification requirements ideally should be tested to ensure you are conforming and handling all the fun edge cases this feature introduces

@mattrpav
Copy link
Contributor Author

@tabish121 Yep, agreed. This is PR is still WIP. Just starting to flush out the methods and figure out the best place to house the signaling needed b/w the Context and the CompletionListener.

ActiveMQ already has the AsyncCallback wired all the way down to the transport send w/ async support, so I think it can mostly piggy back on that approach in terms of where and when to invoke the callback.

The heavy lifting will come here shortly to cover the thread awareness and other fun checks as you mentioned.

@mattrpav mattrpav changed the title [AMQ-8324] JMS 2.0 Producer CompletionListener methods WIP: [AMQ-8324] JMS 2.0 Producer CompletionListener methods Sep 30, 2023
@jbonofre jbonofre added this to the 6.1.0 milestone Oct 21, 2023
@mattrpav mattrpav closed this by deleting the head repository Jan 11, 2024
@kenliao94
Copy link
Contributor

@mattrpav I have a draft PR that did exactly what you suggested "mostly piggy back on that approach in terms of where and when to invoke the callback" I will raise it and get back to this thread with link to the pull request.

@kenliao94
Copy link
Contributor

^ #1303

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants