3 Replies Latest reply on May 29, 2012 11:20 AM by Andy Taylor

    Question regarding (durable) Topics on remote HornetQ-Server

    pacodelucia Newbie

      Hi

       

      I have a question regarding durable topics with hornetq.

       

      I found a similar thread about this, but it did not exactly respond my question. I also googled and read tutorials about this.

       

      Firstly the setup:

      - I'm using JBoss 5.1 together with HornetQ 2.5.

      - JBoss does connect to hornetq remotely.

      - A topic is set up on hornetq

      - I have an MDB with a durable subscription on this topic

       

      As I understand it a durable subscription defines that if one of the topic consumers is not currently listening to a topic then the message will be delivered when it is listening again. But in order to do this a topic has to know about the existence of the consumer. If hornetq ist locally deployed (on the same JBoss-Server as the MDB) I assume that the MDB will register before the topic will process and deliver any messages.

       

      But when I'm connecting to a remote topic then it might be that I'm starting the JBoss Instance with my MDB and while it is starting there are already messages written to the topic and - because the MDB ist not "listening" yet - the message is "lost". Is this correct?

       

      If yes: is there a soution to this problem? The only solution I could imagine is that there is some way to specify the listeners to the topic on the hornet queue server. So that it knows that there will be listeners. The queue could then hold back the message and deliver it as soon as the MDB is ready.

       

      I could of course also use a Queue which consumes a message and then puts it into another queue for each listener I want to be notified (somhow implementing topics myself with queues).

       

       

      Another related question: How does hornetq maintain the list of listening durable topics? Maybe I remove a MDB which previously had a durable subscription. How does a remote hornetq instance know that it does not have to hold back messages for this MDB?

       

      Thanks and regards

      Oliver

        • 1. Re: Question regarding (durable) Topics on remote HornetQ-Server
          Andy Taylor Master

          There is no difference as to how this works with both an invm and a remote server. The very first time the MDB is deployed the durable subscription will be created, from this point on it will always exist. any messages delivered before this point will be discarded. You need to make sure that the first time you deploy the MDB you make sure no clients are sending messages.

          1 of 1 people found this helpful
          • 2. Re: Question regarding (durable) Topics on remote HornetQ-Server
            pacodelucia Newbie

            Thanks for your answer. But how would I remove such a durable subscription? Let's assume that an application that was subscribed to a topic is not used anymore. Someone shuts down the application server where the MDB consuming the topic was running. The HornetQ-Server will never know and keep the messages "forever" for this particular consumer. Can I remove such a durable subscription manually?

            • 3. Re: Question regarding (durable) Topics on remote HornetQ-Server
              Andy Taylor Master

              Thanks for your answer. But how would I remove such a durable subscription? Let's assume that an application that was subscribed to a topic is not used anymore. Someone shuts down the application server where the MDB consuming the topic was running. The HornetQ-Server will never know and keep the messages "forever" for this particular consumer. Can I remove such a durable subscription manually?

              Thats sort of the idea with Durable subscriptions, they out last the lifetime of the consumer. If you want ro remove then you will need to use the management API or i think you can do it via the console