JBoss EAP 6 - integration with Websphere MQ
jayvijayraj Jul 25, 2013 4:56 AMHi
I would like to use the JBoss EAP 6 to deploy the MDB to fetch messages from Websphere MQ.
Here are my configurations.
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "EP_WS_ASYNC = 'ON'"),
...
@ActivationConfigProperty(propertyName = "useDLQ", propertyValue = "false") })
@ResourceAdapter("wmq.jmsra.rar")
@TransactionManagement(TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class AsyncWSEndpointMDBImpl implements MessageListener {
@Resource
private MessageDrivenContext mMDC;
public void onMessage(Message msg) {
....
}
private void rollbackMessage(Exception e) {
mMDC.setRollbackOnly();
log.info("The message " + messageID + " initiates message Rollback procedure..");
}
}
Here is my resource adapter configuration
Resource-adapter
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
<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.ManagedConnectionFactoryImpl" jndi-name="java:jboss/jms/MqConnectionFactory" pool-name="MqConnectionFactoryPool">
....
</resource-adapter>
When I am trying to rollback the message back to MQ when certain condition is fails, i could not do so as it fails complaining.
Message : java.lang.IllegalStateException: JBAS014315: setRollbackOnly() not allowed without a transaction.
What i understood that with
@TransactionManagement(TransactionManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
I should be able to use non-XA transaction for rollback the message to MQ. kind of standard EJB container transaction should be supported. Could someone know how to do so? Am I missing any configuration here? Regards,
ay