This document explains how to setup the FIX transport sender and listener in Synapse as required by the samples. Further it describes how to setup the sample FIX applications (Executor and Banzai) which are essential for trying out the FIX samples.
FIX (Financial Information eXchange) is a domain specific communication protocol widely used in the finance sector for securities transactions. The protocol specification spans across the application layer and the session layer of the OSI reference model of networking. Apache Synapse comes with a FIX transport adapter which enables the Synapse ESB to communicate with FIX acceptors and initiators. This allows users to seamlessly integrate FIX applications together and even link FIX applications with other systems that use different protocols.
This article describes how to enable and configure the FIX transport listener and sender for Apache Synapse. It also describes how to setup various sample FIX applications required to try out the FIX protocol related examples.
The FIX transport adapter of Synapse is built on top of the Quickfix/J open source FIX engine. Therefore the users must deploy the Quickfix/J libraries into Synapse before using the FIX transport. Also in order to try out the FIX samples described in this documentation, it is required to have the 2 sample FIX applications (Banzai and Executor) that come bundled with Quickfix/J. Therefore as the first step download the latest binary distribution of Quickfix/J and extract the downloaded archive to a suitable location on the local disk (let's refer to this location as QFJ_HOME).
All the necessary Quickfix/J libraries are available in the Quickfix/J binary distribution. You have to copy the following jar files from Quickfix/J installation to the 'lib' directory of Synapse.
The last 2 jar files can be found in the QFJ_HOME/bin directory and all other files should be available in the QFJ_HOME itself.
FIX transport listener and the FIX transport sender of Synapse can be enabled by uncommenting the following sections in the repository/conf/axis2.xml file.
This will initialize the FIX transport adapter and have it up and running to be used by the proxy services. However some additional setting should be applied at the service level before a service can make use of the FIX transport.
When a service needs to be exposed over the FIX transport, we should add the following parameter to the service configuration.
The value of this parameter must be a valid URL which points to a Quickfix/J session configuration file. All the FIX sample configurations are already equipped with this parameter and they are pointing to the sample Quickfix/J configuration files that comes with Synapse. These files can be found in the repository/sample/resources/fix directory. One such configuration file (fix-synapse.cfg) is shown below.
One of the most important parameters in this configuration is the SocketAcceptPort setting. This defines the port used by the Synapse proxy service to receive incoming FIX messages.
As far as the FIX samples are considered you don't have to make any changes to these Quickfix/J configuration files or the Synapse sample configurations. Default settings should work out of the box without any issues. However some samples may require you to make minor changes to these files.
Two sample FIX applications are available in the Quickfix/J binray distribution which can be used to send and receive FIX messages. By default these applications are configured to directly communicate with each other. So we should make a few modifications to the configuration to get them to communicate with Synapse. The binaries of these sample programs are available in the quickfixj-examples.jar file in QFJ_HOME. Startup scripts needed to run them can be found in the QFJ_HOME/bin directory.
Executor is the sample acceptor program. To configure this application to receive messages from Synapse, put the following entries to a file named 'executor.cfg'.
Note that TargetCompID parameter has been set to 'SYNAPSE' and the port number has been set to 9876. You can launch the Executor using the above configuration as follows.
For some samples you will have to make some minor modifications to this configuration file.
Banzai is a sample FIX initiator that comes with Quickfix/J. This can be used to send FIX messages to a defined FIX acceptor. In case of samples, Synapse will act as the acceptor. In order to send messages to Synapse, we should start Banzai using the following configuration.
Note that TargetCompID has been set to 'SYNAPSE' and the socket connect port is specified to be 9876, which is the port used by Synapse. To start Banzai with this configuration, save the above in a file named 'banzai.cfg' and launch the sample application as follows.