jakartaee / jakartaee/messaging
add JMS methods to access an Object's creator: Message.getSession(), Session.getConnection(), ...
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 49
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
I know this might be against the API strategy of 'create-and-forget' (Connection creates Session, thereafter only use Session), but in several places it would be convenient to be able to get to an object's creator even after creation.
For example #68") suggests a method Session.acknowledge() to acknowledge() the complete Session instead of a misleading Message.acknowledge(). This is a good change, but within a MessageListener's onMessage(), you have access to the Message only, not the Session 
So to make proper use of Session.acknowledge(), I'm proposing a method Message.getSession() so that inside the onMessage() method you can simply call these, without having to remember the Session object:
* Message.getSession().acknowledge()
* Message.getSession().commit()
Once the API starts down this track, for consistency, it should probably go all the way:
Session.getConnection(), Connection.getFactory(), ...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the JMS Message, Session, Connection, and factory interfaces, along with the onMessage callback described in the issue. Determine whether creator access should be added consistently across the API and clarify lifecycle and compatibility expectations. Done means a coherent API decision with the necessary tests and documentation identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100