Configure MQ Resource Adapter for MDB - JBoss 7.1
pauld1119 Jan 19, 2012 3:35 PMI'm using JBoss AS 7.1.0.CR1 and am having issues getting my resource adapter for Websphere MQ (wmq.jmsra.rar) working. My server starts fine and I see in the output that my admin object and connection factory are being bound:
JBAS010401: Bound JCA ConnectionFactory [java:jboss/jms/MQCF]
JBAS010401: Bound JCA AdminObject [java:jboss/jms/AE.C3.NOTIFICATION.DATAGRAM]
FYI - When I define all the properties using annotations, the MDB works:
e.g.:
@MessageDriven(name = "RepositoryNotificationListener", activationConfig = {
@ActivationConfigProperty(propertyName = "messagingType", propertyValue = "javax.jms.MessageListener"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "NOTIFICATION.DATAGRAM"),
@ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QLD001A"),
@ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
@ActivationConfigProperty(propertyName = "hostName", propertyValue = "HOST_NAME_REMOVED "),
@ActivationConfigProperty(propertyName = "port", propertyValue = "60001"),
@ActivationConfigProperty(propertyName = "channel", propertyValue = "A.CLIENT"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")
})
@ResourceAdapter("wmq.jmsra.rar")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
This is not my preferred approach however, as I'd like to keep the configuration on the application server as properties can change in different environments.
I'm fairly confident that the configuration is correct for the resource adapter now, as the resource adapter would not deploy properly otherwise.
I've tried using a generic version of the annotations, again moving most of the config to the application server:
@MessageDriven(name="RepositoryNotificationListener", , activationConfig = {
@ActivationConfigProperty(propertyName = "messagingType",propertyValue = "javax.jms.MessageListener"),
@ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:jboss/jms/NOTIFICATION.DATAGRAM"),
@ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true")
})
@ResourceAdapter("wmq.jmsra.rar")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
I'm also tried using Spring MDB, referencing the connection factory jndi as well as the admin object, but either way, I am not able to connect to the host and get the message off the queue. I feel like there's some disconnect between the admin object and the connection factory. Maybe I'm off base, but given that you can add multiple connection factories and the admin object is defined as a sibling to the connectionFactories, how does it know which to use? (I though the Spring solution would solve my issue as it references both)
excerpt from my standalone-full.xml (some names have been changed to protect the innocent)
<resource-adapters>
<resource-adapter>
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>
NoTransaction
</transaction-support>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="java:jboss/jms/MQCF" enabled="true" pool-name="java:jboss/jms/MQCF">
<config-property name="port">60001</config-property>
<config-property name="hostName">HOST_NAME_REMOVED </config-property>
<config-property name="channel"> A.CLIENT</config-property>
<config-property name="transportType">CLIENT</config-property>
<config-property name="queueManager">QLD001A </config-property>
<validation>
<background-validation>
true
</background-validation>
<background-validation-millis>
0
</background-validation-millis>
</validation>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/jms/NOTIFICATION.DATAGRAM" enabled="true" use-java-context="false" pool-name="java:jboss/jms/NOTIFICATION.DATAGRAM">
<config-property name="baseQueueName">NOTIFICATION.DATAGRAM</config-property>
<config-property name="baseQueueManagerName"> QLD001A</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
Has anyone been able to create a resource adapter for wmq and provide an associated mdb in Jboss 7.1?