ISSUE-68: Broken JMS header properties example code

Bad JMS example

Broken JMS header properties example code

SOAP-JMS Binding specification
Raised by:
Eric Johnson
Opened on:
From email:

I was looking at the latest SOAP over JMS specification draft and in particular the description of setting JMS header (or QoS) properties, with example code:

The example code given in section "Setting JMS Message Header properties" will not work as described. These properties on a message can only be set by a JMS provider, and are basically read-only as far as clients are concerned. To send a message using non-default QoS values you need to use the four-argument send method, as shown in the final (commented out) line of the example. A corrected example would therefore use a method looking something like this:

// add appropriate error checking for your use....
public void someMethod(Context ctx, MessageProducer producer, Message jmsMessage,
String deliveryModeStr, String replyToName, int priority, long timeToLive) {

// set the delivery mode to the appropriate constant value.
int deliveryMode = deliveryModeStr.equals("PERSISTENT")
? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;

// Set the reply destination, first looking it up using JNDI
Destination replyDestination = ctx.lookup(replyToName);

// and finally, send the message.
producer.send(jmsMessage, deliveryMode, priority, timeToLive);

Note the API for the Message class where these methods are documented as being solely for JMS providers:
Related Actions Items:
No related actions
Related emails:
  1. Agenda for 2010-12-21 conference call (from on 2010-12-20)
  2. Agenda for 2010-12-14 conference call (from on 2010-12-20)
  3. Re: ACTION-234 complete (from on 2010-12-18)
  4. ACTION-234 complete (from on 2010-12-14)
  5. RE: Agenda for 2010-12-14 conference call (from on 2010-12-13)
  6. Agenda for 2010-12-14 conference call (from on 2010-12-13)
  7. Minutes 2010-12-07 (from on 2010-12-07)
  8. Completion of ACTION-231: Come up with a concrete proposal to resolve issue 68 (from on 2010-12-07)
  9. Agenda for the 2010-12-07 conference call (from on 2010-12-06)
  10. Agenda for the 2010-11-30 conference call (from on 2010-11-29)
  11. Re: JMS header properties example code (from on 2010-11-23)
  12. ISSUE-68 (Bad JMS example): Broken JMS header properties example code [SOAP-JMS Binding specification] (from on 2010-11-23)

Related notes:

Opened as per:

Eric Johnson, 6 Dec 2010, 20:18:40

Resolved as per:

Eric Johnson, 13 Dec 2010, 23:17:47

Accepted application of resolution as per:

Eric Johnson, 3 Jan 2011, 22:35:14

Display change log ATOM feed

Chair, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <>.
$Id: 68.html,v 1.1 2013-09-16 14:06:37 carine Exp $