Package org.hornetq.core.config

Examples of org.hornetq.core.config.ClusterConnectionConfiguration


      TransportConfiguration backupConnector = getConnectorTransportConfiguration(false);
      backupConfig.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
      backupConfig.getConnectorConfigurations().put(backupConnector.getName(), backupConnector);
      ArrayList<String> staticConnectors = new ArrayList<String>();
      staticConnectors.add(liveConnector.getName());
      ClusterConnectionConfiguration cccLive = new ClusterConnectionConfiguration("cluster1", "jms", backupConnector.getName(), -1, false, false, 1, 1,
            staticConnectors, false);
      backupConfig.getClusterConfigurations().add(cccLive);
      backupServer = createBackupServer();
      backupServer.getServer().setIdentity("bkpIdentityServer");

      liveConfig = super.createDefaultConfig();
      liveConfig.getAcceptorConfigurations().clear();
      liveConfig.getAcceptorConfigurations().add(getAcceptorTransportConfiguration(true));
      liveConfig.setSecurityEnabled(false);
      liveConfig.setSharedStore(true);
      liveConfig.setClustered(true);
      List<String> pairs = null;
      ClusterConnectionConfiguration ccc0 = new ClusterConnectionConfiguration("cluster1", "jms", liveConnector.getName(), -1, false, false, 1, 1,
            pairs, false);
      liveConfig.getClusterConfigurations().add(ccc0);
      liveConfig.getConnectorConfigurations().put(liveConnector.getName(), liveConnector);
      liveServer = createLiveServer();
   }
View Full Code Here


        final String discoveryGroupName = discoveryNode.isDefined() ? discoveryNode.asString() : null;
        final List<String> staticConnectors = discoveryGroupName == null ? getStaticConnectors(model) : null;
        final boolean allowDirectOnly = CommonAttributes.ALLOW_DIRECT_CONNECTIONS_ONLY.resolveModelAttribute(context, model).asBoolean();

        if (discoveryGroupName != null) {
            return new ClusterConnectionConfiguration(name, address, connectorName, retryInterval, duplicateDetection,
                    forwardWhenNoConsumers, maxHops, confirmationWindowSize, discoveryGroupName);
        } else {
            return new ClusterConnectionConfiguration(name, address, connectorName, retryInterval, duplicateDetection,
                    forwardWhenNoConsumers, maxHops, confirmationWindowSize, staticConnectors, allowDirectOnly);
        }
    }
View Full Code Here

        final int reconnectAttempts = RECONNECT_ATTEMPTS.resolveModelAttribute(context, model).asInt();
        final long maxRetryInterval = MAX_RETRY_INTERVAL.resolveModelAttribute(context, model).asLong();
        final double retryIntervalMultiplier = RETRY_INTERVAL_MULTIPLIER.resolveModelAttribute(context, model).asDouble();

        if (discoveryGroupName != null) {
            return new ClusterConnectionConfiguration(name, address, connectorName, minLargeMessageSize, clientFailureCheckPeriod, connectionTTL,
                    retryInterval, retryIntervalMultiplier, maxRetryInterval, reconnectAttempts, callTimeout,
                    duplicateDetection, forwardWhenNoConsumers, maxHops, confirmationWindowSize,
                    discoveryGroupName);
        } else {
            return new ClusterConnectionConfiguration(name, address, connectorName, minLargeMessageSize, clientFailureCheckPeriod, connectionTTL,
                    retryInterval, retryIntervalMultiplier, maxRetryInterval, reconnectAttempts, callTimeout,
                    duplicateDetection, forwardWhenNoConsumers, maxHops, confirmationWindowSize,
                    staticConnectors, allowDirectOnly);
        }
    }
