jms-spec
  1. jms-spec
  2. JMS_SPEC-110

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

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      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 JMS_SPEC-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(), ...

        Activity

        axel_podehl created issue -
        Nigel Deakin made changes -
        Field Original Value New Value
        Tags jms21-forreview-minor

          People

          • Assignee:
            Unassigned
            Reporter:
            axel_podehl
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: