Package org.apache.activemq

Examples of org.apache.activemq.ActiveMQConnection.start()


    @Test
    public void testBytesMessageSetPropertyBeforeCopy() throws Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
        ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection();
        connection.start();
        doTestBytesMessageSetPropertyBeforeCopy(connection);
    }

    @Test
    public void testBytesMessageSetPropertyBeforeCopyCompressed() throws Exception {
View Full Code Here


    @Test
    public void testBytesMessageSetPropertyBeforeCopyCompressed() throws Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
        connectionFactory.setUseCompression(true);
        ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection();
        connection.start();
        doTestBytesMessageSetPropertyBeforeCopy(connection);
    }

    public void doTestBytesMessageSetPropertyBeforeCopy(Connection connection) throws Exception {
View Full Code Here

    @Test
    public void testStreamMessageSetPropertyBeforeCopy() throws Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
        ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection();
        connection.start();
        doTestStreamMessageSetPropertyBeforeCopy(connection);
    }

    @Test
    public void testStreamMessageSetPropertyBeforeCopyCompressed() throws Exception {
View Full Code Here

    @Test
    public void testStreamMessageSetPropertyBeforeCopyCompressed() throws Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
        connectionFactory.setUseCompression(true);
        ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection();
        connection.start();
        doTestStreamMessageSetPropertyBeforeCopy(connection);
    }

    public void doTestStreamMessageSetPropertyBeforeCopy(Connection connection) throws Exception {
View Full Code Here

    }

    private void consumeMessages(long count) throws Exception {
        ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection();
        connection.setWatchTopicAdvisories(false);
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageConsumer consumer = session.createConsumer(destination);
        for (int i=0; i<count; i++) {
            assertNotNull("got message "+ i, consumer.receive(10000));
        }
View Full Code Here

    final double sampleRate = 100000;
    private void publishMessages(AtomicLong count, int expiry) throws Exception {
        ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection();
        connection.setWatchTopicAdvisories(false);
        connection.start();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        MessageProducer producer = session.createProducer(destination);
        Long start = System.currentTimeMillis();
        long i = 0l;
View Full Code Here

        final MQTTClientProvider provider = getMQTTClientProvider();
        initializeConnection(provider);
        final String DESTINATION_NAME = "foo.*";

        ActiveMQConnection activeMQConnection = (ActiveMQConnection) new ActiveMQConnectionFactory(openwireTransport.getConnectUri()).createConnection();
        activeMQConnection.start();
        Session s = activeMQConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        javax.jms.Topic jmsTopic = s.createTopic(DESTINATION_NAME);
        MessageConsumer consumer = s.createConsumer(jmsTopic);

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

        brokerService.start();
        final MQTTClientProvider provider = getMQTTClientProvider();
        initializeConnection(provider);

        ActiveMQConnection activeMQConnection = (ActiveMQConnection) new ActiveMQConnectionFactory(openwireTransport.getConnectUri()).createConnection();
        activeMQConnection.start();
        Session s = activeMQConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        javax.jms.Topic jmsTopic = s.createTopic("foo.far");
        MessageProducer producer = s.createProducer(jmsTopic);

        provider.subscribe("foo/+",AT_MOST_ONCE);
View Full Code Here


        ConnectionFactory factory = getConnectionFactory("sender");
        ActiveMQConnection conn = (ActiveMQConnection) factory.createConnection("system", "manager");
        conn.setWatchTopicAdvisories(false);
        conn.start();
        Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

        ConnectionFactory replyFactory = getConnectionFactory("receiver");
        for (int i = 0; i < 2000; i++) {
            TemporaryQueue tempDest = session.createTemporaryQueue();
View Full Code Here

            ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) session.createConsumer(tempDest);
            producer.send(message);

            ActiveMQConnection replyConnection = (ActiveMQConnection) replyFactory.createConnection("system", "manager");
            replyConnection.setWatchTopicAdvisories(false);
            replyConnection.start();
            Session replySession = replyConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            ActiveMQMessageConsumer replyConsumer = (ActiveMQMessageConsumer) replySession.createConsumer(requestReplyDest);
            javax.jms.Message msg = replyConsumer.receive(10000);
            assertNotNull("request message not null: " + i, msg);
            MessageProducer replyProducer = replySession.createProducer(msg.getJMSReplyTo());
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.