[JMS_SPEC-55] Define a standard way to configure the connection factory used by a JMS MDB to consume messages Created: 07/Nov/11 Updated: 20/Mar/13 Resolved: 07/Feb/13
|Fix Version/s:||2.0FD, 2.0|
|Reporter:||Nigel Deakin||Assignee:||Nigel Deakin|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
This is a request for the EJB specification to define a standard way to configure the connection factory used by a MDB to consume messages.
Currently there is no standard way to do this, and vendors differ in the way in which connection information is specified in a MDB. Some vendors support an activation property connectionFactoryJndiName but this is not defined in the EJB 3.1 (or the JCA 1.6) specifications and support for it is not universal. In fact some vendors expect connection information to be specified directly using non-standard activation properties rather than via a connection factory.
This limits the portability of applications between different JMS providers, resource adapters and application servers. It will also hinder the automatic provisioning of JMS resources in a PaaS environment which is a goal of Java EE 7.
Two alternatives are proposed:
This would make it mandatory for application servers to support the activation property connectionFactoryJndiName. This would essentially standardise what some vendors support already.
This could be specified in ejb-jar.xml as follows:
...or using annotation as follows:
This option would propose that the <message-driven> element in ejb-jar.xml be extended to define an addition sub-element which can be used to specify the JNDI name of the connection factory used by a JMS message-driven bean to consume messages. A suggested element name is <connection-factory-jndi-name>:
To provide an equivalent annotation, a new attribute would need to be added to the @MessageDriven annotation. A suggested name is connectionFactoryJndiName:
It might be asked why this needs to be defined by a new subelement of <message-driven> and a new attribute of @MessageDriven rather than by a new standard activation configuration property. Possible answers are:
In brief, the options are:
1) New mandatory activation property connectionFactoryJndiName
|Comment by Nigel Deakin [ 05/Dec/12 ]|
The current proposal is to define a standard activation property connectionFactoryLookup.
However this is only possible if the connector spec can guarantee that the resource adapter will be able to perform the lookup in the endpointActivation call. I have logged
|Comment by Nigel Deakin [ 07/Feb/13 ]|
The JMS 2.0 and EJB 3.2 specifications now define a activation property connectionFactoryLookup. This is defined as follows (JMS 2.0 section 13.1 "MDB activation properties"):
This issue is now incorporated in the JMS 2.0 spec and can be marked as resolved.