5 Replies Latest reply on Aug 17, 2012 4:30 AM by unficyp

    auto delete of queues

    unficyp

      Hi,

       

      i use hornetq 2.2.14 in an embedded server with core api only, so no jms or hornetq-rest is used.

       

      The embedded server creates a topic and starts a jetty server to which webclients can connect.

      On a new connection, i create a queue for this client (session.createQueue(queueName, client_id,true);) and the client polls for events.

      If the client id already exists, i create a consumer (session.createConsumer(client_id,selector);)

       

      Everything is working fine. I've built a management page to display all queues on the server and i can see, that the number of queues is growing with each new client.

      Is there a way to let the client-queue timeout after a while ? Say, after 300 seconds with no connect to that queue the queue shall be deleted from  the server ?

       

      EDIT:

      i can't use hornetq-rest, because we have to emulate another system that has its own syntax for GET requests and response

        • 1. Re: auto delete of queues
          unficyp

          To be more specific:

          I need a way to delete a queue after a consumer didn't receive from the queue after a specified time.

          Is there a build in mechanism to achieve this ?

           

          thanks,

          gw

          • 2. Re: auto delete of queues
            unficyp

            Anyone ?

            • 3. Re: auto delete of queues
              gaohoward

              I don't think there is such a mechanism in HornetQ. Why not delete the queue yourself, considering that it is not so hard a logic to implement?

               

              Howard

              • 4. Re: auto delete of queues
                jbertram

                To my knowledge there is no feature in HornetQ which will do this for you.  It is an interesting feature, though - a queue TTL (time to live).  If we were to add such a feature we'd probably want to generalize it a bit to make it useful outside your specific use-case.  For example:

                 

                • Ability to configure an absolute TTL or a dynamic TTL based on some other criteria.
                • Ability to define the criteria to use for the dynamic TTL (e.g. when a message is consumed from the queue, when a message is produced to the queue, etc.).

                 

                It's not a terribly simple feature.  If you want us to consider it further please open a JIRA describing exatly what you need and the use-case you're attempting to address (or perhaps just reference this thread if is has everything).

                1 of 1 people found this helpful
                • 5. Re: auto delete of queues
                  unficyp