Package javax.jms

Examples of javax.jms.Session.createTopic()


        scheduleMessage(connection, TimeUnit.SECONDS.toMillis(9), COUNT);

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create the Browse Destination and the Reply To location
        Destination requestBrowse = session.createTopic(ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION);
        Destination browseDest = session.createTemporaryQueue();

        // Create the eventual Consumer to receive the scheduled message
        MessageConsumer consumer = session.createConsumer(destination);
View Full Code Here


        scheduleMessage(connection, TimeUnit.SECONDS.toMillis(20));

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create the Browse Destination and the Reply To location
        Destination requestBrowse = session.createTopic(ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION);
        Destination browseDest = session.createTemporaryQueue();

        // Create the eventual Consumer to receive the scheduled message
        MessageConsumer consumer = session.createConsumer(destination);
View Full Code Here

        scheduleMessage(connection, TimeUnit.SECONDS.toMillis(9), COUNT);

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create the Browse Destination and the Reply To location
        Destination management = session.createTopic(ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION);
        Destination browseDest = session.createTemporaryQueue();

        // Create the eventual Consumer to receive the scheduled message
        MessageConsumer consumer = session.createConsumer(destination);
        MessageProducer producer = session.createProducer(management);
View Full Code Here

        Connection connection = createConnection();

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create the Browse Destination and the Reply To location
        Destination management = session.createTopic(ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION);

        MessageProducer producer = session.createProducer(management);

      try{
View Full Code Here

        scheduleMessage(connection, TimeUnit.SECONDS.toMillis(45));

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create the Browse Destination and the Reply To location
        Destination requestBrowse = session.createTopic(ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION);
        Destination browseDest = session.createTemporaryTopic();

        // Create the "Browser"
        MessageConsumer browser = session.createConsumer(browseDest, ScheduledMessage.AMQ_SCHEDULED_DELAY + " = 45000" );
View Full Code Here

    public void testSelectorWithJMSDeliveryMode() throws Exception
    {
        Session session = _connection.createSession(false, Session.SESSION_TRANSACTED);

        Destination dest1 = session.createTopic("test1");
        Destination dest2 = session.createTopic("test2");

        MessageProducer prod1 = session.createProducer(dest1);
        MessageProducer prod2 = session.createProducer(dest2);
        MessageConsumer consumer1 = session.createConsumer(dest1,"JMSDeliveryMode = 'PERSISTENT'");
View Full Code Here

    public void testSelectorWithJMSDeliveryMode() throws Exception
    {
        Session session = _connection.createSession(false, Session.SESSION_TRANSACTED);

        Destination dest1 = session.createTopic("test1");
        Destination dest2 = session.createTopic("test2");

        MessageProducer prod1 = session.createProducer(dest1);
        MessageProducer prod2 = session.createProducer(dest2);
        MessageConsumer consumer1 = session.createConsumer(dest1,"JMSDeliveryMode = 'PERSISTENT'");
        MessageConsumer consumer2 = session.createConsumer(dest2,"JMSDeliveryMode = 'NON_PERSISTENT'");
View Full Code Here

    {
        Session session = _connection.createSession(acknowledgeMode == Session.SESSION_TRANSACTED, acknowledgeMode);
        Destination destination = null;
        if (pubSub)
        {
            destination = session.createTopic(getTestQueueName());
        }
        else
        {
            destination = session.createQueue(getTestQueueName());
        }
View Full Code Here

        producer.send(session.createQueue(getTestQueueName()), message);

        _testExceptionListener.assertReceivedNoRouteWithReturnedMessage(message, getTestQueueName());

        // publish to non-existent topic - should get no failure
        producer = session.createProducer(session.createTopic(getTestQueueName()));
        message = session.createMessage();
        producer.send(message);

        _testExceptionListener.assertNoException();
View Full Code Here

        _testExceptionListener.assertNoException();

        producer = session.createProducer(null);
        message = session.createMessage();
        producer.send(session.createTopic(getTestQueueName()), message);

        _testExceptionListener.assertNoException();

        session.close();
    }
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.