jakartaee / jakartaee/messaging

Take advantage of EJB 3.2's RA improvement for MDBs

Open
#116 8 comments 0 reactions 0 assignees View on GitHub
CDI integration jms21-forreview-major messagedriven New Feature Priority: Major ra
Dominant language
Java
Stars
49
Forks
34
PR merge metrics
No merged PRs in 30d

Description

In a late change to the EJB 3.2 spec, a new feature around building MDBs without requiring method-level implementations has been added, specifically for use within the RA.

I am proposing that the JMS spec take advantage of this new feature in the following ways:

The description references this email thread from the EJB Spec: [http://java.net/projects/ejb-spec/lists/jsr345-experts/archive/2013-03/message/49](http://java.net/projects/ejb-spec/lists/jsr345-experts/archive/2013-03/message/49)

1\. Introduce a new interface "javax.jms.JMSMessageEndpoint" (or similar name) that can be used as a marker interface required by MessageEndpointFactory.getEndpointClass(). It shall have no methods, not extend any other interface but simply exist to be a marker that the given class will have its public methods exposed as potential targets for messages received by the RA.

2\. Introduce a new annotation, or possibly several annotations, to represent the configuration available to these methods. I believe we should support something more fluid (e.g. compiler friendly) than the existing ActivationConfigProperty set.

3\. Currently, the onMessage method is defined by looking for a method named "onMessage" that takes a "Message" object as an argument. This algorithm should be changed to also look for any instance of "JMSMessageEndpoint", find any method that is annotated as XXX (whatever is defined in 2) as a possible target, then depending on there being a match between that takes anything that derives from "Message" and only pass appropriate messages to it.

Some down sides:

1\. The EG has already voted to not require an RA with every implementation.
2\. This is a late change, so is the EJB equivalent.
3\. Currently, MDB behavior and RA aren't necessarily defined within the JMS spec.

Contributor guide

Open the contributing guide

Research direction

Start with the JMS specification areas covering MessageEndpointFactory, MDBs, and resource adapters, then read the linked EJB Spec email thread. Determine whether the proposed marker interface, annotations, and message-dispatch rules have an agreed design; done requires a settled specification change rather than an implementation alone.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
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.