3 Replies Latest reply on Jun 20, 2008 6:47 AM by Andy Taylor

    Again Message Order and MDB

    Markus Lutum Novice

      Hi!

      Its mee again.
      I spend arround 5 hours now digging in JBM code to find out why my system behaves as it does.

      Testenvironment:
      - One local persistent Queue with a lot of messages in.
      - An EJB3 MDB attached to the Queue using maxSession and maxMessages set to 1
      - redelivery is set to MDBs default (5 think)
      - JBM 1.4.0 SP3 on 4.2.1 GA

      To test Logic errors and the ways JBM handles exceptions I set context.setRollbackOnly() while handling the messages in my MDB onMessage() method.


      What I thought is this behaviour of Message A B C....:
      A -> fail
      A -> fail
      A -> fail
      A -> fail
      A -> fail -> DLQ
      B -> fail
      B -> fail
      B -> fail
      B -> fail
      B -> fail -> DLQ
      and so on

      But what happens is always a handling of 2 messages:
      A -> fail
      B -> fail
      A -> fail
      B -> fail
      A -> fail
      B -> fail
      A -> fail
      B -> fail
      A -> fail -> DLQ
      B -> fail -> DLQ
      C -> fail
      D -> fail
      C -> fail
      D -> fail
      and so on...

      While debugging and tracing I see that the ClientConsumer
      calls removeFirst() on the BasicPriorityLinkedList from 2 Threads and in twisting manner the addFirst() and removeFirst() which lead in this A,B,A,B order.

      What can I do to have this AAAABBBB handling?