Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-1973

ActiveMQ Resource Adapter does not work with user transactions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Critical Critical
    • None
    • JBoss A-MQ 6.3
    • rar-jee
    • None
    • Hide

      Use CMT instead of BMT

      Show
      Use CMT instead of BMT
    • Hide

      To reproduce the issue just deploy a very simple MDB

      @MessageDriven(
      		activationConfig ={
      				@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      				@ActivationConfigProperty(propertyName="destination", propertyValue="testQueue"),
      				@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
      				@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "15")
      })
      @ResourceAdapter("amq-ra")
      @TransactionManagement(TransactionManagementType.BEAN )
      public class BMTMdbRedeliveryTesting implements MessageListener {
      	private static final Logger log = Logger.getLogger(BMTMdbRedeliveryTesting.class);
      	@Resource
          private UserTransaction utx;
      
      	public BMTMdbRedeliveryTesting() {
      
          }
      
      
      	/**
           * @see MessageListener#onMessage(Message)
           */
      	public void onMessage(Message message) {
          	  	try {
      utx.begin()
          throw new RuntimeException("Reject Message");
      ute.commit;
      } catch (Throwable t){
      utx.setRollbackOnly();
      }
      

      The message should be rejected/redelivered a number of times and eventually send to DLQ. But that is not what happens.

      Show
      To reproduce the issue just deploy a very simple MDB @MessageDriven( activationConfig ={ @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue="testQueue"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "15") }) @ResourceAdapter("amq-ra") @TransactionManagement(TransactionManagementType.BEAN ) public class BMTMdbRedeliveryTesting implements MessageListener { private static final Logger log = Logger.getLogger(BMTMdbRedeliveryTesting.class); @Resource private UserTransaction utx; public BMTMdbRedeliveryTesting() { } /** * @see MessageListener#onMessage(Message) */ public void onMessage(Message message) { try { utx.begin() throw new RuntimeException("Reject Message"); ute.commit; } catch (Throwable t){ utx.setRollbackOnly(); } The message should be rejected/redelivered a number of times and eventually send to DLQ. But that is not what happens.

      When a MDB annotated with

      @TransactionManagement(TransactionManagementType.BEAN )

      throws a RuntimeException the message processing appears to be suspended. I would expect to see a number of attempts to redeliver the message and eventually send it to DLQ. But that does not happen.

              Unassigned Unassigned
              rhn-support-toross Tom Ross
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: