How to put msg into MQ at SourceTransferEndExit

172 views Asked by At

MQ FTE docs that

An example use of this exit point is to perform some completion tasks, such as sending an e-mail or a WebSphere MQ message to flag that the transfer has completed.

However how this message sending can be done? My understanding is that FTE will simpy put my exit jar into their classpath and then just call appropriate method when transfer finished.

How can I aquire connection to the QM then? Do I need to do some magic, and on first call create connection to the MQ?

We have very simple use case. We want FTE to put notification message into queue when transfer finished. We are initiating transfer by putting XML command queue, so we can use reply queue element. However doc states that it uses dynamic temporary queue, but it is not what we need. So we need this exit logic then...

Or maybe do you have other idea how to achieve mentioned use case?

Many thanks

Pawel

1

There are 1 answers

6
T.Rob On

How can I acquire connection to the QM then?

The MQCONNX call tends to work best if using the Java API. A ConnectionFactory if using JMS classes.

Do I need to do some magic...

Although the MQ functionality appears to be magic, it is actually just highly advanced technology.

...and on first call create connection to the MQ?

Define "first." First call from FTE? No. The exit loses the connection context between calls. First call to MQ from within the exit? Sure.

When the exit receives control from FTE, just connect to MQ, open the desired queue, and PUT the notification message. The exit has access to the FTE job fields, including the name/value pairs from the job definition. You will need to pass it the destination queue name in the job definition if that value is variable from call to call.