Project link: https://github.com/ibm-messaging/mq-dev-patterns/blob/master/serverless/codeengine/clientapp/env.json
I'm looking to understand this sample project a bit better. Here are my questions:
.TAB
file that is typically used for .exe
programs and I need to port over to this project. How can I accomplish this?I'm a beginner in MQ and I need some guidance to get my project rolling. Thank you.
I've pushed this project to IBM cloud's code engine and it is live but i cannot put anything to my desired queue or read anything from it. This is most likely due to the fact that the config isn't correct.
That env.json
file is used as the default envrionment settings for the clientapp. All the values can be overridden using environment settings. The client app is an express / node.js that exposes the following endpoints:
The forms are used to trigger / test the apis. The apis can be used by other apps / observers to request the code to wake up and do something.
The queue which it needs to do these actions are found in
the env.json
file. If you want you could modify the api code to expect a queue name as an input, you probably would want to add a list of queues into the forms, and pass the selected queue to the api endpoints.
The code makes use of the IBM MQ node.js library ibmmq
, and uses the app user and password as application credentials for the queue manager that it connects to.
The MODEL_QUEUE_NAME
and DYNAMIC_QUEUE_PREFIX
aren't actually used by the code but were kept in to allow for the creation of routes that triggered a request / response action. For which a model queue is needed to create dynamic temporary queues.
With respect to the MQIPT config, the CONNAME you use for the client connection needs to point to MQIPT, and if you're using TLS the client needs to trust the MQIPT certificate. So you'd use the MQIPT hostname and port in your env.json and if you're using TLS, you'll need to populate the keystores with the appropriate certificates.
The CodeEngine sample doesn't look to include support for CCDT, but the underpinning MQ Node.JS library does export CCDTUrl. You'll need to modify the buildCNO()
function in mqclient.js
, to skip code that creates and sets mq.MQCD()
in the same way that is done in the basicget.js sample.
eg. This bit of logic is skipped if a CCDT is being used.
if (! ccdtCheck()) {
debug_info('CCDT URL export is not set, will be using json envrionment client connections settings for %s', MQDetails['QMGR']);
// And then fill in relevant fields for the MQCD
let cd = new mq.MQCD();
cd.ConnectionName = `${MQDetails.HOST}(${MQDetails.PORT})`;
cd.ChannelName = MQDetails.CHANNEL;
debug_info('Connection is ', cd.ConnectionName);
if (MQDetails.KEY_REPOSITORY) {
debug_info('Will be running in TLS Mode');
cd.SSLCipherSpec = MQDetails.CIPHER;
cd.SSLClientAuth = MQC.MQSCA_OPTIONAL;
}
// Make the MQCNO refer to the MQCD
cno.ClientConn = cd;
}