2 Replies Latest reply on Aug 5, 2013 3:41 AM by Andy Taylor

    Initial connections to backup servers.

    alexey907 Newbie

      Hi there,

      Checking API documentation and HornetQ sources for HornetQ 2.3.0, i can not find a way how to supply a backup server addresses when creating a ServerLocator from pre-defined list of server addreses.

      We cant not use multicast-based discovery for certain reasons, so i had to supply a list of server addresses to HornetQClient.createServerLocatorWithHA(initialServers). The question is: should i include backup servers to this list?


      When i tried to, client ocassionaly picked a backup server from this list before it tried primary servers, so it got stuck till the retries timeout reached.

      If i dont specify backup servers, client can not establish initialConnection when primary servers are down.

      In 2.0.0 this API was little bit differen, allowing me to explicitly separate primary and backup servers:

      List<Pair<TransportConfiguration, TransportConfiguration>> serverList =

      new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();

      serverList.add(new Pair<TransportConfiguration,

      TransportConfiguration>(liveTC0, backupTC0));

      serverList.add(new Pair<TransportConfiguration,

      TransportConfiguration>(liveTC1, backupTC1));

      serverList.add(new Pair<TransportConfiguration,

      TransportConfiguration>(liveTC2, backupTC2));

      ClientSessionFactory factory = new ClientSessionFactoryImpl(serverList);


      Is there any equivalent for this in 2.3.0?

      We have a cluster of 2 primary and 2 backup servers. Backups are running using "shared storage" mode.