The IBM Sterling Connect:Direct file
transfer sample demonstrates how to use the Connect:Direct nodes when working
with IBM Sterling Connect:Direct in conjunction with IBM Integration Bus. The sample demonstrates the following tasks:
Setting up a CDOutput node to send files by using IBM
Sterling Connect:Direct
Setting up a CDInput node to invoke a message flow with files
received by using IBM Sterling Connect:Direct
Overriding destination system properties for an IBM Sterling
Connect:Direct file transfer by using the LocalEnvironment message
tree
Accessing information about a file transfer received from IBM
Sterling Connect:Direct by using the LocalEnvironment message tree
Transferring different records in a single batch file by
using the CDOutput node
Detecting and processing single records in a batch file by
using the CDInput node
Using the MQReply node to send reply messages to different
queues
The sample is based on the following scenario:
The headquarters (HQ) of a small bank authorizes all account
transfer information for bank accounts from its Winchester and
Eastleigh branches daily. HQ receives the account transfers as
WebSphere MQ messages and saves them in a single batch file. After the
last transfer for the day is sent, each branch sends an end-of-day
message to HQ. When HQ receives the end-of-day message from both
branches, it uses IBM Sterling Connect:Direct to transfer the batch
file to an external authorizing service provider, together with
instructions on how to check the transfers. After the authorizing is
done, HQ receives the authorized account transfer records in a new
batch file. HQ then archives the batch file and sends the authorized
account transfer records to the individual branch WebSphere MQ queues.
The scenario is implemented by using three messages flows, which
are described in the following sections:
This message flow runs on the integration node in HQ and receives
the account transfers that require authorization from the branches. It
adds the ReplyToQ to the account transfer records and collects them in
a batch file. It then uses IBM Sterling Connect:Direct to transfer the
file to the external authorizing service provider.
The MQInput node receives individual account transfer records
from either the Winchester or the Eastleigh branch and sends each of
them to the Compute node.
The Compute node detects if a message is an end-of-day
message and increments a counter if so.
If the message is not an end-of-day message, the Compute node
extracts the ReplyToQ from the MQMD header and adds it to the record.
The Compute node sends the record to the CDOutput node.
The CDOutput node batches all records in a local file.
When both branches have sent their end-of-day message, the
Compute node sends a message to the Finish File terminal of the
CDOutput node.
The CDOutput node transfers the batch file to the authorizing
service provider.
This message flow emulates the authorizing system from the
external service provider. It checks and authorizes each account
transfer record in the received batch file and collects the authorized
records in a new batch file. It then uses IBM Sterling Connect:Direct
to transfer the file to HQ.
The CDInput node receives the file sent from HQ.
The CDInput node parses the records in the batch file, each
of which represents an account transfer. It sends each record to the
Mapping node.
The CDInput node populates the local environment with
metadata from the Connect:Direct transfer.
The Mapping node moves each account transfer record to the
output message.
The authorized records are sent to the CDOutput node.
The CDOutput node batches all records in a local file.
When the CDInput node has processed every record from the
batch file, it sends a message from its End of Data terminal to the
Finish File terminal of the CDOutput node.
The CDOutput node transfers the authorized transfers as a
batch file back to HQ.
This message flow runs on the IBM Integration Bus in HQ and receives
the authorized account transfers in a batch file. For each account
transfer in the batch file, it replies to the branch that initiated
the query. The reply is sent to the WebSphere MQ queue that was
specified as ReplyToQ in the MQMD header in the initial query message.
The CDInput node receives the batch file with the authorized
records.
The CDInput node parses the records in the batch file and
sends each record to the MQHeader node.
The MQHeader nodes adds a default MQMD header to each record
before sending it to the Mapping node.
The Mapping node moves the ReplyToQ information from the
record to the MQMD header.
The MQReply node uses the information in the MQMD header to
transfer each record to the branch that sent the original query.
The CDInput node archives the received batch file by adding a
timestamp to its name.