Package javax.jms

Examples of javax.jms.TextMessage.clearBody()


                try {
                    TextMessage textMsg = (TextMessage)msg;
                    String payload = "REPLY: " + textMsg.getText();
                    Destination replyTo;
                    replyTo = msg.getJMSReplyTo();
                    textMsg.clearBody();
                    textMsg.setText(payload);
                    remoteProducer.send(replyTo, textMsg);
                } catch (JMSException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
View Full Code Here


        tm = (TextMessage) consumer1.receive(10000L);
        assertNotNull(tm);
        session1.commit();
        msgText = tm.getText();
        assertNull(msgText);
        tm.clearBody();
        tm.setText("Now we are not null");
        publisher.publish(tm);
        session1.commit();
        tm = (TextMessage) consumer1.receive(2000);
        assertNotNull(tm);
View Full Code Here

   {
      try
      {
         TextMessage message = senderSession.createTextMessage();
         message.setStringProperty("prop", "foo");
         message.clearBody();
         Assert.assertEquals("sec. 3.11.1 Clearing a message's body does not clear its property entries.\n",
                             "foo",
                             message.getStringProperty("prop"));
      }
      catch (JMSException e)
View Full Code Here

   {
      try
      {
         TextMessage message = senderSession.createTextMessage();
         message.setText("bar");
         message.clearBody();
         Assert.assertEquals("sec. 3 .11.1 the clearBody method of Message resets the value of the message body " + "to the 'empty' initial message value as set by the message type's create "
                                      + "method provided by Session.\n",
                             null,
                             message.getText());
      }
View Full Code Here

      }
      catch (MessageNotWriteableException e)
      {
      }

      m2.clearBody();
      ProxyAssertSupport.assertNull(m2.getText());
      m2.setText("Now it is read-write");
   }

   // Package protected ---------------------------------------------
View Full Code Here

   {
      try
      {
         TextMessage message = senderSession.createTextMessage();
         message.setStringProperty("prop", "foo");
         message.clearBody();
         Assert.assertEquals("sec. 3.11.1 Clearing a message's body does not clear its property entries.\n",
                             "foo",
                             message.getStringProperty("prop"));
      }
      catch (JMSException e)
View Full Code Here

   {
      try
      {
         TextMessage message = senderSession.createTextMessage();
         message.setText("bar");
         message.clearBody();
         Assert.assertEquals("sec. 3 .11.1 the clearBody method of Message resets the value of the message body " + "to the 'empty' initial message value as set by the message type's create "
                                      + "method provided by Session.\n",
                             null,
                             message.getText());
      }
View Full Code Here

   {
      try
      {
         TextMessage message = senderSession.createTextMessage();
         message.setStringProperty("prop", "foo");
         message.clearBody();
         Assert.assertEquals("sec. 3.11.1 Clearing a message's body does not clear its property entries.\n",
                             "foo",
                             message.getStringProperty("prop"));
      }
      catch (JMSException e)
View Full Code Here

   {
      try
      {
         TextMessage message = senderSession.createTextMessage();
         message.setText("bar");
         message.clearBody();
         Assert.assertEquals("sec. 3 .11.1 the clearBody method of Message resets the value of the message body " + "to the 'empty' initial message value as set by the message type's create "
                                      + "method provided by Session.\n",
                             null,
                             message.getText());
      }
View Full Code Here

         log.trace("Sent text messages");
  
         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            TextMessage m = (TextMessage)consumer.receive(2000);
            m.clearBody();
         }
  
         consumerSess.recover();
  
         log.trace("Session recover called");
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.