Search code examples
quickfixfix-protocolquickfixjquickfixnquickfixgo

How does the acceptor handle messages in QuickFIX/J


I’m trying to build a trading simulator that consists of Broker (client)-Router(acceptor)—Market(client). The documentation is very sparse on QuickFIX/J. I’d like to know in detail:

How messages are handled in general and if the acceptor has any out of the box router table?

  • I'd like clarification on the toApp, fromApp and toAdmin and fromAdmin methods.

Effectivly, I'd like to communicate between the broker(s) and market(s) via the acceptor(router). I know there is no out of the box solution for tag based communication and so I'd have to implement some protocol for that, but i need a broad understanding of the messaging service first. I've read and looked at the documentation but it seems a bit abstract to me. I'd like to know in plain terms, how the client processes messages to and from the acceptor using the above methods, and vice versa.

Also if there any classes/Objects/methods that are key in message handling and their implementation in plain terms.

Also does quickFiX use blocking, non-blocking or asynchronous sockets?

*ps I've already created 2 clients and 1 acceptor, and this is working perfectly

**I'm language agnostic so any explaination in the other ports of the quickFix library would be helpful


Solution

  • Here is an explanation of the various callbacks: https://github.com/quickfix-j/quickfixj#creating-a-quickfixj-application

    Basically you need to implement these methods in your application and can do whatever you want based on the tags that you want. Sending a message to a specific session is as simple as calling

    Session.sendToTarget
    

    See https://github.com/quickfix-j/quickfixj#sending-messages

    If you feel that something from the documentation is missing, please open a pull request (preferred) or issue.

    QFJ uses the MINA library for communication which under the hood uses Java NIO (non-blocking IO). You are however able to use some sort of blocking via the synchronous write option. See SocketSynchronousWrites configuration option.