WebSphere

MQ Header Setter mediation primitive

Use the MQ Header Setter mediation primitive to create, set, copy or delete WebSphere® MQ message headers.

Introduction

The MQ Header Setter mediation primitive provides a mechanism for managing MQ headers in a message. You can change, copy, add, or delete MQ headers by setting the mediation primitive properties.

If you want multiple header changes you can set multiple actions. Multiple actions are acted on sequentially, in the order you specify; this means that header changes can build on each other.

The MQ Header Setter mediation primitive has one input terminal (in), one output terminal (out) and a fail terminal (fail). The in terminal is wired to accept a message and the other terminals are wired to propagate a message. If the mediation is successful, the out terminal propagates the modified message. If an exception occurs during the transformation, the fail terminal propagates the original message, together with any exception information contained in the failInfo element.

Details

You can create a new MQ header (apart from the MQMD header) and specify the header field values. The new MQ header element is added to the service message object (SMO); if a header of the same type already exists the new header is appended to the end of the header list.

You can also search for MQ headers that already exist in the SMO, by specifying the header type to match on. If matching headers are found, you can set the header fields to the values you specify, or you can delete the headers (other than the MQMD header). Alternatively, you can copy the first matching MQ header to another location in the SMO.

Generally, you specify the field values of MQ headers, using either a literal value or an XPath expression.

Usage

You can use the MQ Header Setter mediation primitive to ensure that when an MQ message is sent to another system, the headers that are sent with the message are correctly set.

Because the operations you define occur sequentially, a later operation can depend on an earlier operation. For example, you could create a new header, copy it to elsewhere in the SMO and then delete it from the list of headers it was initially appended to.

You can also use the MQ Header Setter mediation primitive to help to filter messages, using the Message Filter mediation primitive. You might want to find a particular header and make it available to be used in the filtering. For example, you could copy an MQ header to a more accessible place, and the Message Filter primitive could then use the details inside the header.

Properties

MQ Header Elements
A table of actions that you want to perform on MQ header elements, in the SMO. You can add to this table by clicking Add (follow any instructions to add a dependency, from the module to the MQ schemas). Then follow the instructions of the wizard.
Header Action
The action you want to perform on MQ headers.
  • If you want to create a new MQ header, set the Header Action to Create.
  • If you want to search for MQ headers and then either set the values in any headers that are found or create a new header if none are found, set the Header Action to Find and Set.
  • If you want to search for MQ headers and then copy the first header that is found to another location in the SMO, set the Header Action to Find and Copy.
  • If you want to search for MQ headers and then delete any headers that are found, set the Header Action to Find and Delete.

Header Type
The type of MQ header to create or search for.

If the Header Action is Create or Find and Delete, the Header Type can be any of the following types: MQRFH2, MQCIH (MQ-CICS bridge) or MQIIH (MQ-IMS bridge).

If the Header Action is Find and Set or Find and Copy, the Header Type can be any of the following types: MQRFH2, MQCIH (MQ-CICS bridge), MQIIH (MQ-IMS bridge) or MQMD.

Set Values
If the Header Action is set to Create or Find and Set, you can set the Set Values property.

The Set Values property is a list of MQ header field names and their values. When a new MQ header is created, or MQ headers are found, the new values are set in the specified fields. Each value can be either a literal value or an XPath expression that is resolved at run time to provide the value. The value provided must be compatible with the field where it is to be set. For example, if the field is of type int, the value could validly be 14, but not GoldAccount.

The MQRFH2 header is structurally complex, therefore, you might need to refine the schema. You can do this by adding elements to the MQRFH2Group[] element.

Target Destination
If the Header Action is set to Find and Copy, the Set Values property should be an XPath 1.0 expression that identifies the target destination. The first MQ header to be found is copied to the target destination.

Validate Input
If true, causes the input message to be validated before the mediation is performed.
Table 1. MQ Header Setter mediation primitive properties
Property Valid Values Default
MQ Header Elements Header Action String: Create, Find and Set, Find and Copy or Find and Delete Create
Header Type String: MQRFH2, MQCIH, MQIIH or MQMD.
Note: You cannot create or delete the MQMD header
MQRFH2
Set Values The values are dependent on the Header Type you select
Note: Not used with Find and Copy or Find and Delete
 
Target Destination String: An XPath expression
Note: Only used with Find and Copy
 
Validate input Boolean: true or false false

Considerations

Consider the following when using the MQ Header Setter mediation primitive:


reference Reference topic

Terms of use | Feedback


Timestamp icon Last updated: 20 June 2010 00:39:56 BST (DRAFT)


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.wbit.help.medprim620.doc/ref/rwesb_MQHeaderSettermediationprimitive.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).
iDoc on