7 Replies Latest reply on Jul 8, 2003 10:56 AM by Bernd Zeitler

    DLQ

    Tameshwar Sahu Newbie

      Hi,

      I have some requirement in my project in which I will be using DLQ. I wanted to test DLQ; how it works so I wrote one program, which sends messages to my queue and I started one receiver, which starts in CLIENT_ACKNOWLDGE mode. After receiving message I m not acknowledging messages. So after sometime these messages should go to DLQ. Am I right? But after 2-3 hours also message is not getting transferred to DLQ.
      Please let me know if my approach is correct.

      Please give your suggestions/ guideline.

      Thank you,
      Monu

        • 1. Re: DLQ
          Bernd Zeitler Expert

          Depends on the invoker-proxy-binding configuration for your MDB. The DLQConfig has a value for MaxTimesRedelivered before sending the message to your DLQ.

          Greetings,
          Frito

          • 2. Re: DLQ
            Tameshwar Sahu Newbie

            Thanks Frito,

            I have done that configuration and set the value to "2". I have tried to consume message more than 10 times without acknowledging them but still messages are in the same queue not moving out to DLQ. Could you help me and point out where i am making mistake?

            Regards,
            Monu

            • 3. Re: DLQ
              Adrian Brock Master

              When you get the message a second time, is the redelivered
              flag set?

              Regards,
              Adrian

              • 4. Re: DLQ
                Tameshwar Sahu Newbie

                Yes,

                Second time getJMSRedelivered() method returns TRUE.

                One more thing i would like to tell that i m using QueueReceiver not MDB.
                What makes a message to move from receiver queue to DLQ.

                Regards,
                Monu

                • 5. Re: DLQ
                  Bernd Zeitler Expert

                  Are you talking about a standalone application? You can't use a QueueReceiver in a session bean. This is why MDBs where invented ;-)
                  I missed this fact with your first posting. The DLQ is a configuration for MDBs, used by the container. AFAIK this is not a JMS feature.

                  Try this approach instead with application server:
                  Use CMT with MDBs. Configure the QueueConnectionFactory and the Queue as a managed resource for this MDB. The container will enroll the receiving of the message in a transaction. If you don't want to acknowledge the message during processing, use setRollBackOnly of the transactional context. This will put the message back into the source queue (or into the DLQ after MaxTimesRedelivered is reached).

                  Greetings,
                  Frito

                  • 6. Re: DLQ
                    Tameshwar Sahu Newbie

                    Thank you very much Frito,

                    I am talking about stand alone client. How can i put my messages in DLQ once max delivery attempt fails?

                    Thanks in advance,

                    --Monu

                    • 7. Re: DLQ
                      Bernd Zeitler Expert

                      As I told you: you can't but doing this by yourself (perhaps evaluating the redelivery flag or the message id, counting up for every id and sending the message to your dlq when the message was redelivered too many times), since this is not a JMS feature, it is a JBoss feature for MDBs.

                      The configuration I told you was a MDB container configuration.

                      Greetings,
                      Frito