IBM MQ
Use the IBM® App Connect Enterprise Toolkit to configure message flow nodes that are converted from the IBM App Connect Professional MQ activities.
About this task
When you import an orchestration that contains MQ activities, the conversion utility creates a message flow with the MQInput, MQGet, and MQOutput nodes. See Table 1, for information on which nodes are used for each of the activities.
| IBM App Connect Professional activity | IBM App Connect Enterprise node |
|---|---|
| Get message | |
| Put message | |
| Poll message |
- In IBM App Connect Professional, the default connection is remote, and you don't need to select the connection type. However, in IBM App Connect Enterprise, you must specify the connection type as either Local, IBM MQ Client (Remote), or CCDT File.
- In IBM App Connect Professional, the username field is mandatory for IBM MQ connections. Whereas in IBM App Connect Enterprise, providing credentials is optional.
Connecting IBM MQ
About this task
- IBM MQ connection
- Policy project
IBM MQ connection
Procedure
Creating the security identity (DSN) for an IBM MQ connection in IBM App Connect Enterprise
Procedure
IBM MQ Policy Project
About this task
Create the policy project by following these steps:
Procedure
- Go to File → New → select policy project.
- Name the file. For example, MQPOLICY
- Right-click the project and select New → Policy.
- Choose the type and template as MQEndpoint.
- Select connection from drop-down menu

Example

- Save the policy project after creation.
- Deploy it to the integration server before you deploy the main project.
- The properties that are set in the policy override the corresponding properties that are set on the IBM MQ Connection tab.
- If an MQEndpoint policy is not specified, then property values that are set on the IBM MQ Connection tab are used.
- Specify the name of the policy project and the policy in the format
{policyProjectName}:PolicyName.
Example:
MQInput, MQGet and MQOutput nodes for Get, Put and Poll message activities.
About this task
An example message flow looks like this:
MQInput node → MQGet node → MQOutput node
Procedure
Example
- Input Queue Name: MyQueue
- Output Queue Name: local
Retrieving data from a previous node to use it in the IBM MQ node
About this task
The input JSON looks like this:
{
"Name": "John",
"Age": 30
}The Compute node code looks like this:
CREATE COMPUTE MODULE MQMsgFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- Declare variables
DECLARE inputJson CHARACTER;
DECLARE name CHARACTER;
DECLARE age INTEGER;
-- Initialize the output tree
SET OutputRoot = NULL;
-- Copy the MQMD header from InputRoot to OutputRoot
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQMD.Format = 'MQSTR';
-- Parse the JSON data from InputRoot
SET inputJson = CAST(InputRoot.JSON.Data AS CHARACTER);
-- Extract fields from JSON
SET name = InputRoot.JSON.Data.Name;
SET age = InputRoot.JSON.Data.Age;
-- Build the XML structure in the XMLNSC domain
SET OutputRoot.XMLNSC.Message.Person.Name = name;
SET OutputRoot.XMLNSC.Message.Person.Age = age;
RETURN TRUE;
END;
END MODULE;
The output XML looks like this:
<Message>
<Person>
<Name>John</Name>
<Age>30</Age>
</Person>
</Message>IBM MQ Explorer result:
Configuring message details in IBM MQ
About this task
In IBM App Connect Professional, you can directly configure the Payload Data Type and Message Type properties under checklist → configure → message details. However, in IBM App Connect Enterprise, these properties can be set by using a Compute node.
The Payload data type can be configured by editing the following items:
Binary - set MQMD.Format to ' ' (empty or 8 spaces)
String - set MQMD.Format to MQSTR;
Message Type:
Datagram - MQMD.MsgType = MQMT_DATAGRAM;
Example

The Compute node code looks like this:
CREATE COMPUTE MODULE mqflowsample_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- Pass input message to the output
SET OutputRoot = InputRoot;
-- Ensure the MQMD header exists
IF OutputRoot.MQMD IS NULL THEN
CREATE FIELD OutputRoot.MQMD;
END IF;
-- Set MQMD.Format to Binary
SET OutputRoot.MQMD.Format = ' '; --or empty
-- Set MQMD.MsgType to Datagram
SET OutputRoot.MQMD.MsgType = MQMT_DATAGRAM;
RETURN TRUE;
END;
END MODULE;In the flow exerciser, you can view the MQMD properties, including
Format and MsgType.






