Is there a way to use MDB to connect to Tibco EMS that meets our design preferences?
New MDB Activation Configuration Property:
jndiJmsActivationSpecDefaultsAdminObject - jndi Location for a resource adapter admin object contains default values for an activation specfication. Values from this object will be used if the activation specifications setting for the corresponding value is null. This can be used to set environment specific runtime values for annotation based MDBs.
Configuration for Admin Object (JmsActivationSpecDefaultsAdminObject)
Defines default values that can be used for an activation specification. This can be used to set environment specific runtime values for annotation based MDBs. The MDB must refer to the admin objects jndi location using activation configuration property jndiJmsActivationSpecDefaultsAdminObject.
jndiParameters - the JNDI parameters used to perform the
lookup of the destination and the connectionFactory.
user - the name of the user used when connecting to the JMS
provider
password - the password used when connecting to the JMS provider
Example Config:
Example Admin Object in Resource Adapter:
<admin-objects>
<admin-object class-name="org.jboss.resource.adapter.jms.inflow.JmsActivationSpecDefaultsAdminObject" jndi-name="java:jboss/example/jmsActivationSpecDefaultsAdminObject" enabled="true" use-java-context="false" pool-name="jmsActivationSpecDefaultsAdminObject">
<config-property name="jndiParameters">
java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory;java.naming.provider.url=tcp://TIBCO_HOST:7222
</config-property>
</admin-object>
</admin-objects>
Example MDB MDB:
@MessageDriven( name = "ConsumeMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "jndiJmsActivationSpecDefaultsAdminObject", propertyValue = "java:jboss/example/jmsActivationSpecDefaultsAdminObject"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "example.queue"),
@ActivationConfigProperty(propertyName = "connectionFactory", propertyValue = "QueueConnectionFactory"),
})
@ResourceAdapter("generic-jms-ra-<VERSION>.rar" )
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class ConsumeMDB implements MessageListener {
Note, administered objects are not used for setting up asynchronous message
deliveries to message endpoints. The ActivationSpec JavaBean is used to hold all
the necessary activation information needed for asynchronous message delivery
setup.