0 Replies Latest reply on Sep 10, 2013 6:20 AM by Poonam Kamboj

    JBoss EAP 6.1.0 - JMS remote client do switch automatically to backup, when live and backup are configured with SSL.

    Poonam Kamboj Newbie

      Hello,

       

      I have two JBoss EAP 6.1.0 instances. One instance is configured as HornetQ LIve server and other as HornetQ backup server with SSL configuration.

      Below are the live and backup server configuration details.

       

      LIve server configuration details

       

      <subsystem xmlns="urn:jboss:domain:messaging:1.3">

                  <hornetq-server>

                      <persistence-enabled>true</persistence-enabled>

                      <allow-failback>true</allow-failback>

                      <failover-on-shutdown>false</failover-on-shutdown>

                      <shared-store>false</shared-store>

                      <journal-type>NIO</journal-type>

                      <journal-min-files>2</journal-min-files>

                      <cluster-password>${jboss.messaging.cluster.password:change me}</cluster-password>

                      <backup-group-name>secondPair</backup-group-name>

                      <check-for-live-server>true</check-for-live-server>

                      <connectors>

                          <netty-connector name="netty" socket-binding="messaging"/>

                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                          </netty-connector>

                          <in-vm-connector name="in-vm" server-id="0"/>

                          <connector name="netty-ssl-connector">

                           <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                           <param key="host" value="<<machine IP were Jboss is running>>"/>

                           <param key="port" value="5500"/>

                           <param key="ssl-enabled" value="true"/>

                          </connector>

                      </connectors>

       

      <acceptors>

                          <netty-acceptor name="netty" socket-binding="messaging"/>

                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                              <param key="direct-deliver" value="false"/>

                          </netty-acceptor>

                          <in-vm-acceptor name="in-vm" server-id="0"/>

                          <acceptor name="netty-ssl-acceptor">

                            <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                              <param key="host" value="<<machine IP were Jboss is running>>"/>

                                <param key="port" value="5500"/>

                                  <param key="ssl-enabled" value="true"/>

                                    <param key="key-store-path" value="<<server keystore path>>"/>

                                      <param key="key-store-password" value="change me"/>

                                        <param key="trust-store-path" value="<<server trust store path>>"/>

                                          <param key="trust-store-password" value="change me"/>

                                          </acceptor>

                       </acceptors>

                      <broadcast-groups>

                          <broadcast-group name="bg-group1">

                              <socket-binding>messaging-group</socket-binding>

                              <broadcast-period>5000</broadcast-period>

                              <connector-ref>

                                    netty

                              </connector-ref>

                              <connector-ref>

                                   netty-ssl-connector

                              </connector-ref>

                          </broadcast-group>

                      </broadcast-groups>

       

      Similar is the configuration for the backup server with <backup>true</backup>.

       

      my JMS client connects to the live server using remote protocol. I have set below properties in JNDI context along with required security credentials.

       

      initialContextFactory=org.jboss.naming.remote.client.InitialContextFactory

      urlPkgPrefixes=org.jboss.naming

      brokerURL=remote://<<machine IP of live server>>:4447, remote://<<machine IP of backup server>>:4447

       

      I start the client using below command

       

      java -Djavax.net.ssl.keyStore=<<client key store>> -Djavax.net.ssl.keyStorePassword=<<change me>> -Djavax.net.ssl.trustStore=<< client trust store>> -Djavax.net.ssl.trustStorePassword=<<change me>> -classpath $CLASSPATH Test

       

      Client get connect to the live server.

       

      Now when I bring down the live server, backup server becomes active Howerver cilent do not automatically switch to the backup. Also I do not see any failover exception on the client when live server goes down.

       

      What configuration I need to do for automatic switch of client to backup server when Live and backup are configured with SSL?