jakartaee / jakartaee/messaging

add JMS methods to access an Object's creator: Message.getSession(), Session.getConnection(), ...

Open
#110 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jms21-forreview-minor New Feature Priority: Major
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 ![](https://java.net/jira/images/icons/emoticons/sad.gif)

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.