Showing posts with label Webphere MQ. Show all posts
Showing posts with label Webphere MQ. Show all posts

Wednesday, February 26, 2020

IBM Integration Bus - Working with MQ ( request and response with same correlId).

We have the service via couple queue, We send request to Input Queue and get the response from Out Queue with the same correlId.
The code for "set message to queue" compute node
CREATE COMPUTE MODULE HTTPInputMessageFlow_set_message_to_queue
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
SET OutputRoot.BLOB.BLOB = InputRoot.BLOB.BLOB;

RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;

The code for "set correlId" compute node
CREATE COMPUTE MODULE HTTPInputMessageFlow_set_correlId
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
SET OutputRoot.MQMD.CorrelId = InputLocalEnvironment.WrittenDestination.MQ.DestinationData.correlId;

RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;

Sunday, February 23, 2020

IBM Integration Bus - Webphere MQ

For using the Webphere MQ in  IIB, We have installed the MQ Client at least. Download MQ Client in https://developer.ibm.com/messaging/mq-downloads/

Create the MQ Security Identity:

Create the MQ Security Identity&nbsp; with below command line:

mqsisetdbparms integrationNodeName -n mq::queueid-u username -p password

The command above, create the MQ Security Identity name is queueid

Config the MQ node


After finish, We create 1 flow, and drag and drop a MQ node( Like: MQInput,...)
We have choose the Properties of Node. In Basic Tab, input the Queue Name
In "MQ Connection Tab":

  • Select "MQ client connection Properties" in Connection
  • Input Queue Manager, Host name, port, Channel Name and Security Identity( ex: queueid that is create before)


Install and use xorg-server on macOS via Homebrew

  The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...