Package org.apache.activemq.command

Examples of org.apache.activemq.command.ConnectionInfo


        ActiveMQDestination destination = new ActiveMQQueue("TEST");

        // Setup the producer and send the message.
        StubConnection connection = createConnection();
        ConnectionInfo connectionInfo = createConnectionInfo();
        SessionInfo sessionInfo = createSessionInfo(connectionInfo);
        ProducerInfo producerInfo = createProducerInfo(sessionInfo);
        connection.send(connectionInfo);
        connection.send(sessionInfo);
        connection.send(producerInfo);
View Full Code Here


        ActiveMQDestination destination = new ActiveMQQueue("TEST");

        // Setup the producer and send the message.
        StubConnection connection = createConnection();
        ConnectionInfo connectionInfo = createConnectionInfo();
        SessionInfo sessionInfo = createSessionInfo(connectionInfo);
        ProducerInfo producerInfo = createProducerInfo(sessionInfo);
        connection.send(connectionInfo);
        connection.send(sessionInfo);
        connection.send(producerInfo);
View Full Code Here

        ActiveMQDestination destination = new ActiveMQQueue("TEST");

        // Setup the producer and send the message.
        StubConnection connection = createConnection();
        ConnectionInfo connectionInfo = createConnectionInfo();
        SessionInfo sessionInfo = createSessionInfo(connectionInfo);
        ProducerInfo producerInfo = createProducerInfo(sessionInfo);
        connection.send(connectionInfo);
        connection.send(sessionInfo);
        connection.send(producerInfo);
View Full Code Here

        ActiveMQDestination destination = new ActiveMQQueue("TEST");

        // Setup the producer and send the message.
        StubConnection connection = createConnection();
        ConnectionInfo connectionInfo = createConnectionInfo();
        SessionInfo sessionInfo = createSessionInfo(connectionInfo);
        ProducerInfo producerInfo = createProducerInfo(sessionInfo);
        connection.send(connectionInfo);
        connection.send(sessionInfo);
        connection.send(producerInfo);
View Full Code Here

        int NUMBER = 100;
        ActiveMQDestination destination = new ActiveMQQueue("TEST");

        // Setup the producer and send the message.
        StubConnection connection = createConnection();
        ConnectionInfo connectionInfo = createConnectionInfo();
        SessionInfo sessionInfo = createSessionInfo(connectionInfo);
        ProducerInfo producerInfo = createProducerInfo(sessionInfo);
        connection.send(connectionInfo);
        connection.send(sessionInfo);
        connection.send(producerInfo);
View Full Code Here

       
        ActiveMQDestination destination = AdvisorySupport.getConnectionAdvisoryTopic();
       
        // Setup a first connection
        StubConnection connection1 = createConnection();
        ConnectionInfo connectionInfo1 = createConnectionInfo();
        SessionInfo sessionInfo1 = createSessionInfo(connectionInfo1);
        ConsumerInfo consumerInfo1 = createConsumerInfo(sessionInfo1, destination);
        consumerInfo1.setPrefetchSize(100);
       
        connection1.send(connectionInfo1);
        connection1.send(sessionInfo1);
        connection1.send(consumerInfo1);

        // We should get an advisory of our own connection.
        Message m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        assertEquals(((ConnectionInfo)m1.getDataStructure()).getConnectionId(), connectionInfo1.getConnectionId());

        // Setup a second connection
        StubConnection connection2 = createConnection();
        ConnectionInfo connectionInfo2 = createConnectionInfo();
        connection2.send(connectionInfo2);
       
        // We should get an advisory of the second connection.
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        assertEquals(((ConnectionInfo)m1.getDataStructure()).getConnectionId(), connectionInfo2.getConnectionId());

        // Close the second connection.
        connection2.send(closeConnectionInfo(connectionInfo2));
        connection2.stop();

        // We should get an advisory of the second connection closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        RemoveInfo r = (RemoveInfo) m1.getDataStructure();
        assertEquals(r.getObjectId(), connectionInfo2.getConnectionId());
       
        assertNoMessagesLeft(connection1);
    }
