IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with messaging systems > WebSphere MQ (WMQ) > WebSphere MQ data bindings

Overview of the MQ function selectors

The function selector is run when an export is driven by a message read from a destination. The function selector determines which operation corresponds to the message.

There has to be some mechanism that can be used to determine which SCA operation the message corresponds with. An MQ message contains only data and carries no indication about the target operation for which it is intended. Therefore, we need to map an MQ message to an operation of the targeted service interface. The MQ export listens to a particular destination. When a message arrives to that destination, the function selector determines the target operation.

For the MQ function selector, you need to understand the set of function selectors that come with the MQ bindings and how you could create your own function selector, which are discussed in the following sections:


Set of MQ function selectors

Several function selectors are provided for your selection at binding generation time. The function selector choices you will see on the user interface are as follows:


Implementing your own function selector

The easiest, and recommended, way to build an MQ function selector is to extend the MQFunctionSelector class implementing an abstract method. The function selector's generateEISFunctionName() method has a single argument with an array of type Object. The MQFunctionSelector class unmarshalls these parameters and calls an overloaded generateEISFunctionName() method with a more intuitive argument list, as shown in the following code. The array of four parameters represents different parts of the MQ message.

public abstract class MQFunctionSelector implements
		commonj.connector.runtime.FunctionSelector {
	public final String generateEISFunctionName(Object[] args)
			throws SelectorException;

	public abstract String generateEISFunctionName(MQMD md, String bodyFormat, 			List headers, MQDataInputStream input) throws IOException, 			SelectorException;}

You may alternately provide an implementation of the commonj.connector.runtime.FunctionSelector interface to create your own function selector. If you are implementing your own function selector, you will need to understand the header data binding and body data binding framework as the function selector is given a list of parsed header objects and an unparsed body in an MQDataInputStream input.

MQ data bindings


Related concepts:
Prepackaged MQ data format transformations
Prepackaged MQ function selectors


Related reference:
Overview of MQ data format transformations
Data handlers
Prepackaged JMS and MQ fault selectors