Package javax.jms

Examples of javax.jms.Session.createTopic()


        Session noLocalSession = noLocalConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic noLocalTopic = noLocalSession.createTopic(getTestQueueName());

        Session consumerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic topic = consumerSession.createTopic(getTestQueueName());

        TopicSubscriber noLocalSubscriber =  null;
        TopicSubscriber subscriber =  null;
        try
        {
View Full Code Here


            fail("This test requires a broker with a persistent store");
        }

        Connection connection = getConnection();
        Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
        Topic topic = session.createTopic(MY_TOPIC_SUBSCRIPTION_NAME);

        TopicSubscriber noLocalSubscriber = session.
                createDurableSubscriber(topic, MY_TOPIC_SUBSCRIPTION_NAME + "-NoLocal",
                                        null, true);
View Full Code Here

        Connection connection2 = getConnection();
        connection2.start();

        Session session2 = connection2.createSession(true, Session.SESSION_TRANSACTED);
        Topic topic2 = session2.createTopic(MY_TOPIC_SUBSCRIPTION_NAME);

        TopicSubscriber noLocalSubscriber2 = session2.
                createDurableSubscriber(topic2, MY_TOPIC_SUBSCRIPTION_NAME + "-NoLocal",
                                        null, true);
View Full Code Here

            fail("This test requires a broker with a persistent store");
        }

        Connection connection = getConnection();
        Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
        Topic topic = session.createTopic(MY_TOPIC_SUBSCRIPTION_NAME);

        TopicSubscriber noLocalSubscriber =
                session.createDurableSubscriber(topic, MY_TOPIC_SUBSCRIPTION_NAME + "-NoLocal", null, true);

View Full Code Here

        Connection connection2 = getConnection();
        connection2.start();

        Session session2 = connection2.createSession(true, Session.SESSION_TRANSACTED);
        Topic topic2 = session2.createTopic(MY_TOPIC_SUBSCRIPTION_NAME);

        TopicSubscriber noLocalSubscriber2 =
                session2.createDurableSubscriber(topic2, MY_TOPIC_SUBSCRIPTION_NAME + "-NoLocal",null, true);

        // The NO-local subscriber should receive messages sent from connection3
View Full Code Here

      if (HornetQRASession.trace)
      {
         HornetQRASession.log.trace("createTopic " + session + " topicName=" + topicName);
      }

      Topic result = session.createTopic(topicName);

      if (HornetQRASession.trace)
      {
         HornetQRASession.log.trace("createdTopic " + session + " topic=" + result);
      }
View Full Code Here

   {
      Connection conn = getConnectionFactory().createConnection();
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      try
      {
         sess.createTopic("TopicThatDoesNotExist");
         ProxyAssertSupport.fail("should throw JMSException");
      }
      catch (JMSException e)
      {
         // OK
View Full Code Here

   {
      Connection conn = getConnectionFactory().createConnection();
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      try
      {
         sess.createTopic("TestQueue");
         ProxyAssertSupport.fail("should throw JMSException");
      }
      catch (JMSException e)
      {
         // OK
View Full Code Here

   public void testCreateTopic() throws Exception
   {
      Connection conn = getConnectionFactory().createConnection();
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      Topic topic = sess.createTopic("Topic1");

      MessageProducer producer = sess.createProducer(topic);
      producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

      MessageConsumer consumer = sess.createConsumer(topic);
View Full Code Here

        }
    }

    public void startConsumerMonitor() throws JMSException {
        Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic broadcastTopic = broadcastSession.createTopic(getBroadcastDestinationName());
        Topic advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic((ActiveMQDestination) broadcastTopic);
        monitorMessageConsumer = broadcastSession.createConsumer(advisoryTopic);
        monitorMessageConsumer.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                onConsumerMonitorMessage(message);
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.