View Full Code Here

            {
               if (closed)
                  return;
               //we use the cluster connection configuration to connect to the cluster to find the live node we want to
               //connect to.
               ClusterConnectionConfiguration config =
                        ConfigurationUtils.getReplicationClusterConfiguration(configuration);
               if (serverLocator0 != null)
               {
                  serverLocator0.close();
               }
View Full Code Here

            nodeId0 = null;
         }

         ServerLocatorInternal locator;

         ClusterConnectionConfiguration config = ConfigurationUtils.getReplicationClusterConfiguration(configuration);

         locator = getFailbackLocator(config);

         ClientSessionFactoryInternal factory = null;
View Full Code Here

            {
               if (closed)
                  return;
               //we use the cluster connection configuration to connect to the cluster to find the live node we want to
               //connect to.
               ClusterConnectionConfiguration config =
                        ConfigurationUtils.getReplicationClusterConfiguration(configuration);
               if (serverLocator0 != null)
               {
                  serverLocator0.close();
               }
View Full Code Here

            nodeId0 = null;
         }

         ServerLocatorInternal locator;

         ClusterConnectionConfiguration config = ConfigurationUtils.getReplicationClusterConfiguration(configuration);

         locator = getFailbackLocator(config);

         ClientSessionFactoryInternal factory = null;
View Full Code Here

   public
            void
            announceReplicatingBackupToLive(final Channel liveChannel, final boolean attemptingFailBack)
                                                                                                        throws HornetQException
   {
      ClusterConnectionConfiguration config = ConfigurationUtils.getReplicationClusterConfiguration(configuration);
      if (config == null)
      {
         HornetQServerLogger.LOGGER.announceBackupNoClusterConnections();
         throw new HornetQException("lacking cluster connection");

      }
      TransportConfiguration connector = configuration.getConnectorConfigurations().get(config.getConnectorName());

      if (connector == null)
      {
         HornetQServerLogger.LOGGER.announceBackupNoConnector(config.getConnectorName());
         throw new HornetQException("lacking cluster connection");
      }
      liveChannel.send(new BackupRegistrationMessage(connector, configuration.getClusterUser(),
                                                     configuration.getClusterPassword(), attemptingFailBack));
   }
View Full Code Here

        final int reconnectAttempts = CLUSTER_CONNECTION_RECONNECT_ATTEMPTS.resolveModelAttribute(context, model).asInt();
        final long maxRetryInterval = CLUSTER_CONNECTION_MAX_RETRY_INTERVAL.resolveModelAttribute(context, model).asLong();
        final double retryIntervalMultiplier = CLUSTER_CONNECTION_RETRY_INTERVAL_MULTIPLIER.resolveModelAttribute(context, model).asDouble();

        if (discoveryGroupName != null) {
            return new ClusterConnectionConfiguration(name, address, connectorName, minLargeMessageSize, clientFailureCheckPeriod, connectionTTL,
                    retryInterval, retryIntervalMultiplier, maxRetryInterval, reconnectAttempts, callTimeout,
                    duplicateDetection, forwardWhenNoConsumers, maxHops, confirmationWindowSize,
                    discoveryGroupName);
        } else {
            return new ClusterConnectionConfiguration(name, address, connectorName, minLargeMessageSize, clientFailureCheckPeriod, connectionTTL,
                    retryInterval, retryIntervalMultiplier, maxRetryInterval, reconnectAttempts, callTimeout,
                    duplicateDetection, forwardWhenNoConsumers, maxHops, confirmationWindowSize,
                    staticConnectors, allowDirectOnly);
        }
    }
View Full Code Here

         serverFrom.getConfiguration().getConnectorConfigurations().put(serverTotc.getName(), serverTotc);
         pairs = new ArrayList<String>();
         pairs.add(serverTotc.getName());
      }

      ClusterConnectionConfiguration clusterConf = new ClusterConnectionConfiguration(name,
                                                                                      address,
                                                                                      name,
                                                                                      100,
                                                                                      true,
                                                                                      forwardWhenNoConsumers,
View Full Code Here

TOP

Related Classes of org.hornetq.core.config.ClusterConnectionConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.