9 Replies Latest reply on Apr 7, 2010 1:37 PM by tujiao

    Duplicate message received.

      i'm write an message received as a thread.

       

      but i'm restart the thread there can receive the duplicated message as same as before received message.

       

      why?

        • 1. Re: Duplicate message received.
          timfox

          Did you see the big link in BIG LETTERS, that says "PLEASE READ THIS BEFORE YOU POST?" on the main page of the HornetQ forum?

          • 2. Re: Duplicate message received.

            but i need some helps.

             

            because i'm useing hornetq now in my projects.

             

            i'm thins this is not a bug~~

            • 3. Re: Duplicate message received.
              clebert.suconic

              We just don't have enough information to even guess what's happening.

               

              For instance:

               

              arden emily wrote:

               

              i'm write an message received as a thread.

               

              but i'm restart the thread there can receive the duplicated message as same as before received message.

               

              why?

               

               

              For starters: I don't think the above phrase make any sense.

               

              "I'm write an message receive as a thread."

               

              You can't write a message a thread. That's probably a grammar mistake you made in english...

               

               

              The above link Tim sent you suggested you to read the manual and make sure you understand how it works before you post a question.

               

              Even if you still don't understand what's happening.. you should at least find a concise and easy to explain your issue with basic english .. then we can try helping you.

               

              It doesn't need to be perfect english grammar (I'm not a native english speaker for instance)..

               

              If you want help.. you need to find a way to be understood.

              • 4. Re: Duplicate message received.

                i'm write a programs that source in the attach files. Please see the source code.

                 

                1) i'm start the Hornetmq that use bin/run.sh.

                 

                2) i'm start the StartServer.java    -->  a thread that receive messages.

                 

                3) i'm start the StartClient.java   -->  a client that send messages.

                 

                4) first the StartServer.java can receive some messages.

                 

                5) now i'm restart the StartServer.java, that can receive some messages again.but i'm hope cant't receive some message again, because i'm send no message again.

                 

                6) if this bug can't resolve, i'm only can use ActiveMQ.

                 

                 

                Thank's very much.

                • 5. Re: Duplicate message received.
                  clebert.suconic

                  Please, don't use rars.. those are not standard files. I had to hack around and find how to open those files for you.

                   

                  You should always call message.acknowledge() for every message received. (or the message will be redelivered once you restart the server.

                   

                  I had to debug your whole project to find your bug. When we mean a simple program.. we mean a simple/single program. (not a 12 MB project).

                   

                   

                  6) if this bug can't resolve, i'm only can use ActiveMQ.

                   

                   

                  As you can see.. this is your bug. *No one* can do any magic.

                  • 6. Re: Duplicate message received.

                    You should always call message.acknowledge() for every message received.

                     

                    i'm do that, but still can't do work well.

                    • 7. Re: Duplicate message received.
                      timfox

                      arden emily wrote:

                       


                       

                      6) if this bug can't resolve, i'm only can use ActiveMQ.

                       


                      Good idea, annoy them instead.

                       

                      It's better than wasting our time with non issues and vague postings.

                      • 8. Re: Duplicate message received.
                        clebert.suconic

                        arden emily wrote:

                         

                        You should always call message.acknowledge() for every message received.

                         

                        i'm do that, but still can't do work well.

                        You probably want to specify batchSize = 0:

                         

                        http://hornetq.sourceforge.net/docs/hornetq-2.0.0.GA/api/org/hornetq/api/core/client/ClientSessionFactory.html#createSession(boolean, boolean, int)

                         

                        use createSession(....., 0) for the batch size.

                         

                         

                        Or make your session transacted and call commit on the session at the times you need to confirm ACKs are sent on the server. (what would prevent re-delivery).

                         

                        Message was edited by: Clebert Suconic

                        • 9. Re: Duplicate message received.

                          thanks very much for Clebert Suconic helps.

                           

                          i'm use the: session = sf.createSession(true, true, 0);

                           

                          and then the problems are resolved.