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

Friday, 25 January 2019

Creating WebSphere MQ Objects

Below are some commands for creating mq objects.
Use the DEFINE QLOCAL to create a local queue
DEFINE QLOCAL ('myqueue') +
       DESCR('my test queue') +
       PUT(ENABLED) +
       DEFPRTY(0) +
       DEFPSIST(YES) +
       DEFPRESP(SYNC) +
       SCOPE(QMGR) +
       GET(ENABLED) +
       PROPCTL(COMPAT) +
       DEFREADA(NO) +
       MAXDEPTH(999999999) +
       CLUSTER(' ') +
       CLUSNL(' ') +
       DEFBIND(OPEN) +
       CLWLRANK(0) +
       CLWLPRTY(0) +
       CUSTOM('capexpry(25920000)') +
       REPLACE

Use the DEFINE QALIAS to create an alias queue
DEFINE QALIAS ('myaliasq') +
DESCR('My alias queue') +
PUT(ENABLED) +
  DEFPSIST(YES) +
SCOPE(QMGR) +
        GET(ENABLED) +
TARGET ('REMOTE QUEUE')

Use the DEFINE QREMOTE to create a remote queue
DEFINE QREMOTE (REMOTE QUEUE) +
DESCR ('Remote Queue') +
RNAME (REMOTE QUEUE) +
RQMNAME (QMGR1) +
XMITQ (XMIT1)

You can save the commands in a text file.
Use the runmqsc command to issue MQSC commands to a queue manager.

runmqsc QMGR  <  C:\Temp\MQ_Objects.txt > C:\Temp\result.txt

The above command will invoke the MQSC commands in the text file against the QMGR queue manager. The result is sent to result.txt.

From WebSphere MQ veriosn 8.0.0.4, a new attribute CAPEXPRY has been introduced that can be used to alleviate problems of messages building up and hitting maximum depth limits. Setting this attribute on a destination means that when a message is put to that destination, the expiry time of the message will be limited to the value set in CAPEXPRY.

Sunday, 11 November 2018

Properties versus MQMD folder behavior

I had a REST API message flow where I needed to backup the JSON payload to WebSphere MQ queue. I needed to set the expiry interval on the message.

My message was sourced from an HTTPInput node. This meant that I could not directly set the expiry by simply using the following ESQL statement:-

SET OutputRoot.MQMD.Expiry = '7899100';

The above statement would not have worked since my message was sourced by an HTTPInput message, no MQMQ tree existed.

When a message flow is sourced by an MQInput node there is an MQMD to parse which makes it easy to set the Expiry value.

  1. When your message flow is sourced by an MQInput node, the MQMD takes precedence over the Properties folder in terms of value propagation between the folders.
  2. When your message flow is sourced from an input node that is not the MQInput node (such as the HTTPInput node or a user-defined input node), the MQMD header does not take precedence over Properties folder .
  3. When an MQMD folder is added in a tree that was created by the HTTP Transport, this MQMD does not have control over the Properties folder and the value propagation direction is not MQMD to Properties; it is Properties to MQMD - source IBM Integration Bus Information Center.
To set the message expiry I set both the Properties.ExpirationTime and MQMD.Expiry.

SET OutputRoot.Properties.ExpirationTime = 6048000;
SET OutputRoot.MQMD.Expiry= 6048000;






Monday, 30 October 2017

WebSphere MQ Misc

WeSphere MQ error files (AMQ*.FDC) are kept in C:\Program Files (x86)\IBM\WebSphere MQ\errors