Examples of createTopic()


Examples of javax.jms.Session.createTopic()

        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

Examples of javax.jms.Session.createTopic()

      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

Examples of javax.jms.Session.createTopic()

   {
      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

Examples of javax.jms.Session.createTopic()

   {
      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

Examples of javax.jms.Session.createTopic()

   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

Examples of javax.jms.Session.createTopic()

        }
    }

    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

Examples of javax.jms.Session.createTopic()

        if (started.compareAndSet(false, true)) {
            LOGGER.debug(broker.getContainer().getName() + ": Starting jms flow");
            super.start();
            try {
                Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                Topic broadcastTopic = broadcastSession.createTopic(broadcastDestinationName);
                broadcastConsumer = broadcastSession.createConsumer(broadcastTopic, null, true);
                broadcastConsumer.setMessageListener(new MessageListener() {
                    public void onMessage(Message message) {
                        try {
                            Object obj = ((ObjectMessage) message).getObject();
View Full Code Here

Examples of javax.jms.Session.createTopic()

            LOGGER.debug(broker.getContainer().getName() + ": broadcasting info for " + event);
        }
        Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        try {
            ObjectMessage msg = broadcastSession.createObjectMessage(event);
            Topic broadcastTopic = broadcastSession.createTopic(broadcastDestinationName);
            MessageProducer topicProducer = broadcastSession.createProducer(broadcastTopic);
            topicProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
            topicProducer.send(msg);
        } finally {
            broadcastSession.close();
View Full Code Here

Examples of javax.jms.Session.createTopic()

            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            if (destination == null) {
                if (STYLE_QUEUE.equals(endpoint.getDestinationStyle())) {
                    destination = session.createQueue(endpoint.getJmsProviderDestinationName());
                } else {
                    destination = session.createTopic(endpoint.getJmsProviderDestinationName());
                }
            }
            MessageProducer producer = session.createProducer(destination);

            NormalizedMessage nm = exchange.getMessage("in");
View Full Code Here

Examples of javax.jms.TopicSession.createTopic()

            TopicConnection connection = (TopicConnection) getConnection();
            connection.start();

            // Send messages which don't match and do match the selector, checking message count
            TopicSession pubSession = connection.createTopicSession(true, Session.SESSION_TRANSACTED);
            Topic topic = pubSession.createTopic(SELECTOR_TOPIC_NAME);
            TopicPublisher publisher = pubSession.createPublisher(topic);

            publishMessages(pubSession, publisher, topic, DeliveryMode.PERSISTENT, 1*1024, 1, "false");
            pubSession.commit();
            assertEquals("DurableSubscription backing queue should still have 1 message on it",
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.