5 Replies Latest reply on Mar 6, 2013 2:03 AM by Michel Werren

    Message delivered twice

    Michel Werren Novice

      Hello

       

      In my case i have two clients. client A sends a message to an address that contains a single non durable and non temporary queue on which Client B has registered its consumer. This queue will be created on client B startup (if it not already exists).

       

      In the common case, that both client are up and running, the message delivery works as expect. But when client B is down during client A sends a message and client B comming up again, the message will be deliverd twice to consumer of client B.

       

      Client A is connected per In VM and client B remote.

       

      I use HornetQ 2.2.13.Final and the core API.

       

      Anyone advice?

       

      regards

      Michel

        • 1. Re: Message delivered twice
          Clebert Suconic Master

          Can  you write some code to show your example... I'm not sure what you're doing... so maybe Javanese will be easier to understand than english on this case.

           

           

          Even though.. it's possibly related to you now acking messages.. so they would be redelivered.

           

           

          Or maybe it's about you creating multiple queues and one queue for each consumer what would also be expected to behave like that. (I mean.. core-queues).

          • 2. Re: Message delivered twice
            Michel Werren Novice

            I found the problem ... its the message acknowledge. I create the session of client B as follows

             

            session = sessionFactory.createSession(userName, password, false, true, true, false, 0);

             

            But the autoCommitAcks seem to be without an effect. Because when i ack the message manually with Message.acknowledge() it works as expect.

             

            I have to say i use HornetQ in a JBoss AS 7.1.1.Final with the related address configuration;

             

            <address-settings>

                                <address-setting match="#">

                                    <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                                    <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                                    <redelivery-delay>0</redelivery-delay>

                                    <max-size-bytes>10485760</max-size-bytes>

                                    <page-size-bytes>7864320</page-size-bytes>

                                    <address-full-policy>PAGE</address-full-policy>

                                    <message-counter-history-day-limit>10</message-counter-history-day-limit>

                                </address-setting>

                            </address-settings>

            • 3. Re: Message delivered twice
              Andy Taylor Master

              But the autoCommitAcks seem to be without an effect. Because when i ack the message manually with Message.acknowledge() it works as expect.

              auto commit auto commits the session but you still have to ack the message.

              1 of 1 people found this helpful
              • 4. Re: Message delivered twice
                Clebert Suconic Master

                Are you using core... the true is about auto-flush acks.. not about auto-ack..

                 

                You always need to ack on the core API. The controls on the session are about when to flush a bunch of ACKs to the server. Think of Dups-OK on JMS Terms for instance.

                • 5. Re: Message delivered twice
                  Michel Werren Novice

                  Thanks a lot!

                   

                  Regards Michel