This article by Asanka Abeysinghe discusses the WSO2 ESB support for the FIX [1](Financial Information eXchange) protocol and how it benefits the development of financial applications. Several business use cases mapped to system use cases are described in detail, together with implementation details and relevant configuration information.
Applies To
| WSO2 ESB | 1.7 |
| Apache Synapse | 1.2 |
Table of Contents
- Introduction [1]
- Abbreviations [1]
- FIX (Financial Information eXchange) [1]
- AMQP (Advanced Message Queuing Protocol) [1]
- FIX Transport Implementation in WSO2 ESB [1]
- FIX Usage with WSO2 ESB - Scenarios [1]
- Bridge FIX to HTTP [1]
- Business Use Case [1]
- System Use Case [1]
- Example [1]
- Bridge FIX to AMQP [1]
- Business Use Case [1]
- System Use Case [1]
- Example [1]
- Switch between FIX Versions [1]
- Business Use Case [1]
- System Use Case [1]
- Example [1]
- CBR (Content Based Routing) of FIX Messages [1]
- Business Use Case [1]
- System Use Case [1]
- Bridge between Data Services to FIX [1]
- Business Use Case [1]
- System Use Case [1]
- Example [1]
- Bridge FIX to HTTP [1]
- Summary [1]
- References [1]
- Author [1]
fixprotocol.org [2]. FIX messages are constructed with name value pairs that contains a standard header, a body and a trailer. FIX header contains a message type (tag 35) property, to differentiate between messages. FIX messages can be divided into two main categories; they are administration messages and application messages.
FIX communicates by creating sessions between FIX engines. FIX engines use a slimilar model to RM (Reliable Messaging), in that it enables message recovery through sequence numbers attached to messages.
Users benefit by using FIX due to many reasons. FIX specifications are open and free. Therefore, its usage dose not cost the user. FIX is a widely used protocol among every major stock exchange, investment banks, world's largest mutual funds and money managers. Thousands of small investment firms use FIX. FIX supports derivatives like equity, options, FOREX (Foreign Exchange) and fixed incomes, like bonds.
Sample FIX message: Buy 1000 DELL @ MKT
8=FIX.4.0#9=105#35=D#34=2#49=BANZAI#52=20080711-06:42:26#56=SYNAPSE#11=1215758546278#21=1#38=1000#40=1#54=1#55=DELL#59=0#10=253
AMQP [3] is and open protocol for business messaging. AMQP was initiated in 1994 by JPMorgen & Chase Co,. iMatix had a parallel development on Java and C/C++. AMQP is popular in the financial community as a high performance and a reliable middleware solution. There are several AMQP implementations that include OpenAMQ, Apache QPid, RabbitMQ and ZeroMQ. The WSO2 ESB AMQP transport is built using Apache Qpid [4].
QuickFIX [5]. The Java implementation of QuickFIX is: Quickfix/J [6].
WSO2 ESB 1.7 documentation [7].
WSO2 ESB 1.7 documentation [7].
synapse.xml
<definitions xmlns="http://ws.apache.org/ns/synapse"> <localEntry key="xslt-key-req" src="file:repository/conf/sample/resources/transform/fixtransform.xslt" /> <proxy name="FIXProxy" transports="fix"> <target> <endpoint> <address uri="http://localhost:9000/soap/SimpleStockQuoteService" /> </endpoint> <inSequence> <log level="full" /> <xslt key="xslt-key-req" /> <log level="full" /> </inSequence> <outSequence> <log level="full" /> </outSequence> </target> <parameter name="transport.fix.AcceptorConfigURL"> file:repository/conf/fix-synapse.cfg </parameter> <parameter name="transport.fix.AcceptorMessageStore"> file </parameter> <parameter name="transport.fix.InitiatorConfigURL"> file:repository/conf/synapse-sender.cfg </parameter> <parameter name="transport.fix.InitiatorMessageStore"> file </parameter> </proxy> </definitions>
fixtransform.xslt
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" /> <xsl:template match="/"> <m0:placeOrder xmlns:m0="http://services.samples/xsd"> <m0:order> <m0:price><xsl:value-of select="//message/body/field[@id='44']"/></m0:price> <m0:quantity><xsl:value-of select="//message/body/field[@id='38']"/></m0:quantity> <m0:symbol><xsl:value-of select="//message/body/field[@id='55']"/></m0:symbol> </m0:order> </m0:placeOrder> </xsl:template> </xsl:stylesheet>
WSO2 Web Services Application Server [8] (WSAS) offers full support for data services. Any RDBMS (Relational Database Management System) with JDBC (Java Database Connectivity), CSV (Comma Separated Values) files or Microsoft Excel files can act as persistence storage in such scenarios.

ESB performance results [9] prove that the WSO2 ESB is far ahead of others out there in the market!
http://wso2.org/project/esb/java/1.7/docs/ESB_Samples.html [10]
[2] WSO2 ESB Samples Setup Guide - http://wso2.org/project/esb/java/1.7/docs/ESB_Samples_Setup.html [11]
[3] WSO2 ESB Configuration Language Guide - http://wso2.org/project/esb/java/1.7/docs/ESB_Configuration_Language.html [12]