Package javax.jms

Examples of javax.jms.TopicSession.createPublisher()


        try {
            tc = tcf.createTopicConnection("system", "system");
            ts = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

            int num = 1000;
            TopicPublisher tp = ts.createPublisher(topic);
            ObjectMessage om = ts.createObjectMessage(new Integer(num++));
            tp.publish(om);
            om = ts.createObjectMessage(new Integer(num++));
            tp.publish(om);
View Full Code Here


        QueueConnection qc = null;
        QueueSession qs = null;
        try {
            tc = topicConnectionFactory().createTopicConnection();
            ts = tc.createTopicSession (true, 0);
            TopicPublisher sndr = ts.createPublisher (channelOutTopic());
            sndr.setDisableMessageID (true);
            ObjectMessage msg
                = ts.createObjectMessage ((Serializable)data);
            String processKey = ((Long)ctx.getPrimaryKey()).toString();
            msg.setStringProperty ("processKey", processKey);
View Full Code Here

        QueueConnection qc = null;
        QueueSession qs = null;
        try {
            tc = topicConnectionFactory().createTopicConnection();
            ts = tc.createTopicSession (true, 0);
            TopicPublisher sndr = ts.createPublisher (channelOutTopic());
            sndr.setDisableMessageID (true);
            Message msg = ts.createMessage();
            String processKey = ((Long)ctx.getPrimaryKey()).toString();
            msg.setStringProperty ("processKey", processKey);
            msg.setStringProperty ("messageType", "CLOSE_NOTIFICATION");
View Full Code Here

              }
              System.out.println("Topic - " + topicName + " ready");


              // Creating publisher
              TopicPublisher publisher = session.createPublisher(topic);
              System.out.println("Publisher ready");


              System.out.println("Publishing Messages ...");
View Full Code Here

   public void testTopic() throws Exception
   {
      printHeader();
      TopicSession session = getTopicSession();
      Topic topic = (Topic) getInitialContext().lookup(dest);
      TopicPublisher pub = session.createPublisher(topic);

      getLog().debug("TestTopic: " + dest + ": Sending 10st messages 1-10");

      for (int i = 1; i < 11; i++)
      {
View Full Code Here

                    System.err.println("Failed to get administered object"
                        + " exiting.....");
                    System.exit(-1);
                }

                TopicPublisher publisher = session.createPublisher(topic);

                // check the number of iterations that have been specified
                // on the command line. If it has not yet been specified
                // then default to 10.
                int count = 10;
View Full Code Here

    try
    {
      TopicSession session = connection_.createTopicSession
        (false, Session.CLIENT_ACKNOWLEDGE);
      Topic topic = session.createTopic("OpenJMSDemo-deals");
      TopicPublisher publisher = session.createPublisher(topic);
      int delivery_mode = DeliveryMode.PERSISTENT;
      ObjectMessage message = session.createObjectMessage(this);
      publisher.publish(message, delivery_mode, 1, 0);
      //      session.close();
    }
View Full Code Here

    {
      TopicSession session = connection_.createTopicSession
        (false, Session.CLIENT_ACKNOWLEDGE);
            connection_.start();
      Topic topic = session.createTopic(newTopic);
      TopicPublisher publisher = session.createPublisher(topic);
      int delivery_mode = DeliveryMode.NON_PERSISTENT;
      // need to copy message else destination will change, and ack will
      // fail.
      ObjectMessage message = session.createObjectMessage(data);
      publisher.publish(message, delivery_mode, 1, 0);
View Full Code Here

               {

                  TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
                  Topic topic = (Topic)context.lookup(TEST_DURABLE_TOPIC);

                  TopicPublisher publisher = session.createPublisher(topic);

                  waitForSynchMessage();

                  BytesMessage message = session.createBytesMessage();
                  message.writeBytes(PAYLOAD);
View Full Code Here

            QueueSession qsession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            TemporaryQueue temp = qsession.createTemporaryQueue();
            message.setJMSReplyTo(temp);

            TopicPublisher publisher = session.createPublisher(topic);
            publisher.publish(message);

            QueueReceiver receiver = qsession.createReceiver(temp);
            receiver.receive();
            receiver.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.