1 Reply Latest reply on Apr 28, 2016 4:58 PM by Justin Bertram

    Receive previous messages

    José Andrés Pizarro Newbie

      Hello,

       

      I am planning to develop an application that allows to recover processing information from several systems. My proposal for this applicatoin is based on hornetq where several producers will send messages and one or more receivers will process the messages based on push/sub messaging.

       

      My question at this point is if HornetQ allows to load previously sent messages so any client will be able to restore the status upon connection.

       

      Maybe my explanation has been not so helpful, so it may be better to give a simple example.

       

      Consider a set of system that will send log lines in the shape of messages.

      I need to create a client that is able to restore the full log (or the most of it) when it reconnects.

       

      I do not need a detailed answer. I would only need an answer to these questions?

       

      1. Can HornetQ do this?

      2.- In case it is, can anyone give me some ket concepts I need to explore in order to clear my mind?

       

      Thanks a lot in advance.

        • 1. Re: Receive previous messages
          Justin Bertram Master

          In the pub/sub model all messages which are published to an address will go into any applicable subscriptions.  If no subscription exists then the message will simply be deleted.  There are two types of subscriptions - durable and non-durable.  A durable subscription, once created, will remain on the broker and receive messages whether or not the client is connected.  A non-durable subscription only exists while the client is connected.

           

          If your client creates a durable subscription then it will be able to fetch any messages that were sent while it was disconnected, but obviously any messages published before the subscription is created will not be available to that client.