Package org.hornetq.core.server.cluster

Examples of org.hornetq.core.server.cluster.Bridge


   {
      String out = name + " connected to\n";
      for (Entry<String, MessageFlowRecord> messageFlow : records.entrySet())
      {
         String nodeID = messageFlow.getKey();
         Bridge bridge = messageFlow.getValue().getBridge();
        
         out += "\t" + nodeID + " -- " + bridge.isStarted() + "\n";
      }
     
      return out;
   }
View Full Code Here


      serverLocator.setRetryInterval(config.getRetryInterval());
      serverLocator.setRetryIntervalMultiplier(config.getRetryIntervalMultiplier());
      serverLocator.setClientFailureCheckPeriod(config.getClientFailureCheckPeriod());
      serverLocator.setInitialConnectAttempts(config.getReconnectAttempts());
      clusterLocators.add(serverLocator);
      Bridge bridge = new BridgeImpl(serverLocator,
                                     nodeUUID,
                                     new SimpleString(config.getName()),
                                     queue,
                                     executorFactory.getExecutor(),
                                     SimpleString.toSimpleString(config.getFilterString()),
                                     SimpleString.toSimpleString(config.getForwardingAddress()),
                                     scheduledExecutor,
                                     transformer,
                                     config.isUseDuplicateDetection(),
                                     config.getUser(),
                                     config.getPassword(),
                                     !backup,
                                     server.getStorageManager());

      bridges.put(config.getName(), bridge);

      managementService.registerBridge(bridge, config);

      if (!backup)
      {
         bridge.start();
      }
   }
View Full Code Here

      }
   }

   public synchronized void destroyBridge(final String name) throws Exception
   {
      Bridge bridge = bridges.remove(name);
      if (bridge != null)
      {
         bridge.stop();
         managementService.unregisterBridge(name);
      }
   }
View Full Code Here

         return;
      }

      Queue queue = (Queue)binding.getBindable();

      Bridge bridge = null;

      if (config.getDiscoveryGroupName() != null)
      {
         DiscoveryGroupConfiguration discoveryGroupConfiguration = configuration.getDiscoveryGroupConfigurations()
                                                                                .get(config.getDiscoveryGroupName());
         if (discoveryGroupConfiguration == null)
         {
            ClusterManagerImpl.log.warn("No discovery group configured with name '" + config.getDiscoveryGroupName() +
                                        "'. The bridge will not be deployed.");

            return;
         }

         bridge = new BridgeImpl(nodeUUID,
                                 new SimpleString(config.getName()),
                                 queue,
                                 discoveryGroupConfiguration.getGroupAddress(),
                                 discoveryGroupConfiguration.getGroupPort(),
                                 null,
                                 executorFactory.getExecutor(),
                                 SimpleString.toSimpleString(config.getFilterString()),
                                 new SimpleString(config.getForwardingAddress()),
                                 scheduledExecutor,
                                 transformer,
                                 config.getRetryInterval(),
                                 config.getRetryIntervalMultiplier(),
                                 config.getReconnectAttempts(),
                                 config.isFailoverOnServerShutdown(),
                                 config.isUseDuplicateDetection(),
                                 config.getConfirmationWindowSize(),
                                 managementService.getManagementAddress(),
                                 managementService.getManagementNotificationAddress(),
                                 config.getUser(),
                                 config.getPassword(),
                                 null,
                                 !backup,
                                 server.getStorageManager());
      }
      else
      {
         TransportConfiguration connector = configuration.getConnectorConfigurations().get(connectorNamePair.a);

         if (connector == null)
         {
            ClusterManagerImpl.log.warn("No connector defined with name '" + connectorNamePair.a +
                                        "'. The bridge will not be deployed.");

            return;
         }

         TransportConfiguration backupConnector = null;

         if (connectorNamePair.b != null)
         {
            backupConnector = configuration.getConnectorConfigurations().get(connectorNamePair.b);

            if (backupConnector == null)
            {
               ClusterManagerImpl.log.warn("No connector defined with name '" + connectorNamePair.b +
                                           "'. The bridge will not be deployed.");

               return;
            }
         }

         Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(connector,
                                                                                                                              backupConnector);
         bridge = new BridgeImpl(nodeUUID,
                                 new SimpleString(config.getName()),
                                 queue,
                                 null,
                                 -1,
                                 pair,
                                 executorFactory.getExecutor(),
                                 SimpleString.toSimpleString(config.getFilterString()),
                                 SimpleString.toSimpleString(config.getForwardingAddress()),
                                 scheduledExecutor,
                                 transformer,
                                 config.getRetryInterval(),
                                 config.getRetryIntervalMultiplier(),
                                 config.getReconnectAttempts(),
                                 config.isFailoverOnServerShutdown(),
                                 config.isUseDuplicateDetection(),
                                 config.getConfirmationWindowSize(),
                                 managementService.getManagementAddress(),
                                 managementService.getManagementNotificationAddress(),
                                 server.getConfiguration().getClusterUser(),
                                 server.getConfiguration().getClusterPassword(),
                                 null,
                                 !backup,
                                 server.getStorageManager());
      }

      bridges.put(config.getName(), bridge);

      managementService.registerBridge(bridge, config);

      bridge.start();
   }
View Full Code Here

      bridge.start();
   }

   public synchronized void destroyBridge(final String name) throws Exception
   {
      Bridge bridge = bridges.remove(name);
      if (bridge != null)
      {
         bridge.stop();
         managementService.unregisterBridge(name);
      }
   }
View Full Code Here

      ClientConsumer cons1 = session1.createConsumer(queueName0);

      session1.start();

      // Now we will simulate a failure of the bridge connection between server0 and server1
      Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
      final RemotingConnection forwardingConnection = getForwardingConnection(bridge);
      InVMConnector.failOnCreateConnection = true;
      InVMConnector.numberOfFailures = Integer.MAX_VALUE;
     
      Thread t = new Thread()
View Full Code Here

         ClientConsumer cons1 = session1.createConsumer(queueName0);

         session1.start();

         // Now we will simulate a failure of the bridge connection between server0 and server1
         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
         assertNotNull(bridge);
         RemotingConnection forwardingConnection = getForwardingConnection(bridge);
         InVMConnector.failOnCreateConnection = true;
         InVMConnector.numberOfFailures = reconnectAttempts - 1;
         forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
View Full Code Here

         ClientConsumer cons1 = session1.createConsumer(queueName0);

         session1.start();

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
         RemotingConnection forwardingConnection = getForwardingConnection(bridge);
         InVMConnector.failOnCreateConnection = true;
         InVMConnector.numberOfFailures = reconnectAttempts - 1;
         forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
        
View Full Code Here

         ClientConsumer cons1 = session1.createConsumer(queueName0);

         session1.start();

         // Now we will simulate a failure of the bridge connection between server0 and server1
         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
         RemotingConnection forwardingConnection = getForwardingConnection(bridge);
         InVMConnector.failOnCreateConnection = true;
         InVMConnector.numberOfFailures = reconnectAttempts - 1;
         forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
View Full Code Here

         ClientConsumer cons1 = session1.createConsumer(queueName0);

         session1.start();

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);
         RemotingConnection forwardingConnection = getForwardingConnection(bridge);
         InVMConnector.failOnCreateConnection = true;
         InVMConnector.numberOfFailures = reconnectAttempts - 1;
         forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
View Full Code Here

TOP

Related Classes of org.hornetq.core.server.cluster.Bridge

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.