jakartaee / jakartaee/messaging

Clarification of 7.3.5

Open
#342 0 comments 0 reactions 0 assignees View on GitHub
challenge
Dominant language
Java
Stars
49
Forks
34
PR merge metrics
No merged PRs in 30d

Description

**Context**
The Apache ActiveMQ team is in the process of completing a few remaining JMS 3.1/2.0 features and we plan to provide developer guides to highlight key specification areas.

**Description**
Section 7.3.5 calls for the asynchronous CompletionListener to _not_ be used in Jakarta EE web container or Enterprise Beans container.

I'm seeking clarification of the origin of this advisory and understanding if this still applies in all use cases.

**Questions**

What is the original reasoning behind this recommendation? We suspect it has to do with thread lifecycle or context.

Does "Jakarta EE web container" mean any application making JMS calls that originate through a Jakarta Servlet API?

Does this still apply to Jakarta web applications invoked using an async request?

***Specification Section**
```
7.3.5. Restrictions on usage in Jakarta EE

An asynchronous send is not permitted in a Jakarta EE web container or Enterprise Beans container.

The following methods must therefore not be used in a Jakarta EE web container or Enterprise Beans container:

jakarta.jms.MessageProducer method send(Message message, CompletionListener completionListener)

jakarta.jms.MessageProducer method send(Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener)

jakarta.jms.MessageProducer method send(Destination destination, Message message, CompletionListener completionListener)

jakarta.jms.MessageProducer method send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, CompletionListener completionListener)

jakarta.jms.JMSProducer method setAsync(CompletionListener completionListener)

All the methods listed in this section may throw a jakarta.jms.JMSException (if allowed by the method) or a jakarta.jms.JMSRuntimeException (if not) when called by an application running in the Jakarta EE web container or Enterprise Beans container. This is recommended but not required.
```

Contributor guide

Open the contributing guide

Research direction

Start with the quoted Jakarta Messaging specification section 7.3.5 and the listed MessageProducer and JMSProducer CompletionListener methods. Research the reason for the restriction, the meaning of Jakarta EE web and Enterprise Beans containers, and whether async requests change it. Done means recording a clear clarification for each question.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
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.