## Apache Synapse

## Sample 260:Switch from FIX to AMQP

<definitions xmlns="http://ws.apache.org/ns/synapse"> <proxy name="FIXProxy" transports="fix"> <target> <endpoint> <address uri="jms:/QpidStockQuoteService?transport.jms.ConnectionFactoryJNDIName=qpidConnectionfactory&java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory&java.naming.provider.url=repository/conf/sample/resources/fix/conn.properties&transport.jms.ReplyDestination=replyQueue"/> </endpoint> <inSequence> <log level="full"/> </inSequence> <outSequence> <property name="transport.fix.ServiceName" value="FIXProxy" scope="axis2-client"/> <log level="full"/> <send/> </outSequence> </target> <parameter name="transport.fix.AcceptorConfigURL"> file:repository/conf/sample/resources/fix/fix-synapse.cfg </parameter> <parameter name="transport.fix.AcceptorMessageStore"> file </parameter> </proxy> </definitions>

### Objective

Demonstrate the capability of switching between FIX and AMQP protocols

### Pre-requisites

- You will need the sample FIX blotter that comes with Quickfix/J (Banzai). Configure the blotter to establish sessions with Synapse. (refer FIX setup guide for details)
- Configure the AMQP transport for Synapse. See Configure Synapse for AMQP Transport setup for detail
- To get an idea about the various transport parameters being used in this sample see FIX Transport Parameters .

### Executing the Client

Start the AMQP consumer, by switching to samples/axis2Client directory and running the consumer using the following command. Consumer will listen to the queue 'QpidStockQuoteService', accept the orders and reply to the queue 'replyQueue'.

ant amqpconsumer -Dpropfile=$SYNAPSE_HOME/repository/conf/sample/resources/fix/direct.properties

Open up the SYNAPSE_HOME/repository/conf/sample/synapse_sample_260.xml file and make sure that the transport.fix.AcceptorConfigURL property points to the fix-synapse.cfg file you created. Once done you can start the Synapse configuration numbered 260: i.e. synapse -sample 260. Note that Synapse creates a new FIX session with Banzai at this point.

Send an order request from Banzai to Synapse. e.g. Buy DELL 1000 @ MKT.

Synapse will forward the order request by binding it to a JMS message payload and sending it to the AMQP consumer. AMQP consumer will send a execution back to Banzai.

Back to Catalog