The IBMMQ Connector is used to talk to IBM MQ servers using Java Message Service (JMS).
Configuration
The server is identified using the MQ Host and MQ Port setup options. The Queue Manager, Queue, Channel, Username, and Password should also be configured to talk to the IBM MQ Server.
The Default Filename is used to set a filename that will be used for incoming messages. The default setting for this is ${source['jms.messageid']}
, which uses message id
received from the IBM MQ server. This supports user metadata - see User metadata.
Message Selector can be set to limit the messages that are selected from the IBMMQ servers. The format for this field is the IBM MQ message selector (for more information see https://www.ibm.com/docs/en/ibm-mq/9.3?topic=queues-message-selector-syntax)
Message properties can be set up to add properties to a message that is added to a queue. This supports the user metadata - see User metadata.
To enable SSL, add the cipher suite that is to be used to the Cipher Suite option. You will then need to import an SSL KeyStore and TrustStore (in JKS format) and provide the password of these stores.
The following ciphers are supported:
- TLS_AES_256_GCM_SHA384
- TLS_AES_128_GCM_SHA256
- ECDHE_RSA_AES_256_GCM_SHA384
- ECDHE_RSA_AES_128_GCM_SHA256
Other ciphers that may also work are listed here: https://www.ibm.com/docs/en/ibm-mq/9.3?topic=jms-tls-cipherspecs-ciphersuites-in-mq-classes.
To enable the receiver, select 'Enable Receiver'. Messages are pulled from the queue when they are added and placed into the inbox folder configured within the host. The 'Default Filename' will set the filename that the message will be stored as.
The connector has the ability to update most of the settings through the URI interface. The queue can be overridden by using the following format (assuming the IBM MQ Connector queue is named 'MQ'):IBMMQ:MQ?IBMMQ.Queue=overrideQueue
This will override the queue to use 'overrideQueue' instead of the queue defined in the settings panel.
There is an additional field that can be used to set properties from the URI interface as well. These are passed in a comma-separated format. For example, the following adds message properties to the files that are sent. These properties also support the macro engine.
IBMMQ:MQ?IBMMQ.AddProperties=name1=value1,name2=value2
To enable debugging of the IBM MQ library, add the following flag to lax.nl.java.option.additional in the lax file:-Dcom.ibm.msg.client.commonservices.trace.status=ON
a restart will be needed after this is added. It will create a file ending in .trc in the Harmony directory.
User metadata
The user metadata allows replacement using macros. The IBM MQ connector supports using any message properties as macros for the Default Filename.
To use a message property that is defined within the message, use this format:
${source['property_name']}
where property_name
is the name defined on the message.
The following properties are also provided:
jms.messageid
jms.timestamp
jms.correlationid
jms.priority
jms.deliverymode
jms.deliverytime
jms.expiration
jms.replyto
jms.messagetype
Tokens and expressions are embedded in the Value using the ${expression}
syntax, where the simplest expression is a direct token reference. The following tokens and expressions are supported:
Token | Description |
---|---|
file |
the filename including path and full filename |
filename |
the full filename, excluding the path |
path |
the filename path (filename removed, trailing / or \ included) |
base |
the base portion of the filename (path and .extension removed) |
noext |
the base portion of the filename (.extension removed) |
ext |
the filename extension (including the . prefix) |
date('format') |
the current date/time formatted with 'format' (see http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html) |
source['metadata'] |
metadata propagated from the source (see below) |
expression |
a JavaScript expression, possibly including the above |
The following diagram describes the relationship between the various filename components:
/path/to/file/basefilename.extension |<------------- file ------------->| |<-- path -->||<---- filename ---->| |<- base ->||<- ext >| |<-------- noext ------->||<- ext >|
Examples: The following expressions all evaluate to the same result:
${path}${base}${ext}
${noext}${ext}
${file}
${path+base+ext}
As a performance optimization, any JavaScript expression of the form ${token}
for one of the tokens above is expanded without invoking the JavaScript engine. Also, the primitives ${date('string')}
or ${date("string")}
are similarly expanded without invoking JavaScript. This means that although the four examples above produce the same result, the first three execute much more quickly. But the JavaScript engine provides more capability for some use cases. This example illustrates computing a Value extracted from the last portion of the DocDBTransferID (a GUID):
${source.DocDBTransferID.replace(/.*-/,'')}
IBMMQ Connector Properties
Property | Description | Required |
---|---|---|
MQHost | MQ Server Address | Yes |
MQPort MQ Server Port. | Default is 1414 | Yes |
QueueManager | Queue manager | Yes |
Channel | Channel | Yes |
Queue | Queue name | |
Username | Queue Manager Username | Yes |
Password | Queue Manager Password | Yes |
DefaultFilename | Filename to be used when receiving files. Default is "Filename". | Yes |
EnableReceiver | Enables the receiver. Default is "false". | |
MessageSelector | Message properties to be used when selecting messages | |
MessageProperties | Additional message properties to be set (Message metadata/headers) | |
MessageType | The message type used when putting a message on the queue | |
CipherSuite | A comma-separated list of cipher suites to enable | |
SSLKeyStore | Upload the SSL KeyStore file | |
SSLKeyStorePassword | Password to SSL KeyStore | |
SSLTrustStore | Upload SSL TrustStore file. | |
SSLTrustStorePassword | Password to SSL TrustStore |
Comments
0 comments
Please sign in to leave a comment.