8 Replies Latest reply on Jul 30, 2012 9:15 AM by blacar

    Acknowledge mode using STOMP protocol

    blacar

      Hello all!

       

      I've been searching information about the way HornetQ deals with acknowledgement when using STOMP protocol. I am aware about the "receipt" header causes the server to answer with an ACK frame but ...

      It is possible to define the acknowledge mode in some way like in JMS? (auto, dups_ok, client) I've seen the "ack" header (auto, client, client-individual) defined in SUBSCRIBE frame for STOMP 1.1

       

      Thanks in advance.

        • 1. Re: Acknowledge mode using STOMP protocol
          gaohoward

          Hi,

           

          That latest HornetQ 2.3.0.Alpha supports Stomp 1.0 and 1.1. So you can use the 'ack' modes defined in Stomp with HornetQ.

           

          Howard

          1 of 1 people found this helpful
          • 2. Re: Acknowledge mode using STOMP protocol
            blacar

            mmm ... but it is supposed thet STOMP 1.1 is supported since 2.2.14

             

            http://hornetq.blogspot.com.es/2011/10/stomp-11-support-in-hornetq.html

             

            ... in fact i am using some of the 1.1 frames and features.

             

            Anyway ... i'll check the "ack" header

             

            Thanks.

            • 3. Re: Acknowledge mode using STOMP protocol
              blacar

              Doing a quick test it seems like "client-individual" is not working properly (¿?) ... it is acting as "client" mode.

               

              I've sent the "ack:client-individual" header in the SUBSCRIBE frame

               

              SUBSCRIBE

              id:0

              ack:client-individual

              destination:jms.queue.TestQueue

               

              Ive started to consume messages sending one ACK frame each five messages with message-id equal to last one ...

               

              ACK

              subscription:0

              message-id:2147513061

               

              As result only 2 ACK messages was sent but there are 10 less messages in the server looking at "MessageCount".

              It seems like it woks as "client" mode.

               

              Can anyone confirm?

              Is there something i've missed?

               

              Thanks in advance.

              • 4. Re: Acknowledge mode using STOMP protocol
                gaohoward

                What version are you using? 'client-individual' means you need to acknowledge each message received. 'client' means once you acknowledge one message, all previously received un-acked messages will be acknowledged also. If this is not what you observed, can you please create a jira and provide a simple test case?

                 

                Thanks

                Howard

                • 5. Re: Acknowledge mode using STOMP protocol
                  blacar

                  Hi

                   

                  I am using 2.2.14

                   

                  I've created https://issues.jboss.org/browse/HORNETQ-992

                   

                  Regards,

                  • 6. Re: Acknowledge mode using STOMP protocol
                    blacar

                    By the way looking at the source code in the definition of the STOMP protocol (HornetQ 2.2.14) at org.hornetq.core.protocol.stomp.Stomp.java i can see ...

                     

                    "...

                           public interface Subscribe       {         

                              String DESTINATION = "destination";         

                              String ACK_MODE = "ack";         

                              String ID = "id";         

                              String SELECTOR = "selector";         

                              String DURABLE_SUBSCRIBER_NAME = "durable-subscriber-name";         

                              String NO_LOCAL = "no-local";          

                     

                              public interface AckModeValues          {            

                                   String AUTO = "auto";            

                                   String CLIENT = "client";         

                              }      

                         }

                    ..."

                     

                    Since there are any "client-individual" ack mode defided i can understand it is not implemented in 2.2.14 ... is this correct?

                     

                     

                    Thanks.

                    1 of 1 people found this helpful
                    • 7. Re: Acknowledge mode using STOMP protocol
                      gaohoward

                      hmm, strange. If 2.2.14 is claimed to support Stomp 1.1, it should be defined there.

                      Anyway I checked trunk, the definition includes 'client-individual'. So you might want to try 2.3.0.Alpha.

                       

                      Howard

                      • 8. Re: Acknowledge mode using STOMP protocol
                        blacar

                        Yong Hao Gao wrote:

                         

                        hmm, strange. If 2.2.14 is claimed to support Stomp 1.1, it should be defined there.

                        Yes ... that was my assumption but i've downloaded 2.2.14 source and is not

                         

                         

                        Anyway I checked trunk, the definition includes 'client-individual'. So you might want to try 2.3.0.Alpha.

                         

                         

                        Ok

                         

                        Thanks indeed!