## Apache Synapse

## Sample 258: Switching from HTTP to FIX

<definitions xmlns="http://ws.apache.org/ns/synapse"> <proxy name="FIXProxy" transports="http"> <target> <endpoint> <address uri="fix://localhost:19876?BeginString=FIX.4.0&SenderCompID=SYNAPSE&TargetCompID=EXEC"/> </endpoint> <inSequence> <property name="transport.fix.ServiceName" value="FIXProxy" scope="axis2-client"/> <log level="full"/> </inSequence> <outSequence> <log level="full"/> <send/> </outSequence> </target> <parameter name="transport.fix.InitiatorConfigURL"> file:repository/conf/sample/resources/fix/synapse-sender.cfg </parameter> <parameter name="transport.fix.InitiatorMessageStore">file</parameter> <parameter name="transport.fix.SendAllToInSequence">false</parameter> <parameter name="transport.fix.DropExtraResponses">true</parameter> </proxy> </definitions>

### Objective

Demonstrates how to use the FIX transport in a transport switching scenario with HTTP.

### Pre-requisites

- You need a Quickfix/J installation to try out FIX samples. Please download and extract a Quickfix/J distribution into your local machine.
- Configure the Executor sample FIX application (shipped with Quickfix/J) to receive messages from Synapse and start it (refer FIX setup guide for more details).
- Enable the FIX transport sender for Synapse (refer FIX setup guide for details).
- Start Synapse using the configuration numbered 258 (repository/conf/sample/synapse_sample_258.xml)
  Unix/Linux: sh synapse.sh -sample 258
  Windows: synapse.bat -sample 258

### Executing the Client

Go to the samples/axis2Client directory and invoke the sample FIX/HTTP client as follows.

ant fixclient -Dsymbol=IBM -Dqty=5 -Dmode=buy -Daddurl=http://localhost:8280/services/FIXProxy

This command sends a HTTP request to the FIXProxy on Synapse. The message is converted into a FIX message and sent to the Executor sample application. Executor will send two responses for this request (receive ack and the execution report) and Synapse will send the first response back to the HTTP client. (Synapse can't send both responses back, since HTTP does not allow sending two responses to the same request)

Back to Catalog