Question

I am using Quickfix/J to implement FIX protocol. The issue is we will have two servers supporting the application when it goes live. However, only one server will have the FIX engine up and running. Plan is to route the FIX requests from the other server to the server which has Quickfix running on it. The code on both servers is exactly the same. I am stuck as I need to make the servers intelligent enough to check if the FIX connection has already been established by the other server. If the conneciton is not established, this server will create a connection. If the connection already exists, it will stay quite. This will be further extended in future when if a server finds the other server which had FIX on it, getting down, it will bring up its own FIX engine. For now, the hurdle seems to be finding a clean way to ensure that only one TCP connection is established, the code remaining same on both servers.

Was it helpful?

Solution

One possible way is to use the heartbeat messages you receive from your counterparty. If heartbeat messages are arriving, that means a connection is up and you do not need to perform any actions. How you intend to implement the methodology is open to interpretation. You could use a message bus or something shared between the 2 FIX engine. But that is only a suggestion, I had used this ame methodology while I was working on a FIX project.

Update:- What I did was put a message broker behind the 2 engines, with a controller. The controller's only duty was keep checking for the heartbeat messages. The moment it misses a heartbeat message it will send a signal to the reserve FIX engine to fire up assuming there was some problem with the running FIX engine. There isn't much complexity in this architecture only an extra component. But this is only one of the options, there maybe many else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top