2 Replies Latest reply on Oct 31, 2011 2:02 AM by girish.n

    Session re-attachment not working in 2.2.5

    girish.n

      Hi all,

       

      We are evaluating Hornetq 2.2.5 Final version (currently using 2.0.0 GA version).

       

      Our JMS servers are deployed on different machines and will need server restart on various occasions independent of the other application servers. So auto client reconnection and session reattachement is very important.

       

      This was working fine in 2.0.0 GA, but having issues in 2.2.5 Final. We have tried with various options without any success.

       

      Following is the hornetq-jms.xml configuration

       

       

      <connection-factory name="NettyConnectionFactory">
           <xa>false</xa>
           <connectors>
                <connector-ref connector-name="netty"/>
           </connectors>
           <entries>
                <entry name="/ConnectionFactory"/>
           </entries>
           <block-on-durable-send>true</block-on-durable-send>
           <block-on-acknowledge>true</block-on-acknowledge>
           <block-on-non-durable-send>true</block-on-non-durable-send>
           <connection-ttl>120000</connection-ttl>
           <client-failure-check-period>30000</client-failure-check-period>
           <call-timeout>300000</call-timeout>
           <retry-interval>1000</retry-interval>
           <retry-interval-multiplier>1.0</retry-interval-multiplier>
           <reconnect-attempts>-1</reconnect-attempts>
           <failover-on-server-shutdown>true</failover-on-server-shutdown>
           <confirmation-window-size>1000000</confirmation-window-size>
      </connection-factory>
      

       

       

      But it seems that when HornetQ server is restarted, the client session gets closed and we get exceptions on client side. There is no re attachment happening when server starts again.

       

      Please let us know if there is anything missing in this configuration.

       

      Thanks!

        • 1. Re: Session re-attachment not working in 2.2.5
          clebert.suconic

          A shutdown is treated different at the moment... it will send a notificatino to clients so they can reconnect on a backup node.

           

          Try setting failoverOnShutdown=false.

          • 2. Re: Session re-attachment not working in 2.2.5
            girish.n

            Hi Clebert,

             

            Thanks for your support. I had tried that earlier itself without success. After few trials, now I found that the issue is due to presence of another connection factory entry with same name ("NettyConnectionFactory") in the xml. The following xml worked fine without any issues.

             

             

            <configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
                      <connection-factory name="NettyConnectionFactory">
                                <xa>false</xa>
                                <connectors>
                                          <connector-ref connector-name="netty"/>
                                </connectors>
                                <entries>
                                          <entry name="/ConnectionFactory"/>
                                </entries>
                                <block-on-durable-send>true</block-on-durable-send>
                                <block-on-acknowledge>true</block-on-acknowledge>
                                <block-on-non-durable-send>true</block-on-non-durable-send>
                                <retry-interval>1000</retry-interval>
                                <reconnect-attempts>-1</reconnect-attempts>
                                <confirmation-window-size>1048576</confirmation-window-size>
                                <connection-ttl>120000</connection-ttl>
                                <client-failure-check-period>30000</client-failure-check-period>
                                <call-timeout>300000</call-timeout>
                      </connection-factory>
            
                      <queue name="DLQ">
                                <entry name="/queue/DLQ"/>
                      </queue>
                      <queue name="ExpiryQueue">
                                <entry name="/queue/ExpiryQueue"/>
                      </queue>
            </configuration>
            

             

            Can this be a bug?

             

            Regards,

            Girish