jakartaee / jakartaee/messaging
Allow Java EE components other than MDBs to consume messages asynchronously
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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