Unfortunately this is a common mistake - in that your setting the delivery mode on the message - it needs to be set on the producer!

On 6 Oct 2006, at 10:11, Pico Florin wrote:

Hi!
I want to know how you can set up the delivery mode for a message that shoul be sent. I have made something like this:

  T extMessage replyMessage = session.createTextMessage();
     replyMessage.setText(contents);
    replyMessage.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
              replyMessage.setJMSCorrelationID(requestMessage
                  .getJMSMessageID());

                replyProducer.send(replyMessage);
  System.out.println("\tDeliveryMode:   "
                            + replyMessage.getJMSDeliveryMode());


but the latest code still print 2, meanig DeliveryMode.PERSISTENT. Also on the client that receives the message the same mode is received. I want the same thing for the client that the messages that shoul be delivered to the server( I have a P2P architecture) to have the same delivery mode. I have made something like this:
   requestMessage.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
          requestProducer.send(requestMessage);
  but when I'm printing out the PERSISTENT mode is printed.

  Thank you,
    Florin




                
---------------------------------
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine

Reply via email to