Package org.hornetq.core.server.cluster

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


      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


            message.acknowledge();
         }

         Assert.assertNull(consumer1.receiveImmediate());

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);

         bridge.stop();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = session0.createMessage(false);

            message.putIntProperty(propKey, i);

            producer0.send(message);
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.start();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = consumer1.receive(1000);
View Full Code Here

         // Won't be received since the bridge was deactivated
         Assert.assertNull(consumer1.receiveImmediate());

         // Now start the bridge manually

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);

         bridge.start();

         // Messages should now be received

         for (int i = 0; i < numMessages; i++)
         {
View Full Code Here

         Assert.assertNull(consumer1.receiveImmediate());

         // Now stop the bridge manually

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);

         BridgeStartTest.log.info("stopping bridge manually");

         bridge.stop();

         for (int i = numMessages; i < numMessages * 2; i++)
         {
            ClientMessage message = session0.createMessage(false);

            message.putIntProperty(propKey, i);

            producer0.send(message);
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.start();

         BridgeStartTest.log.info("started bridge");

         // The previous messages will get resent, but with duplicate detection they will be rejected
         // at the target

         for (int i = numMessages; i < numMessages * 2; i++)
         {
            ClientMessage message = consumer1.receive(1000);

            Assert.assertNotNull(message);

            Assert.assertEquals(i, message.getObjectProperty(propKey));

            message.acknowledge();
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.stop();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = session0.createMessage(false);

            message.putIntProperty(propKey, i);

            producer0.send(message);
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.start();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = consumer1.receive(1000);

View Full Code Here

            message.acknowledge();
         }

         Assert.assertNull(consumer1.receiveImmediate());

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);

         bridge.stop();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = session0.createMessage(false);

            message.putIntProperty(propKey, i);

            producer0.send(message);
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.start();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = consumer1.receive(BridgeWithDiscoveryGroupStartTest.TIMEOUT);
View Full Code Here

                                final Queue queue,
                                final boolean start) throws Exception
   {
      MessageFlowRecordImpl record = new MessageFlowRecordImpl(queue);

      Bridge bridge = new ClusterConnectionBridge(serverLocator,
                                                  nodeUUID,
                                                  nodeID,
                                                  queueName,
                                                  queue,
                                                  executorFactory.getExecutor(),
                                                  null,
                                                  null,
                                                  scheduledExecutor,
                                                  null,
                                                  useDuplicateDetection,
                                                  clusterUser,
                                                  clusterPassword,
                                                  !backup,
                                                  server.getStorageManager(),
                                                  managementService.getManagementAddress(),
                                                  managementService.getManagementNotificationAddress(),
                                                  record,
                                                  connector);

      record.setBridge(bridge);

      records.put(nodeID, record);

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

   {
      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

            message.acknowledge();
         }

         Assert.assertNull(consumer1.receiveImmediate());

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);

         bridge.stop();

         bridge.flushExecutor();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = session0.createMessage(false);

            message.putIntProperty(propKey, i);

            producer0.send(message);
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.start();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = consumer1.receive(1000);
View Full Code Here

         // Won't be received since the bridge was deactivated
         Assert.assertNull(consumer1.receiveImmediate());

         // Now start the bridge manually

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);

         bridge.start();

         // Messages should now be received

         for (int i = 0; i < numMessages; i++)
         {
View Full Code Here

         Assert.assertNull(consumer1.receiveImmediate());

         // Now stop the bridge manually

         Bridge bridge = server0.getClusterManager().getBridges().get(bridgeName);

         BridgeStartTest.log.info("stopping bridge manually");

         bridge.stop();

         bridge.flushExecutor();

         for (int i = numMessages; i < numMessages * 2; i++)
         {
            ClientMessage message = session0.createMessage(false);

            message.putIntProperty(propKey, i);

            producer0.send(message);
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.start();

         BridgeStartTest.log.info("started bridge");

         // The previous messages will get resent, but with duplicate detection they will be rejected
         // at the target

         for (int i = numMessages; i < numMessages * 2; i++)
         {
            ClientMessage message = consumer1.receive(1000);

            Assert.assertNotNull(message);

            Assert.assertEquals(i, message.getObjectProperty(propKey));

            message.acknowledge();
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.stop();

         bridge.flushExecutor();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = session0.createMessage(false);

            message.putIntProperty(propKey, i);

            producer0.send(message);
         }

         Assert.assertNull(consumer1.receiveImmediate());

         bridge.start();

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = consumer1.receive(1000);

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.