This pattern provides a sample demonstrating how the Broker can be used to receive a stream of data over TCPIP which conforms to the ISO8583 messaging standard.
The International Organization for Standardization (ISO) is an international network of several groups who are responsible for the development, definition and publication of data standards which are used by the public and private sectors in many industries. One of their commonly used standards for the Banking and Financial Services sector is known as ISO8583. The standard specifies a common interface by which messages originating from credit and debit cards can be interchanged between devices and card issuers. Typical uses of ISO8583 are to define the message format for data which is exchanged with a Point of Sale device, or an ATM (Automated Teller Machine). Messages commonly contain information about the value of a transaction, where it originated (with which store or at which ATM) and of course information from the card itself such as the account number and bank sort code. The back end applications which data is sent to could have an array of purposes such as core banking systems, retrieval of bank statements, the transfer of funds between private bank accounts, the payment of utility bills, or the purchase of mobile telephone credit. WebSphere Message Broker can be used to assist in these kind of middleware scenarios by providing the ability to transform data between the ISO8583 standard and more convenient data formats (e.g. XML based web services), and via other protocols such as WMQ, FTP or HTTP.
Often ISO8583 messages are preceded by customised headers, but the core ISO8583 message will always contain three distinct sections:
This pattern generates a message flow (shown above) which receives data over TCPIP, parses it using a WTX node and finally writes it to a WMQ queue. The TCPIPServerInput node receives 30 bytes of data from the input stream. This data contains some header values, including the length of the ISO8583 message. The first JavaCompute node, named LengthProcessing, is used to determine this length, and places the value in the LocalEnvironment tree. This specification dynamically controls the following TCPIPServerReceive node which receives the required number of bytes following the header. These bytes are sent to the next node in the BLOB domain, and the Compute node which follows takes the PrimaryBitmap content (retrieved using the TCPIPServerInput node) and concatenates it with the main message content (retrieved using the TCPIPServerReceive node). The WTX node which follows uses a map to convert the ISO8583 message into an equivalent XML format. There are many ways this can be achieved using WebSphere Message Broker - other published patterns on MQSeries.net demonstrate the alternative (native WMB methods) of using a WMB Message Set and using a Java Compute node.
The WTX parser examines the PrimaryBitmap to determine which fields are present in the message. The Type Tree also has information contained within it which defines the ISO8583 model (how long each field is defined to be). The WTX map which is provided with this pattern has only defined the fields needed to parse the sample input generated by the provided Test Client. The screenshot below shows the Component Rules in the WTX Type Tree which enable WTX to use the information in the PrimaryBitmap to decide whether each field is present or not:
This pattern also generates a Java project which contains a small easy to use application which can be used to generate an example ISO8583 message and send it to the message flow. Compile the Java application and run it, either within the WMB Toolkit, or externally as shown below:
First deploy the message flow, and then run the application (specify the port as a parameter, as shown above). When prompted by the application, Press the Enter key, and the data will be sent to the message flow.
You can follow the flow's behaviour using the WMB Visual Debugger, or just check the output queue (whose name you will have specified when generating the pattern instance) to make sure the output message has been written out successfully. This pattern writes out the ISO8583 data by converting it into an XML message which it places on the output queue. An example of the XML output is shown in the screenshot below: