Package org.hornetq.spi.core.protocol

Examples of org.hornetq.spi.core.protocol.RemotingConnection.fail()


         // Now fail the underlying connection

         RemotingConnection connection = ((ClientSessionInternal)session).getConnection();

         connection.fail(new HornetQException(HornetQException.NOT_CONNECTED));

         Assert.assertTrue(session.isClosed());

         Assert.assertTrue(prod.isClosed());
View Full Code Here


         final Connection conn1 = cf1.createConnection();

         Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
         RemotingConnection rc1 = ((ClientSessionInternal)((HornetQSession)sess1).getCoreSession()).getConnection();

         rc1.fail(new HornetQException(HornetQException.NOT_CONNECTED, "blah"));

         try
         {
            Session sess2 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
            fail("should throw exception");
View Full Code Here

         // Now fail the underlying connection

         RemotingConnection connection = ((ClientSessionInternal)((HornetQSession)session).getCoreSession()).getConnection();

         connection.fail(new HornetQException(HornetQException.NOT_CONNECTED));

         // Now try and use the producer

         try
         {
View Full Code Here

   private void failSession(final ClientSession session, final CountDownLatch latch) throws InterruptedException
   {
      RemotingConnection conn = ((ClientSessionInternal)session).getConnection();

      // Simulate failure on connection
      conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));

      // Wait to be informed of failure

      Assert.assertTrue(latch.await(5000, TimeUnit.MILLISECONDS));
   }
View Full Code Here

      {
         @Override
         public void run()
         {
            System.out.println("failing...");
            forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));
            System.out.println("reconnected!!!");
         }
      };
      t.start();
     
View Full Code Here

      session.addFailureListener(new MyListener());

      RemotingConnection conn = ((ClientSessionInternal)session).getConnection();

      // Simulate failure on connection
      conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));

      // Wait to be informed of failure

      boolean ok = latch.await(1000, TimeUnit.MILLISECONDS);
View Full Code Here

         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));

         forwardingConnection = getForwardingConnection(bridge);
         forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));

         final int numMessages = NUM_MESSAGES;
View Full Code Here

         InVMConnector.failOnCreateConnection = true;
         InVMConnector.numberOfFailures = reconnectAttempts - 1;
         forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));

         forwardingConnection = getForwardingConnection(bridge);
         forwardingConnection.fail(new HornetQException(HornetQException.NOT_CONNECTED));

         final int numMessages = NUM_MESSAGES;

         SimpleString propKey = new SimpleString("propkey");
View Full Code Here

         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));
        
         final int numMessages = NUM_MESSAGES;

         SimpleString propKey = new SimpleString("propkey");
View Full Code Here

         // Fail again - should reconnect
         forwardingConnection = ((BridgeImpl)bridge).getForwardingConnection();
         InVMConnector.failOnCreateConnection = true;
         InVMConnector.numberOfFailures = reconnectAttempts - 1;
         forwardingConnection.fail(new HornetQException(5));

         for (int i = 0; i < numMessages; i++)
         {
            ClientMessage message = session0.createMessage(false);
            message.putIntProperty(propKey, i);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.