@Override
  protected ServerLocator internalNewObject(URI uri, Map<String, String> query, String name)
      throws Exception {
    ConnectionOptions options = newConnectionOptions(uri, query);

    DiscoveryGroupConfiguration dgc =
        getDiscoveryGroupConfiguration(uri, query, getHost(uri), getPort(uri), name);

    if (options.isHa()) {
      return ActiveMQClient.createServerLocatorWithHA(dgc);
    } else {
      return ActiveMQClient.createServerLocatorWithoutHA(dgc);
    }
  }
Пример #2
0
 protected ServerLocatorInternal getServerLocator() throws Exception {
   return (ServerLocatorInternal)
       addServerLocator(
               ActiveMQClient.createServerLocatorWithHA(
                   getConnectorTransportConfiguration(true),
                   getConnectorTransportConfiguration(false)))
           .setRetryInterval(50);
 }
    public void start() throws Exception {
      liveNode.start();
      waitForServerToStart(liveNode.getActiveMQServer());
      backupNode.start();
      waitForRemoteBackupSynchronization(backupNode.getActiveMQServer());

      locator = ActiveMQClient.createServerLocatorWithHA(liveConnector).setReconnectAttempts(-1);
      sessionFactory = locator.createSessionFactory();
    }