1 2 Previous Next 22 Replies Latest reply on Apr 18, 2014 9:59 AM by jbertram Go to original post
      • 15. Re: Re: Multiple DLQs in  HornetQ
        sankalp.madaan

        Yes I understand now about DLAs. But I am getting null while using _HQ_ORIG_QUEUE property. And it is very important for me to determine which subscriber failed. Can I have any way out?

         

        Here are the details of my MDB.

         

        @MessageDriven(activationConfig = {
          @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
          @ActivationConfigProperty(propertyName = "destination", propertyValue = "/topic/NORSTopic"),
          @ActivationConfigProperty(propertyName = "user", propertyValue = "user"),
          @ActivationConfigProperty(propertyName = "password", propertyValue = "password"),
          @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"), 
          @ActivationConfigProperty(propertyName = "clientID", propertyValue = "Durable-Sub"),
          @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),         
             @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=localhost;port=5445"),
          @ActivationConfigProperty(propertyName = "subscriptionName",propertyValue = "client1"),
          })
        
        




        • 16. Re: Re: Multiple DLQs in  HornetQ
          jbertram

          From what I can see in org.hornetq.tests.integration.client.DeadLetterAddressTest.testBasicSend() in the HornetQ test-suite the "_HQ_ORIG_QUEUE" property should have the name of the queue (i.e. subscription) where the message was originally sent.  If you're not seeing that then I would need a test of some kind to reproduce that behavior.

           

          In any event, if it's so important to know which MDB failed then why not simply write that information to the log?

          • 17. Re: Re: Re: Multiple DLQs in  HornetQ
            sankalp.madaan

            Actually I need that information to be stored in DB which will be used for later reprocessing the logic. Can you give any example using _HQ_ORIG_QUEUE property? Also can you verify my MDB has been declared properly. May be I am missing something there and that's why it is coming as null

             

            @MessageDriven(activationConfig = {
            
              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
              @ActivationConfigProperty(propertyName = "destination", propertyValue = "/topic/NORSTopic"),
              @ActivationConfigProperty(propertyName = "user", propertyValue = "username"),
              @ActivationConfigProperty(propertyName = "password", propertyValue = "password"),
              @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
              @ActivationConfigProperty(propertyName = "clientID", propertyValue = "Durable-Sub"),
              @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),        
                @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=localhost;port=5445"),
              @ActivationConfigProperty(propertyName = "subscriptionName",propertyValue = "client1"),
              @ActivationConfigProperty(propertyName = "messageSelector",propertyValue = "affiliate = 'NNA'"),
              @ActivationConfigProperty(propertyName = "shareSubscriptions", propertyValue="true")
            
              })
            
            
            • 18. Re: Re: Re: Multiple DLQs in  HornetQ
              jbertram

              Actually I need that information to be stored in DB which will be used for later reprocessing the logic.

              Obviously that will have to be done by your application since HornetQ doesn't use a database of any kind.

               

              Can you give any example using _HQ_ORIG_QUEUE property?

              Check my previous comment.  I referenced an example.

               

              Also can you verify my MDB has been declared properly.

              Your MDB's activation configuration properties look fine to me.

              • 19. Re: Re: Re: Re: Multiple DLQs in  HornetQ
                jbertram

                Out of curiosity I modified the "mdb-cmt-setrollbackonly" example we ship in HornetQ to mimic what you're doing.  Everything worked as expected with the "_HQ_ORIG_ADDRESS" property containing the subscription name and client ID the MDB was using.

                 

                I'm attaching that example here.

                 

                Please note, this was done on the "master" branch so it might not work if you're dropping it into an earlier version.

                • 20. Re: Re: Multiple DLQs in  HornetQ
                  jbertram

                  FYI - I added a new Java EE example to the HornetQ distribution in https://github.com/hornetq/hornetq/pull/1619 to demonstrate this functionality.

                  • 21. Re: Re: Multiple DLQs in  HornetQ
                    sankalp.madaan

                    Thanks Justin. I checked the examples. I am doing exactly the same. The only difference between your example and my code is that  I am using an object Message instead of text message and I am using a MDB listener for DLQ instead of creating a receiver. But I am getting name of topic for _HQ_ORIG_ADDRESS and null for _HQ_ORIG_QUEUE. I am not able to figure out what I am missing.

                    • 22. Re: Re: Multiple DLQs in  HornetQ
                      jbertram

                      I did a quick change on the example to test with an ObjectMessage rather than a TextMessage and everything worked as expected.  To investigate further I'll need some kind of test case or example from you to demonstrate the behavior you're seeing.

                      1 2 Previous Next