Package javax.jms

Examples of javax.jms.Connection.stop()


        LOG.info("Current Durable Topic Subscriptions: " + brokerView.getDurableTopicSubscribers().length);

        assertEquals(1, brokerView.getDurableTopicSubscribers().length);

        activeConsumer.close();
        consumerConnection.stop();

        assertTrue("The subscription should be in the inactive state.", Wait.waitFor(new Wait.Condition() {

            @Override
            public boolean isSatisified() throws Exception {
View Full Code Here


            producer.send(message);
        }

        producer.close();
        session.close();
        connection.stop();
        connection.close();

        final CountDownLatch countDownLatch = new CountDownLatch(MESSAGE_COUNT);

        final ValueHolder<Boolean> messageRedelivered = new ValueHolder<Boolean>(false);
View Full Code Here

        // Commit, which ensures message is in queue and memory usage updated.
        // NOTE: This assertion fails due to bug.
        session.commit();
        Assert.assertEquals(0, physicalDestination.getMemoryUsage().getUsage());

        conn.stop();
    }

    /**
     * Create an embedded broker that has both TCP and VM connectors.
     */
 
View Full Code Here

    public void testNoExceptionOnClosewithStartStop() throws JMSException {
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(
                "vm://localhost?broker.persistent=false");
        Connection connection = connectionFactory.createConnection();
        connection.start();
        connection.stop();
        connection.close();
    }

    public void testNoExceptionOnClose() throws JMSException {
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(
View Full Code Here

        boolean halfwayPointReached = consumerReadToHalfwayLatch.await(5000, TimeUnit.MILLISECONDS);
        assertTrue("Did not read half of messages within time allowed", halfwayPointReached);

        _managedSourceQueue.moveMessages(fromMessageId, toMessageId, _destinationQueueName);

        asyncConnection.stop();

        // The exact number of messages moved will be non deterministic, as the number of messages processed
        // by the consumer cannot be predicted.  There is also the possibility that a message can remain
        // on the source queue.  This situation will arise if a message has been acquired by the consumer, but not
        // yet delivered to the client application (i.e. MessageListener#onMessage()) when the Connection#stop() occurs.
View Full Code Here

        catch (Exception e)
        {
            _logger.error("Receive error",e);
        }

        conn.stop();
       
        // Send 1 matching message and 1 non-matching message
        MessageProducer producer = session.createProducer(topic);
        TextMessage msg = session.createTextMessage("testResubscribeWithChangedSelectorAndRestart1");
        msg.setBooleanProperty("Match", true);
View Full Code Here

        catch (Exception e)
        {
            _logger.error("Receive error",e);
        }

        conn.stop();
       
        // Send 1 matching message and 1 non-matching message
        MessageProducer producer = session.createProducer(topic);
        TextMessage msg = session.createTextMessage("testResubscribeWithChangedSelectorAndRestart1");
        msg.setBooleanProperty("testprop", true);
View Full Code Here

            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            postOneWayBook(session, replyToDestination, book);
            session.close();
        } finally {
            try {
                connection.stop();
                connection.close();
            } catch (JMSException ex) {
                // ignore
            }
        }   
View Full Code Here

            postGetMessage(session, destination, replyToDestination);
            checkBookInResponse(session, replyToDestination, 123L, "CXF JMS Rocks");
            session.close();
        } finally {
            try {
                connection.stop();
                connection.close();
            } catch (JMSException ex) {
                // ignore
            }
        }
View Full Code Here

            postBook(session, destination, replyToDestination);
            checkBookInResponse(session, replyToDestination, 124L, "JMS");
            session.close();
        } finally {
            try {
                connection.stop();
                connection.close();
            } catch (JMSException ex) {
                // ignore
            }
        }
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.