View Full Code Here

        ActiveMQDestination queue = new ActiveMQQueue("test");
        ActiveMQDestination destination = AdvisorySupport.getConsumerAdvisoryTopic(queue);
       
        // Setup a first connection
        StubConnection connection1 = createConnection();
        ConnectionInfo connectionInfo1 = createConnectionInfo();
        SessionInfo sessionInfo1 = createSessionInfo(connectionInfo1);
        ConsumerInfo consumerInfo1 = createConsumerInfo(sessionInfo1, destination);
        consumerInfo1.setPrefetchSize(100);
       
        connection1.send(connectionInfo1);
        connection1.send(sessionInfo1);
        connection1.send(consumerInfo1);

        // We should not see and advisory for the advisory consumer.
        assertNoMessagesLeft(connection1);

        // Setup a second consumer.
        StubConnection connection2 = createConnection();
        ConnectionInfo connectionInfo2 = createConnectionInfo();
        SessionInfo sessionInfo2 = createSessionInfo(connectionInfo2);
        ConsumerInfo consumerInfo2 = createConsumerInfo(sessionInfo2, queue);
        consumerInfo1.setPrefetchSize(100);
       
        connection2.send(connectionInfo2);
View Full Code Here

        ActiveMQDestination queue = new ActiveMQQueue("test");
        ActiveMQDestination destination = AdvisorySupport.getConsumerAdvisoryTopic(queue);
       
        // Setup a first connection
        StubConnection connection1 = createConnection();
        ConnectionInfo connectionInfo1 = createConnectionInfo();
        SessionInfo sessionInfo1 = createSessionInfo(connectionInfo1);
       
        connection1.send(connectionInfo1);
        connection1.send(sessionInfo1);

        // Setup a second consumer.
        StubConnection connection2 = createConnection();
        ConnectionInfo connectionInfo2 = createConnectionInfo();
        SessionInfo sessionInfo2 = createSessionInfo(connectionInfo2);
        ConsumerInfo consumerInfo2 = createConsumerInfo(sessionInfo2, queue);
        consumerInfo2.setPrefetchSize(100);       
        connection2.send(connectionInfo2);
        connection2.send(sessionInfo2);
View Full Code Here

        ActiveMQDestination queue = new ActiveMQQueue("test");
        ActiveMQDestination destination = AdvisorySupport.getProducerAdvisoryTopic(queue);
       
        // Setup a first connection
        StubConnection connection1 = createConnection();
        ConnectionInfo connectionInfo1 = createConnectionInfo();
        SessionInfo sessionInfo1 = createSessionInfo(connectionInfo1);
        ConsumerInfo consumerInfo1 = createConsumerInfo(sessionInfo1, destination);
        consumerInfo1.setPrefetchSize(100);
       
        connection1.send(connectionInfo1);
        connection1.send(sessionInfo1);
        connection1.send(consumerInfo1);

        assertNoMessagesLeft(connection1);

        // Setup a producer.
        StubConnection connection2 = createConnection();
        ConnectionInfo connectionInfo2 = createConnectionInfo();
        SessionInfo sessionInfo2 = createSessionInfo(connectionInfo2);
        ProducerInfo producerInfo2 = createProducerInfo(sessionInfo2);
        producerInfo2.setDestination(queue);
       
        connection2.send(connectionInfo2);
View Full Code Here

        ActiveMQDestination queue = new ActiveMQQueue("test");
        ActiveMQDestination destination = AdvisorySupport.getProducerAdvisoryTopic(queue);
       
        // Setup a first connection
        StubConnection connection1 = createConnection();
        ConnectionInfo connectionInfo1 = createConnectionInfo();
        SessionInfo sessionInfo1 = createSessionInfo(connectionInfo1);
       
        connection1.send(connectionInfo1);
        connection1.send(sessionInfo1);

        // Setup a producer.
        StubConnection connection2 = createConnection();
        ConnectionInfo connectionInfo2 = createConnectionInfo();
        SessionInfo sessionInfo2 = createSessionInfo(connectionInfo2);
        ProducerInfo producerInfo2 = createProducerInfo(sessionInfo2);
        producerInfo2.setDestination(queue);
       
        connection2.send(connectionInfo2);
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ConnectionInfo

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.