jakartaee / jakartaee/messaging

Clarify whether you can call createContext on a QueueConnectionFactory or TopicConnectionfactory

Open
#138 5 comments 0 reactions 0 assignees View on GitHub
jms20-errata jms21-forreview-minor Priority: Major Type: Bug
Dominant language
Java
Stars
49
Forks
34
PR merge metrics
No merged PRs in 30d

Description

In the JMS 2.0 API, the legacy JMS 2.0 interfaces QueueConnectionFactory and TopicConnectionfactory inherit the methods createContext from ConnectionFactory.

However, this implies that an object which is specific to either queues or topics is capable of generating an object (a JMSContext) that must work with both queues and topics.

Section 9.2 of the JMS 2.0 specification "Method inheritance across messaging domains" addresses the general issue of domain-specific interfaces inheriting methods which are not appropriate to that particular messaging domain, such as the createTopic method which a QueueSession inherits from Session. It lists a number of inherited methods which must throw an IllegalStateException.

The absence of createContext from that list means that the JMS 2.0 specification currently requires that calling createContext on a QueueConnectionFactory or TopicConnectionfactory must be supported.

We might wish to consider whether we should extend the list in 9.2 to require that calling createContext on a QueueConnectionFactory or TopicConnectionfactory must similarly throw an IllegalStateException. This would be more consistent, though since JMS 2.0 is already released it may be too late to require this since it would probably constitute an incompatible change.

Perhaps the best approach is to confirm that these methods must be supported, and that the JMSContext that is returned must support both queue and topics. This would not remove any functionality from users and so not be an incompatible change. And it is unlikely that providers would have any difficulties implementing it.
#### Affected Versions
[2.0]

Contributor guide

Open the contributing guide

Research direction

Start with JMS 2.0 specification section 9.2, “Method inheritance across messaging domains,” and compare its listed exceptions with createContext on QueueConnectionFactory and TopicConnectionFactory. Determine whether the specification should require support for both messaging domains or require IllegalStateException, then document the resolved behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.