2 Replies Latest reply on Oct 24, 2013 10:03 AM by Clebert Suconic

    The code about transaction send in 2.3.0.Final

    Guangquan Hao Newbie

      Today,I read the source code of hornetq-core-client in 2.3.0.Final.I want to understand the process of ack and batch ack.I find the code as follows:

       

       

               final boolean sendBlockingConfig = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;

               final boolean forceAsyncOverride = handler != null;

               final boolean sendBlocking = sendBlockingConfig && !forceAsyncOverride;

      This code is in org.hornetq.core.client.impl.ClientProducer.

      I feel confused that when I send messages with transaction,the producer will send messages nonblocking,but what I see is that the send method will choose blocking or nonblocking according to the code as I presented above,it seems that the transation send has no relationship with blocking or nonblocking,Please help me.

        • 1. Re: The code about transaction send in 2.3.0.Final
          Guangquan Hao Newbie

          ClientProducerInternal producer = new ClientProducerImpl(this,

                                                                         address,

                                                                         maxRate == -1 ? null

                                                                                      : new TokenBucketLimiterImpl(maxRate, false),

                                                                         autoCommitSends && blockOnNonDurableSend,

                                                                         autoCommitSends && blockOnDurableSend,

                                                                         autoGroup,

                                                                         groupID == null ? null : new SimpleString(groupID),

                                                                         minLargeMessageSize,

                                                                         channel);

          Just now,I find the code above.It will add the transaction parameters(autoCommitSend) to the result of blockOnNonDurableSend and blockOnDurable.

          • 2. Re: The code about transaction send in 2.3.0.Final
            Clebert Suconic Master

            We block when you commit... commit will block until all the previous sent messages are finished.