Package org.apache.activemq.broker

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


            connection.send(ack);
           
           
        }
       
        connection.request(closeConnectionInfo(connectionInfo));
    }
}
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

        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

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

        connection.request(closeConnectionInfo(connectionInfo));
    }

    @Override
    protected PolicyEntry getDefaultPolicy() {
        PolicyEntry policy = super.getDefaultPolicy();
View Full Code Here

        assertEquals(expected.get(0), m.getMessageId().toString());
        MessageAck ack = createAck(consumerInfo, m, 1, MessageAck.STANDARD_ACK_TYPE);
        connection.send(ack);

        assertNoMessagesLeft(connection);
        connection.request(closeConnectionInfo(connectionInfo));
    }

    private void sendSomeMessagesThatWillExpireIn5AndThenOne() throws Exception {

        // Setup the producer and send the message.
View Full Code Here

        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 fanout publisher.
        LOG.info("Starting the fanout connection.");
        StubConnection connection3 = createFanoutConnection();
        ConnectionInfo connectionInfo3 = createConnectionInfo();
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));

        assertNotNull(receiveMessage(connection1));
        assertNoMessagesLeft(connection1);

        assertNotNull(receiveMessage(connection2));
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.