Package org.apache.activemq.broker

Examples of org.apache.activemq.broker.StubConnection.request()


        ConnectionInfo connectionInfo1 = createConnectionInfo();
        SessionInfo sessionInfo1 = createSessionInfo(connectionInfo1);
        ConsumerInfo consumerInfo1 = createConsumerInfo(sessionInfo1, destination);
        connection1.send(connectionInfo1);
        connection1.send(sessionInfo1);
        connection1.request(consumerInfo1);

        // Start a normal consumer on a remote broker
        StubConnection connection2 = createRemoteConnection();
        ConnectionInfo connectionInfo2 = createConnectionInfo();
        SessionInfo sessionInfo2 = createSessionInfo(connectionInfo2);
View Full Code Here


        ConnectionInfo connectionInfo2 = createConnectionInfo();
        SessionInfo sessionInfo2 = createSessionInfo(connectionInfo2);
        ConsumerInfo consumerInfo2 = createConsumerInfo(sessionInfo2, destination);
        connection2.send(connectionInfo2);
        connection2.send(sessionInfo2);
        connection2.request(consumerInfo2);

        // Start a failover publisher.
        StubConnection connection3 = createFailoverConnection();
        ConnectionInfo connectionInfo3 = createConnectionInfo();
        SessionInfo sessionInfo3 = createSessionInfo(connectionInfo3);
View Full Code Here

        connection3.send(connectionInfo3);
        connection3.send(sessionInfo3);
        connection3.send(producerInfo3);

        // Send the message using the fail over publisher.
        connection3.request(createMessage(producerInfo3, destination, deliveryMode));

        // The message will be sent to one of the brokers.
        FailoverTransport ft = (FailoverTransport)connection3.getTransport().narrow(FailoverTransport.class);

        // See which broker we were connected to.
View Full Code Here

            Message message = createMessage(producerInfo, destination);
            message.setPersistent(true);
            connection.send(message);
            expected.add(message.getMessageId().toString());
        }
        connection.request(closeConnectionInfo(connectionInfo));

        // restart the broker.
        restartBroker();

        // Setup the consumer and receive the message.
View Full Code Here

            assertEquals(expected.remove(0), m.getMessageId().toString());
            MessageAck ack = createAck(consumerInfo, m, 1, MessageAck.STANDARD_ACK_TYPE);
            connection.send(ack);
        }
       
        connection.request(closeConnectionInfo(connectionInfo));
       
        // restart the broker.
        restartBroker();

        // Setup the consumer and receive the message.
View Full Code Here

            connection.send(ack);
           
           
        }
       
        connection.request(closeConnectionInfo(connectionInfo));
    }
}
View Full Code Here

        ActiveMQDestination destinationInfo1 = null;
       
        // Send a 10 messages to the local broker
        for (int i = 0; i < sendNumMessages; ++i) {
            destinationInfo1 = createDestinationInfo(connection1, connectionInfo1, ActiveMQDestination.QUEUE_TYPE);
            connection1.request(createMessage(producerInfo, destinationInfo1, DeliveryMode.NON_PERSISTENT));
        }
       
        // Ensure that there are 10 messages on the local broker
        Object[] messages = browseQueueWithJmx(localBroker);
        assertEquals(sendNumMessages, messages.length);
View Full Code Here

        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        assertEquals(((ConsumerInfo)m1.getDataStructure()).getConsumerId(), consumerInfo2.getConsumerId());

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

        // We should get an advisory of the consumer closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
View Full Code Here

        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        assertEquals(((ConsumerInfo)m1.getDataStructure()).getConsumerId(), consumerInfo2.getConsumerId());

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

        // We should get an advisory of the consumer closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
View Full Code Here

        assertNotNull(m1);
        assertNotNull(m1.getDataStructure());
        assertEquals(((ProducerInfo)m1.getDataStructure()).getProducerId(), producerInfo2.getProducerId());

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

        // We should get an advisory of the producer closing
        m1 = receiveMessage(connection1);
        assertNotNull(m1);
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.