0 Replies Latest reply on Jun 27, 2013 4:10 AM by panratownik

    Producer blocks when sending non durable message during failure. How to not block.

    panratownik

      I would like to start discussion about sending non durable messages to HornetQ Standalone Server Queue when server is down or crashed. I'm using 2.3.0.Final version of HornetQ.

       

      I'm in situation where my messages aren't important so much so I don't need it to be durable. What I want is where the HornetQ Standalone Server is down or crashed then I want that my clients applications (several Producers and one Consumer) didn't block to wait for HornetQ server to start again. I configured the connection factory on the server side this way:

       

      <connection-factory name="NettyConnectionFactory">

            <xa>false</xa>

            <connectors>

               <connector-ref connector-name="netty"/>

            </connectors>

            <entries>

               <entry name="/ConnectionFactory"/>

            </entries>

            <!-- Pause 1 second between connect attempts -->

            <retry-interval>1000</retry-interval>

       

            <!-- Multiply subsequent reconnect pauses by this multiplier. This can be used to

            implement an exponential back-off. For our purposes we just set to 1.0 so each reconnect

            pause is the same length -->

            <retry-interval-multiplier>1.0</retry-interval-multiplier>

       

            <!-- Try reconnecting an unlimited number of times (-1 means "unlimited") -->

            <reconnect-attempts>-1</reconnect-attempts>

       

            <!-- When the server is cleanly shutdown we don't want to give up, we want to continue

            to try to reconnect -->

            <failover-on-server-shutdown>true</failover-on-server-shutdown>

       

            <!-- We need to specify a confirmation-window-size to enable re-attachment, default is -1 which

            means no re-attachment.

            We set in this scenario 10 MB window size

            -->

            <confirmation-window-size>10485760</confirmation-window-size>

       

            <block-on-durable-send>true</block-on-durable-send>

            <block-on-non-durable-send>false</block-on-non-durable-send>

         </connection-factory>

       

       

      And the reconnection is working but my producers when try to send messages to the queue blocks for 10 seconds when the failover occurs. I want it to doesn't block at all just forget about sending messages when failover take place.

      The Consumer application is working as I expected it block's and waiting for new messages even if Hornet goes down.

       

      Can somebody show me the way hot to handle such situations.

      Thanks a lot.