Package javax.jms

Examples of javax.jms.TopicSession.createSubscriber()


               {
                  final TopicSession topicSession = (TopicSession) session;

                  if (dConfig.getSelector() == null)
                  {
                     consumer = topicSession.createSubscriber(topic);
                  }
                  else
                  {
                     consumer = topicSession.createSubscriber(topic, dConfig.getSelector(), false);
                  }
View Full Code Here


                  {
                     consumer = topicSession.createSubscriber(topic);
                  }
                  else
                  {
                     consumer = topicSession.createSubscriber(topic, dConfig.getSelector(), false);
                  }
               }
               else
               {
                  throw new HermesRuntimeException("The session is JMS 1.0.2b and not in the topic domain.");
View Full Code Here

            /* start the connection */
            tc.start();
            /* Create the receivers */
            TopicSubscriber ts1 = s_rec1.createSubscriber(t, "size >= 5 OR (size < 5 AND color ='green')", false);
            TopicSubscriber ts2 = s_rec1.createSubscriber(t);
            TopicSubscriber ts3 = s_rec2.createSubscriber(t);
            /* Create a sender for sending messages */
            TopicPublisher tpub = s_send.createPublisher(t);
            /* create a message for sending */
            Message msg = s_send.createObjectMessage(new Integer(1));
            msg.setIntProperty("size", 2);
View Full Code Here

            /* start the connection */
            tc.start();
            /* Create the receivers */
            TopicSubscriber ts1 = s_rec1.createSubscriber(t);
            TopicSubscriber ts2 = s_rec1.createSubscriber(t);
            TopicSubscriber ts3 = s_rec2.createSubscriber(t);
            /* Create a sender for sending messages */
            TopicPublisher tpub = s_send.createPublisher(t);
            tpub.setDisableMessageTimestamp(false);
            /* create a message for sending */
            Message msg = s_send.createObjectMessage(new Integer(123));
View Full Code Here

        if (durable) {
            return super.createConsumer();
        }
        else {
            TopicSession topicSession = (TopicSession)session;
            return topicSession.createSubscriber((Topic) consumerDestination, null, false);
        }
    }
}
View Full Code Here

        TopicSession topicSession =
          topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
 
        Topic topic = (Topic)ctx.lookup(topicName);
 
        TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
     
        topicSubscriber.setMessageListener(this);
        topicConnection.start();
View Full Code Here

      TopicSession topicSession = topicConnection.createTopicSession(false,
                                                       Session.AUTO_ACKNOWLEDGE);

      Topic topic = (Topic)ctx.lookup(topicBindingName);

      TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
   
      topicSubscriber.setMessageListener(this);

    } catch(Exception e) {
      logger.error("Could not read JMS message.", e);
View Full Code Here

        TopicConnection topicConnection = getTopicConnection(brokerConfiguration);
        // create session, subscriber, message listener and listen on that topic
        try {
            TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            Topic topic = session.createTopic(topicName);
            TopicSubscriber subscriber = session.createSubscriber(topic);
            MessageListener messageListener = new JMSMessageListener(brokerListener);
            subscriber.setMessageListener(messageListener);
            topicConnection.start();
        } catch (JMSException e) {
            String error = "Failed to subscribe to topic:" + topicName;
View Full Code Here

       
        QueueSession qSession = ((AMQConnection)_connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueReceiver receiver = qSession.createReceiver(queue);
       
        TopicSession tSession = ((AMQConnection)_connection).createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        TopicSubscriber sub = tSession.createSubscriber(topic);
       
        Session ssn = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer prod1 = ssn.createProducer(ssn.createQueue("ADDR:my-queue"));
        prod1.send(ssn.createTextMessage("test1"));
       
View Full Code Here

                    if (name != null) {

                        subscriber = session.createDurableSubscriber
                            (topic, name, selector, false);
                    } else {
                        subscriber = session.createSubscriber(topic, selector, false);
                    }

                    int secs = 60;
                    boolean counted = false;
                    int count = 1;
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.