FIX Client Server Complete Application QuickFix

FIX Client Server Complete Application QuickFix

Last tutorial you saw how to create simple FIX client server application using QuickFix. This is advanced version of FIX client server which you can directly implement in your project.

Once gain we will be using QuickFix API which 100% java based free and very easy to use. This API provides everything you need to deal with FIX protocol.

Recap fromm previous tutorial:

  • FIX Acceptor (Called as FIX Server) – Server process the FIX message its nothing but exchange you sent your order for processing
  • FIX Initiator (Called as FIX Client) – Client are broker who send order to the exachange in FIX format. In this advance tutorial I have used Mediator and adapter desing pattern you shown in below details class diagram:

FIX Client Server Complete Application QuickFix

Main classes shown on above diagram:

  • We have main model class name: LifeCycleManagerModel.java which is POJO class to store object data which will be pass to the server for new order.
  • PhysicalSettlementAdapter.java interface and it’s implementation class is adapter class which will take LifeCycleManagerModel class as parameter and will convert to NewOrderSingle that will be passed to the exchange for new order
  • PhysicalSettlementMediator.java mediator and its implementaion where one method has been exposed and this will work as mediator between client and FIX initiator.
  • PhysicalSettlementCollegue.java abstract class and its implementaion is nothing but colloeague of mediator will pass client request to mediator friend to more new order to exchange.

Now let’s jump on actual implementation

  • First create maven project name: FIXAcceptorServer which is our dummy exchange server where we will submit our order. Below if final project structure:

FIX Client Server Complete Application QuickFix

  • pom.xml:

  • acceptor.cfg:

  • FixAcceptor.java:

Other configuration file you could download and copy from below downalod link.

  • Now create maven project name: FIXInitiatorClient which is our actual client which we send real time order to the exchange. Below is final proejct structure:

FIX Client Server Complete Application QuickFix

FIX Client Server Complete Application QuickFix

  • pom.xml:

  • PhysicalSettlementAdapter.java:

  • PhysicalSettlementAdapterImpl.java

  • PhysicalSettlementCollegue.java:

  • PhysicalSettlementCollegueImpl.java:

  • PhysicalSettlementMediator.java:

  • PhysicalSettlementMediatorImpl.java:

  • LifeCycleManagerModel.java:

  • Utils.java

  • FixInitiatorStratup.java:

  • SendPhysicalSettlementByMediator.java:

  • initiator.cfg:

Thease are main files and other files directly download from bottom link and add to your prject.

  • To run this applicaiton first you will have to strat FIXAcceptorServer as java application if all configuration set properly you will below output on console:

FIX Client Server Complete Application QuickFix

  • Now start and send order using class: SendPhysicalSettlementByMediator.java as this class also has main method so java start as java application you will below successful order message on the console:

FIX Client Server Complete Application QuickFix

  • Also how server processed the message from client you could see on FIXAcceptorServer console as below:

FIX Client Server Complete Application QuickFix

  • That’s it.

Note: I am not including Jars of this proejct in download link. You could use maven and QuickFix to download all jar if these don’t works then you could use this tutorial project download link and include all jars.

download Download Project: FIXAcceptorServer FIXInitiatorClient

Leave a Reply

Your email address will not be published. Required fields are marked *