1 Reply Latest reply on Jul 17, 2003 12:48 PM by adrian.brock

    MDB Redelivery with BMT

    parkert

      Hi,

      I'm trying to test redelivery of a jms message to an MDB using bean managed transactions with an out of the box installation of 3.2.1.

      As I understand it, if I throw an EJBException, the message should be rolled back for redelivery but this doesn't appear to happen. The configuration of the bean is:

      <?xml version="1.0"?>


      <invoker-proxy-bindings>
      <invoker-proxy-binding>
      test-message-driven-bean
      <invoker-mbean>default</invoker-mbean>
      <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
      <proxy-factory-config>
      DefaultJMSProvider
      StdJMSPool
      1
      1
      True

      10

      queue/testDLQ
      10
      10000000


      </proxy-factory-config>
      </invoker-proxy-binding>
      </invoker-proxy-bindings>

      <enterprise-beans>
      <message-driven>
      <ejb-name>testMDB</ejb-name>
      <destination-jndi-name>queue/testMDB</destination-jndi-name>
      <invoker-bindings>

      <invoker-proxy-binding-name>test-message-driven-bean</invoker-proxy-binding-name>

      </invoker-bindings>
      <resource-ref>
      <res-ref-name>jms/QCF</res-ref-name>
      <jndi-name>ConnectionFactory</jndi-name>
      </resource-ref>
      </message-driven>
      </enterprise-beans>



      and the onMessage is as follows:

      public void onMessage(Message message) {

      if(message instanceof TextMessage) {
      try {
      System.out.println("Received TextMessage: " + ((TextMessage)message).getText());
      } catch (JMSException e){
      e.printStackTrace();
      }
      } else {
      System.out.println("Received message of type: " + message.getClass().getName());
      }
      throw new EJBException("Please roll back this message!!!!");
      }

      Does anyone have any ideas? I'm using bean managed transactions as I have some operations that I would like to perform if the transaction completes and can't see another way to watch the transaction.

      Thanks,

      Tim

        • 1. Re: MDB Redelivery with BMT

          The user transaction has no link to the JMS Transaction
          used to deliver the message.

          Why not ask the transaction manager for the transaction
          and register a synchronization with it.

          Regards,
          Adrian