« Configuring BizTalk Server for Dynamics AX Integration | Main | Installing and Configuring the FIX Adapter for BizTalk »
Friday
Apr012011

Basic FIX Routing Application using ShortCut

This is the fourth post in a short series on the FIX adapter for BizTalk.

  1. FIX for BizTalk (The basics)
  2. ShortCut Architecture and Overview
  3. Installing and Configuring ShortCut
  4. Basic Routing Application using RapidAddition’s ShortCut
  5. Mapping FIX Messages
  6. More complicated scenarios and patterns using a FIX-enabled BizTalk

This post will take you through a basic routing application in BizTalk using RapidAddition’s ShortCut FIX adapter. We’ll leverage content based routing (CBR) and although an unlikely easy scenario it will demonstrate how to use FIX messages in BizTalk.

The solution will focus on three entities.

BUYSIDEFIRM

This entity represents a buy side firm that will be sending orders to our message broker and we’ll route them to the appropriate hub or sell side firm. Our system will first ack back to the buy side, forward the messages on and then route the executions (sell side responses) back to the BUYSIDEFIRM. We will always ack the buyside but this is where some business process and perhaps the rules engine might come in handy to validate the orders.

FIX Details we’ll use for the receive location (from their perspective):

Property Value Description
IPAddress 127.0.0.1 This will all run on a single host
Port 9001  
SenderCompId BUYSIDEFIRM Counterparties identifier
TargetCompId MYMSGBROKER this is our BizTalk group
Initiator False BizTalk will initiate this session
Version FIX.4.2 The version of FIX that the buyside will support
HeartBeatInterval 60 seconds The interval that heartbeats will be sent, it’s important these match otherwise the sessions will logout.

 

In BizTalk we’ll need to configure a receive location and one send port for the BUYSIDEFIRM. The receive location will receive any messages the BUYSIDEFIRM sends over and the send port will send back our ack and then the fills we’ll get from the SELLSIDEFIRM. This will be apparent later and I’ll post a video of the solution in action which will help. 

The receive location, which will be from BizTalk’s perspective will be configured as:

image

Property Value Description
CounterParty: CompID BUYSIDEFIRM Our counterparties CompID (TargetCompId to BizTalk SenderCompID from their perspective)
IPAddress 127.0.0.1  
Port 9001  
FIXVersion FIX.4.2  
Initiator True BizTalk will initiate the session
HeartbeatInterval 60  
Party: CompID MYMSGBROKER  

 

For reasons discussed in the first article the send port is pretty straight forward.

image 

Property Value Description
CounterParty: CompID BUYSIDEFIRM Our counterparties CompID (TargetCompId to BizTalk SenderCompID from their perspective)
FIXVersion FIX.4.2  
Party: CompID MYMSGBROKER  

 

image

We want the BUYSIDE FIRM send port to subscribe to messages that come back from the SELLSIDE’s session. To construct the initial ack we’ll also subscribe to the BUYSIDE receive port and map the Order message to a ExecutionReport. 

image

Using the sweet new 2010 feature of only showing relevant nodes the map is pretty simple.

image

To represent the BUYSIDEFIRM we’ll use the FIX test harness that RapidAddition provide with their adapter. By now you should be getting the gist of what we’re trying to do.

image

This test harness will listen for logon messages over port 9001, if the logon message has the expected CompID’s the session will be established. If you never sent an order over the two FIX engines will happily heartbeat each other every 60 seconds. The heartbeats or admin messages don’t make it into BizTalk only application messages like Order’s, ExecutionReports etc will be passed on. 

To send orders the test harness has an option to construct a FIX NewOrderSingle:

image

image

At the moment as we haven’t configured the SELLSIDE if we sent an order we’ll just get back the acknowledgement.

image

To recap, using the test harness the BUYSIDEFIRM sent an Order to our message broker (BizTalk). Leveraging CBR BizTalk routed the Order back to the BUYSIDE firm and we mapped the Order to an ExecutionReport on the way out to simulate an acknowledgement. Obliviously you wouldn’t ACK every order you received but this is just a simple demo. In a future post we’ll route the Order to an Orchestration and use the Rules Engine to validate and determine where to forward it.

SELLSIDEFIRM

This entity represents a sell side firm or broker that we will be forwarding orders to from the BUYSIDEFIRM. The sell side will either reject or fill the orders which means we’ll get back more execution reports. 

FIX Details we’ll use for the receive location (from their perspective):

Property Value Description
IPAddress 127.0.0.1 This will all run on a single host
Port 9002  
SenderCompId SELLSIDEFIRM Counterparties identifier
TargetCompId MYMSGBROKER this is our BizTalk group
Initiator True They will initiate this session
Version FIX.4.2 The version of FIX that the sellside will support
HeartbeatInterval 60 seconds The interval that heartbeats will be sent, it’s important these match otherwise the sessions will logout.

 

The receive location will be pretty similar to the buyside except obviously the compids and ports will be different. For this session the SELLSIDEFIRM will initiate so BizTalk will be listening on port 9010 (configured in the adapter handler settings) and connect back to them over port 9002 as above.

image

Property Value Description
CounterParty: CompID SELLSIDEFIRM Our counterparties CompID (TargetCompId to BizTalk SenderCompID from their perspective)
IPAddress 127.0.0.1  
Port 9002  
FIXVersion FIX.4.2  
Initiator False SELLSIDE will initiate the session
HeartbeatInterval 60  
Party: CompID MYMSGBROKER  

 

For the routing the sell side send port will be configured as:

image

And filtering on the BUYSIDEFIRM’s receive port to pickup the orders:

image

Again we’ll use the RapidAddition test harness to simulate the sell side.

image

To fill the orders we can configure the sell side test harness to auto fill any orders received. This just means it will construct 4 execution reports and send them back whenever it gets an order.

image

End to End

So now if the BUYSIDE sends an order Biztalk will route it back to the BUYSIDEFIRM and map it to the execution report to simulate an ack. At the same time it will forward the Order to the SELLSIDE FIX session. The SELLSIDE test harness will auto fill the order with 4 Execution reports and send them back to BizTalk. Finally BizTalk will forward these fills back to the BUYSIDEFIRM. Sounds like a lot if going on but it’s actually pretty straight forward but if you’re still confused then check out the video.

1. BUYSIDE Sends Order

image

2. BUYSIDE Receives ACK

image

3. SELLSIDE Receives Order from BUYSIDE via BizTalk

image

4. SELLSIDE fills Order, BUYSIDE receives fills (ExecutionReports) from SELLSIDE via BizTalk

image

Hopefully this gives you an idea of how to use the BizTalk FIX adapter, it’s very easy to setup and get going with and the test harness makes testing very easy. It’s also pretty fast which hopefully shows on the video.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>