Running the Connect:Direct file transfer sample in one step
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 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
- In the WebSphere Message Broker Toolkit, switch to the Broker
Development view and expand the Connect:Direct Sample HQ Broker Application
application.
- Right-click the Send Test
Messages.mbtest file in the Flow Tests group and click open.
- The opened test client has eight test messages prepared as
enqueue events.
Six of the 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.
- Click the first enqueue event and expand the Detailed
Properties panel.
- In the Detailed Properties panel, examine the message that will be sent to HQ.
- 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.
- Return to the Events panel by clicking on the Events tab.
- Now send the eight test messages by clicking on the Send Message button in the Detailed
Properties panel for all eight enqueue events.
- Because the eight messages include two end-of-day messages,
the project now processes a batch file including six account transfer
records. To see the reply messages, read the messages on the
CD.SAMPLE.WINCHESTER and CD.SAMPLE.EASTLIEIGH WebSphere MQ queues:
- 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.
- 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.
- The ReceiveFromAuthorisingSystem message flow also archives
the batch file that it receives by using the CDInput node. To view
this file, go to the file system and look in the appropriate
directory. The default download directories for Connect:Direct are, for example:
- On Windows:
The download
directory in your IBM Sterling Connect:Direct installation
directory.
- On Linux:
The default download directory specified
during the setting up the sample step.
This directory contains a file named *_reply.rply
which contains the authorized account transfer records, together with
information about the WebSphere MQ queue that the reply is sent to.
See the sample reply batch file.
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