jakartaee / jakartaee/messaging

Allow Java EE components other than MDBs to consume messages asynchronously

Open
#100 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CDI integration jms21-forreview-major New Feature Priority: Major
Dominant language
Java
Stars
49
Forks
34
PR merge metrics
No merged PRs in 30d

Description

This proposal suggests the addition of the following annotation: @MessageSelector, to be used on a @MessageDriven bean consumimng a Queue or as Topic Subscriber.

Example:

```
package sample;

// imports

@MessageDriven(mappedName = "jms/queue0")
public class MessageSelectorBean implements MessageListener {

@Resource(lookup = "jms/connectionFactory")
ConnectionFactory connectionFactory;

@MessageSelector("(StockSector = 'Technology')")
public void onMessage(Message message) {
try (JMSContext context = connectionFactory.createContext()) {
String request = ((TextMessage)message).getText();
Destination replyDestination = message.getJMSReplyTo();
TextMessage replyMessage = context.createTextMessage("Reply to: "+request);
context.createProducer().send(replyDestination, replyMessage);
} catch (JMSException ex) {
// log an error here
}
}
}
```
#### Affected Versions
[2.0]

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

The issue names no files, tests, or entry points. Start by reviewing the Jakarta Messaging specification and clarifying whether @MessageSelector applies beyond MDBs; done requires an agreed API design for asynchronous message consumption and its scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.