0 Replies Latest reply on Jul 2, 2008 4:40 AM by mclu

    best practice for JTA based consuming and delegating

    mclu

      Hi all!
      I am a little confused.

      I have to receive messages from a local queue and have to delegate this to some business logic (Session Beans) (which persists data in a DB);

      I have to ensure that the message order is preserved, also in case of rollbacks or exceptions. I also have to ensure that the consuming and the business logic is handles in one transaction.

      My first idea was to receive messages via a MDB but in case of setRollbackOnly() the MDB container does not retry the same message so order is scrambled.

      Then I thought to create a Service which starts a plain receiver which uses jmsXA Connectionfactory to create a transacted receive. Message by Message.

      My question. Does this also starts a JTA transaction where my called Sessionbeans later enlist to? Or must I start a transaction by hand?

      I am searching for the best practice to receive messages and process them by my ejb3 session and entitybeans in one transaction.