0 Replies Latest reply on Oct 26, 2005 5:31 PM by duslow

    Odd DLQHandler behavior

    duslow

      I have an MDB attached to a JBoss JMS queue. The MDB uses a custom invoker-proxy-binding as well as a custom container-configuration.

      The invoker-proxy-binding has the following settings:
      
      <MaximumSize>1</MaximumSize>
      <MaxMessages>1</MaxMessages>


      The container-configuration has the following settings:
      
      <container-pool-conf>
       <MaximumSize>100</MaximumSize>
       <MinimumSize>1</MinimumSize>
       <strictMaximumSize>true</strictMaximumSize>
      </container-pool-conf>


      If I send 2 messages to the queue with a retry set in the message to 0, below is the chain of events.

      1. Message 1 is delivered to the MDB
      2. Message 1 is processed which results in an Exception.
      3. MDB catches the exception and setRollBackOnly on the context.
      4. Message 2 is delivered to the MDB
      5. Message 2 is processed which results in an Exception.
      6. MDB catches the exception and setRollBackOnly on the context.
      7. DLQHandler forwards Message 1 to the DLQ.
      8. DLQHandler forwards Message 2 to the DLQ.

      This is the chain of events I expected to happen:

      1. Message 1 is delivered to the MDB
      2. Message 1 is processed which results in an Exception.
      3. MDB catches the exception and setRollBackOnly on the context.
      4. DLQHandler forwards Message 1 to the DLQ. **
      5. Message 2 is delivered to the MDB
      6. Message 2 is processed which results in an Exception.
      7. MDB catches the exception and setRollBackOnly on the context.
      8. DLQHandler forwards Message 2 to the DLQ.

      It appears that the DLQHandler is waiting for a "slot" on the queue to free up so that it can execute its own thread. I would have assumed that the DLQHandler would not be tied down by the invoker-proxy-binding of the MDB in terms of being able to run its tasks parallel to the MDBs attached to the queue.

      This behaviour also happens if the Maximum Size is set to 2 and you send 3 or more messages all at once or set to 10 and you send 11 or more messages. The DLQHandler doesn't move any message to the DLQ until enough messages are off the queue that it has a free MDB "slot" to use.

      The problem this delayed move of the message to the DLQ is that I have other MDBs attached to the DLQ as well so that upstream systems can be notified that something failed. However, these notifications do not show up sometimes for many hours since the queue is constantly full of inbound messages, or a single message takes along time to be consumed (ie the business process it invokes is long running).

      Is this a bug, or do I have something misconfigured?

      The setup:

      OS: Linux and Windows
      Java: 1.4.2
      JBoss: 3.2.6

      Thanks in advance,
      Dustin Barlow