Running the Connect:Direct file transfer sample step by step

Input test messages

The test messages which are used to run this sample represent an account transfer between bank accounts:

<AccountTransfer>
  <TransferNumber>2</TransferNumber>
  <TransferAmount>666.66</TransferAmount>
  <From>
    <AccountNumber>00251672</AccountNumber>
    <SortCode>01-29-57</SortCode>
  </From>
  <To>
    <AccountNumber>00145222</AccountNumber>
    <SortCode>01-29-57</SortCode>
  </To>
</AccountTransfer>

In this scenario, each branch (Winchester or Eastleigh) sends a message like this to the bank headquarters (HQ) when an account transfer occurs, so that the transfer can be authorized. In the MQMD header of the message, the branches also provide a reply-to queue. As soon as HQ authorizes the transfers, it sends them to this reply-to queue.
The following table shows the MQ queues that are used for communication between the branches and HQ.

Queue name Description
CD.SAMPLE.REQUEST Account transfers sent by the branches to the HQ for authorizing
CD.SAMPLE.WINCHESTER Authorized account transfers for the Winchester branch
CD.SAMPLE.EASTLEIGH Authorized account transfers for the Eastleigh branch

Running the sample

  1. To see how the account transfers are processed step by step, stop the AuthorisingSystem.msgflow and ReceiveFromAuthorisingSystem.msgflow message flows:
    1. In the WebSphere Message Broker Toolkit, switch to the Brokers view.
    2. Expand the CDSAMPLE execution group in your default broker and Right-click the AuthorisingSystem message flow in the CD Sample Authorising System Application group. Click Stop. The message flow indicates that the message flow has stopped.
    3. Repeat the previous steps for the ReceiveFromAuthorisingSystem message flow in the CD Sample HQ Broker Application group.
  2. Send some account transfer records to the first message flow SendToAuthorisingSystem. The message flow collects the account transfers in one batch file. As soon as the flow receives two end-of-day messages, the batch file will be transferred by using IBM Sterling Connect:Direct (Connect:Direct):
    1. In the WebSphere Message Broker Toolkit, switch to the Broker Development view and expand the CD Sample HQ Broker Application application.
    2. Right-click the Send Test Messages.mbtest file in the Flow Tests group and click open.
    3. The opened test client has eight test messages prepared as enqueue events.
      Six of the test messages are account transfer records; three of them belong to the Winchester branch and three of them belong to the Eastleigh branch. The messages from the Winchester branch have different ReplyToQ entries in their header from those from the Eastleigh branch. The other two messages are end-of-day messages, one for each branch.
    4. Click the first enqueue event and expand the Detailed Properties panel.
    5. In the Detailed Properties panel, examine the message that will be sent to HQ.
    6. In the same window, expand the Header field and click the Header link to open the Configuration view. Expand the MQ Message Headers group and confirm that the Reply to queue name for the Winchester Branch Header has the value CD.SAMPLE.WINCHESTER. This is the reply-to queue to which HQ sends the authorized account transfer record after it is processed.
    7. Return to the Events panel by clicking on the Events tab.
    8. Now send the first seven test messages by clicking on the Send Message button in the Detailed Properties panel for the first seven enqueue events.
  3. To see whether a file has been transferred using Connect:Direct, go to the file system and look in the appropriate directory. The default download directories for Connect:Direct are, for example: Because you sent six account transfer records but only one end-of-day message, the batch file accountTransfers.rqst does not yet exist.
  4. Now send the last message which is the second end-of-day message:
    1. In the WebSphere Message Broker Toolkit, switch to the Broker Development view and expand the CD Sample HQ Broker Application application.
    2. Right-click the Send Test Messages.mbtest file in the Flow Tests group and click open.
    3. Click the last Enqueue Message Flow Test Event and send a message by clicking on the Send Message button in the Detailed Properties panel.
  5. A few seconds after sending that message, the accountTransfers.rqst file appears in the default download directory of the Connect:Direct server. This is the batch file which was transferred to your local Connect:Direct Server from the CDOutput node. It contains all of the account transfer records and information about the reply-to queue name for each record.
  6. Start the AuthorisingSystem message flow. This flow emulates the authorizing system from the external service provider, and retrieves and processes the batch file:
    1. In the WebSphere Message Broker Toolkit, switch to the Brokers view.
    2. Expand the CDSAMPLE execution group in your default broker and right-click the deployed AuthorisingSystem message flow in the CD Sample Authorising System Application group. Click Start.
    3. The message flow now retrieves and processes the accountTransfers.rqst batch file. The processed records are collected in another batch file reply.rply which is then transferred by using a CDOutput node. The accountTransfers.rqst batch file is deleted.
  7. To check if the message flow processed the records, open the default download directory of the Connect:Direct server. Now the file reply.rply appears and includes all account transfer records, authorized and not authorized. The accountTransfers.rqst file is no longer there anymore as it has been deleted.
  8. Finally, start the ReceiveFromAuthorisingSystem message flow which retrieves the batch file with the authorized account transfers and replies to the branches:
    1. In the WebSphere Message Broker Toolkit, switch to the Brokers view.
    2. Expand the CDSAMPLE execution group in your default broker and Right-click the deployed ReceiveFromAuthorisingSystem message flow in the CD Sample HQ Broker Application group. Click Start.
  9. To see whether the message flow has processed the records, open the default download directory of the Connect:Direct server. The file reply.rply is renamed and includes a current timestamp.
  10. To see the reply messages, read the messages on the CD.SAMPLE.WINCHESTER and CD.SAMPLE.EASTLIEIGH WebSphere MQ queues:
    1. In the WebSphere Message Broker Toolkit, switch to the Broker Development view and expand the CD Sample HQ Broker Application application.
    2. Right-click the Send Test Messages.mbtest file in the Flow Tests group and click open.
    3. The two Dequeue test events retrieve the messages from the WebSphere MQ queues for the Eastleigh and Winchester branches. To retrieve a message, click a Dequeue test event and click the Get Message button in the Detailed Properties panel. You get a message containing the authorized account transfer.
    4. Because every branch sent three account transfer records, repeat the previous step two more times in order for both branches to get all authorized account transfer records.

Expected output messages

The expected reply messages provide information about the authorization of an account transfer. The account transfer described in the input test message generates the following reply:

<AccountTransfer>
	<TransferNumber>2</TransferNumber>
	<Authorised>no</Authorised>
</AccountTransfer>

Back to sample home