0 Replies Latest reply on Jul 2, 2013 3:34 AM by zhongcy

    Useless codes in JMSBridge Or a bug?

    zhongcy

      hi everyone:

       

           i find that there have useless codes in JMSBridge in function named "sendBatchNonTransacted" , it is :

       

               if (qualityOfServiceMode == QualityOfServiceMode.ONCE_AND_ONLY_ONCE)

               {

                  // We client ack before sending

       

       

                  if (JMSBridgeImpl.trace)

                  {

                     HornetQJMSServerLogger.LOGGER.trace("Client acking source session");

                  }

       

                  messages.getLast().acknowledge();

       

                  if (JMSBridgeImpl.trace)

                  {

                     HornetQJMSServerLogger.LOGGER.trace("Client acked source session");

                  }

               }

       

       

      If the configure is ONCE_AND_ONLY_ONCE mode, the JMSBridge can't call the "sendBatchNonTransacted" function.  

       

      but  i find that, there has no operating about the "AT_MOST_ONCE" config.

       

       

      the user-manual :

      33.4.1. AT_MOST_ONCE

       

           With this QoS mode messages will reach the destination from the source at most once. The messages are consumed from the source and acknowledged before sending to the destination. Therefore there is a possibility that if failure occurs between removing them from the source and them arriving at the destination they could be lost. Hence delivery will occur at most once.

           This mode is available for both durable and non-durable messages.

       

       

      So,I guess that the if judge( if (qualityOfServiceMode == QualityOfServiceMode.ONCE_AND_ONLY_ONCE) ) should be changed like :

       

       

               if (qualityOfServiceMode == QualityOfServiceMode.AT_MOST_ONCE)

               {

                  // We client ack before sending

       

       

                  if (JMSBridgeImpl.trace)

                  {

                     HornetQJMSServerLogger.LOGGER.trace("Client acking source session");

                  }

       

                  messages.getLast().acknowledge();

       

                  if (JMSBridgeImpl.trace)

                  {

                     HornetQJMSServerLogger.LOGGER.trace("Client acked source session");

                  }

               }

       

       

      Is it a bug?    Or  I got it in a wrong way?