4 Replies Latest reply on May 27, 2015 3:44 AM by alex12345x

    hornetq - drop in progress messages at notification

    alex12345x

      Hello,

       

      I have the following scenario: 

      - 2 messages that were received on a certain queue and are now being handled (Msg1 (param="X"), Msg2 (param="Y"))

      - 3 messages on the queue that were not handled yet in the following order: (Msg3 (param="Stop_X"), Msg4(param="X"), Msg5(param=Y))

       

      When Msg3 is added to the queue (with a certain parameter = "StopX") I would like to end execution of all threads currently being processed from the queue that have param="X", meaning Msg1 (param="X") and also messages that are on the queue Msg4(param="X")

       

      Is there a predefined way to do this in hornetq?

       

      Thank you

        • 1. Re: hornetq - drop in progress messages at notification
          jbertram

          Is there a predefined way to do this in hornetq?

          No.

          • 2. Re: hornetq - drop in progress messages at notification
            alex12345x

            There must be something that could help me in Hornetq api. Even if it's not predefined per se.

            I know there are interceptors that could help me intercept StopX messages, then I could somehow (how?) get the messages that are in progress and drop them.

             

            Also I was expecting something more like a smarter last value queue. The last value queue, from what I've read "discard any messages when a newer message with the same value for a well-defined Last-Value property is put in the queue" .. I basically need the same thing only the Last-Values should be discarded based on Another_value.

            • 3. Re: hornetq - drop in progress messages at notification
              jbertram

              In order to stop a message in progress you'd first have to identify which client got the message.  Then you'd have to contact that client somehow and tell it to stop processing that message.  Accomplishing said tasks when the clients and server are all in the same JVM is one thing, but it's quite different when the clients are distributed across the network.  In any case, I can't think of any tools to facilitate the server-side cancellation of an in-delivery message.

               

              In regards to the last value queue...The messages that are discarded are messages that are not in-delivery.  Even if there was a "smarter" LVQ as you described it would still only operate on messages which are not in-delivery.

              1 of 1 people found this helpful
              • 4. Re: hornetq - drop in progress messages at notification
                alex12345x

                Maybe I could do this the hard way by adding something in a distributed cache and checking at some predefined checkpoints.

                Your last answer clarified some things for me. thank you.