10 Replies Latest reply on May 23, 2007 1:40 PM by Tim Fox

    Queue attributes not being implemented

    Stephen Campbell Newbie

      Hi Folks,

      I have downloaded version 1.2.0sp1 and cant seem to get any of the queue attributes to work, for example RedeliveryDelay, MaxNumberOfAttempts, DLQ etc.

      I can see from the JMX console that the values I am giving are being picked up and associated with the queue but unfortunately not being implementeD.

      An example of my queue config is below.

      <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=retryMessage2" xmbean-dd="xmdesc/Queue-xmbean.xml">

      <depends optional-attribute-name="ServerPeer">
      jboss.messaging:service=ServerPeer
      </ depends>

      < depends>
      jboss.messaging:service=PostOffice
      </ depends>

      < attribute name="DLQ">
      jboss.messaging.destination:service=Queue,name=retryMessage3
      </ attribute>

      < attribute name="RedeliveryDelay">
      120000
      </ attribute>

      </ mbean>

        • 1. Re: Queue attributes not being implemented
          Tim Fox Master

          These are implemented.

          Please see

          org.jboss.test.messaging.jms.ExpiryQueueTest
          org.jboss.test.messaging.jms.DLQTest
          org.jboss.test.messaging.jms.ScheduledDeliveryTest

          for demonstration of them working.

          • 2. Re: Queue attributes not being implemented
            Stephen Campbell Newbie

            Hi Tim,

            Thanks for the response, the Scheduled Delivery Test came in useful. However, i am still having problems setting the DLQ and RedeliveryDelay.

            From the examples you pointed me too, seem to work but this is by setting these values via the code. When i try to create a queue in the destinations-service.xml, they dont seem to work.

            Is there something else i should be setting somewhere in a config file to use these values or somewhere in the code to enable these to be used.

            Just to fill you in on what i am doing, is that i have an MDB reading messages off a queue, if an exception is thrown i am leaving the JBoss container to deal with the rollback, i am not specifically stating rollback as i do not need to use an XA transaction.

            Regards,
            Stephen

            • 3. Re: Queue attributes not being implemented
              Tim Fox Master

              If you are using MDBs then the mdb container has its own DLQ. This is outside the scope of JBM.

              Please see thread http://www.jboss.org/index.html?module=bb&op=viewtopic&t=102526 for more details.

              • 4. Re: Queue attributes not being implemented
                mskonda Apprentice

                Tim, i think this thread is related: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031979#4031979

                Some of the attributes are ommitted and a JIRA case(JBOSSMESSAGING-938) has been raised. I am not sure of the status of the JIRA case though.

                Thanks
                Madhu

                • 5. Re: Queue attributes not being implemented
                  Tim Fox Master

                  Madu- that task is not related to dlq or redelivery delay/

                  • 6. Re: Queue attributes not being implemented
                    Stephen Campbell Newbie

                    Hi Guys,

                    Still a bit confused by all this, sorry new to JBoss, had a look at that thread you pointed me at tim and it seems to be related to an older version, the standard-boss.xml file doesnt exist in my config.

                    Forgetting about DLQ for a minute, setting the redeliverydelay, by using MDB's is that affecting its usage. You stated in the thread you pointed me at about switching off something so JBM will take precedence will i need to do that to get the RedeliveryDelay working.

                    Sorry if i am annoying the hell out of you, just trying to get my head round this as we are one of the first in our area to use the new JBM :os

                    Regards,
                    Stephen

                    • 7. Re: Queue attributes not being implemented
                      Stephen Campbell Newbie

                      Hi Folks,

                      Still having massive problems with this, this is an integral part of our solution which we need to implement. Do you have any other ideas about what we could try, or give us a small list of steps we need to do in order for the JBoss RedeliveryDelay to be picked up using an MDB.

                      In our ejb we have the transaction type set to container.

                      Tim in one of your previous posts you stated : -

                      The MDB container / JCA layer also has its own DLQ - this is configured (normally) in standard-jboss.xml.

                      This will take precedence over the jboss messaging DLQ - you would need to turn this off, or maybe you want to use it.


                      How do we turn the MDB's default values off, as i said before i dont have a standard-jboss.xml file.

                      Should also add we are using JBoss 4.0.4 GA with JBM 1.2.0sp1

                      Hope you can help, i really need it!

                      Regards,
                      Stephen

                      • 8. Re: Queue attributes not being implemented
                        Tim Fox Master

                        The issue with redelivery delay and DLQ is as follows is related to the fact that the JBoss MDB container is situated between the JMS provider and the onMesssage of the MDB.

                        If you imagine, a message is received from the JMS provider (JBoss Messaging), then it gets sent to the MDB container, which does stuff like starting transactions if necessary, then it eventually gets sent to the onMessage method of the MDB.

                        The MDB container is not a part of JBoss Messaging, its a part of the app server and managed as a separate project.

                        So.. if an exception is thrown by the MDB, the exception is caught by the MDB container since that is the thing that immediately wraps the MDB, which then decides whether to redelivery, or sent the message to the DLQ etc.

                        As you can see from the above, this is handled further down the call stack from JBoss Messaging, so JBM does not have a chance to catch the exception and perform its own redelivery, sent to the JBM DLQ etc.

                        The MDB container can be configured with its own DLQ, max delivery attempts etc (see http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMDB), but currently does not contain functionality for redelivery delay.

                        So, when using JBM as the JMS provider for MDBs, the JBM redelivery delay attribute will effectively have no effect.

                        Weston Price (who is the lead for JBoss JCA which handles the MDB container) considered adding this functionality to the MDB container but so far it does not exist.

                        Hope that helps.

                        • 9. Re: Queue attributes not being implemented
                          Tim Fox Master

                          Just to clarify the above email.

                          If you *do not* wish to use the MDB container DLQ (this is the one configured here http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMDB and has nothing to do with JBM), and would rather use the JBM DLQ and benefit from the ability to specify different DLQs per queue with different values of MaxDeliveryAttempts, then you can comment out the DLQ section from http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMDB, to give something like:

                          <invoker-proxy-binding>
                           <name>message-driven-bean</name>
                           <invoker-mbean>default</invoker-mbean>
                           <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory>
                           <proxy-factory-config>
                           <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI>
                           <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
                           <CreateJBossMQDestination>true</CreateJBossMQDestination>
                           <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->
                           <MinimumSize>1</MinimumSize>
                           <MaximumSize>15</MaximumSize>
                           <KeepAliveMillis>30000</KeepAliveMillis>
                           <MaxMessages>1</MaxMessages>
                           <MDBConfig>
                           <ReconnectIntervalSec>10</ReconnectIntervalSec>
                           <!-- This is commented out - JBM dlq will be used instead
                           <DLQConfig>
                           <DestinationQueue>queue/DLQ</DestinationQueue>
                           <MaxTimesRedelivered>10</MaxTimesRedelivered>
                           <TimeToLive>0</TimeToLive>
                           </DLQConfig>
                           -->
                           </MDBConfig>
                           </proxy-factory-config>
                           </invoker-proxy-binding>
                          


                          Note that this will allow you to use the JBM DLQ, ExpiryQueue and MaxDeliveryAttempts values, but it *will not* allow you to use the JBM redelivery delay, since redelivery is implemented by the MDB container as explained in the previous post.

                          There's not really much we can do about other than change the MDB container to implement redelivery delay.

                          JBM Redelivery delay will only have an effect when *not* using MDBs

                          • 10. Re: Queue attributes not being implemented
                            Tim Fox Master

                            I have added a feature request on the app server for them to implement redelivery delay:

                            http://jira.jboss.com/jira/browse/JBAS-4438