WebSphere WebSphere Application Server Express, Version 6.0.x Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Working with non-routing path fields in a message header

This topic describes how to work with fields in a message header that identify and affect the behavior of messages.

Why and when to perform this task

In addition to the routing fields (see Setting routing addresses in a message header), there are a number of fields in the message header that you can work with. These fields affect important qualities and characteristics of the message, like priority and reliability, identity, and so on. See Message header reference information for information about the equivalence of the header fields to JMS message header fields, and the methods available to work with them.

Steps for this task

  1. Locate the point in your mediation handler where you insert the functional mediation code, in the method handle (MessageContext context). The interface is MessageContext, and you should cast this to SIMessageContext unless you are only interested in the methods provided by MessageContext.
  2. Get the SIMessage from the MessageContext object. For example, SIMessage message = ((SIMessageContext)context).getSIMessage();
  3. Build your mediation header function in a similar way to these examples, using the reference information in Message header reference information to help:
    1. Set the reliability of the message. For instance, siMessage.setReliability(Reliability.ASSURED_PERSISTENT);. In this case, the quality of service is set to the highest level.
    2. Set the time to live for a message - that is, the time, in milliseconds, that the message is allowed to remain on a queue before it is removed if it is not processed. For example, siMessage.setRemainingTimeToLive(1000000); will set the remaining time before the message should expire to 1000 seconds.

Task topic

Terms of Use | Feedback

Last updated: 2 Aug 2005
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.pmc.express.doc\tasks\tjy1506.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)