3

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

smolarek999
  • 509
  • 1
  • 5
  • 21

1 Answers1

2

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.

T.Rob
  • 31,522
  • 9
  • 59
  • 103
  • Please correct me if I wrong. So in this class constructor I am creating ConnectionFactory. Then during each onSourceTransferEnd() call I will create connection and send message. Is there any way to configure somewhere parameters to ConnectionFactiry? I do not want hardcoded them – smolarek999 Aug 27 '15 at 14:38
  • You can use JNDI lookup, environment variables, CCDT file, ini file. All of the MQ functionality is available. Other than the fact that it is called by FTE, it's just like any other MQ program. – T.Rob Aug 27 '15 at 14:56
  • You could pass these parameters in the transfer's user metadata, which the exit has access to. – Steve Parsons Aug 27 '15 at 17:40
  • All good advice from T.Rob. Pawel expressed interest in alternative approaches: I've addressed the same scenario by putting the notification message to an MQ queue with a standalone application invoked as a post-transfer program as described [here](http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.wmqfte.doc/invoking.htm). – Steve Parsons Aug 27 '15 at 17:54
  • I tend to approach things from a security perspective so I would want to get a little data as possible from the file transfer for use in execution of a program. The JNDI lookup, environment variables, CCDT file, and ini file are all things controlled by the administrator. The FTE security model doesn't strongly enforce role-based access control so I don't fully trust transfer metadata beyond the scope of native FTE functions. For me this is one of those "just because we can doesn't mean we should" things. – T.Rob Aug 27 '15 at 21:06
  • I got high overview but I lost in details because I'm not familiar with IBM WebSphere world. So when I am implementing SourceTransferEndExit class, what can I use? Do I have any access to dependency injection? Any application server stuff? I do not know in what context this class will be called. Do need to implement everything from scratch in core java? Could you provide some reference how to start? Exit code samples aren't using any advances technics... – smolarek999 Aug 31 '15 at 11:34