I am trying to choose the right architecture for the mid-frequency system I'm working on. Currently, I receive messages from Web Socket or Rest and process them right there. Sometimes it includes I / O operations (that is, additional requests for rest), so it works very slowly, and all other messages, I believe, receive buffering in the implementation of the Web Socket client. This naive approach does not look very scalable.
I read mature trading message architectures, and currently my choice has narrowed to Disruptor and Reactive. I would like to ask for your advice, which is the best choice. In particular, two scenarios bother me:
- The logical relationship between message handlers. When I am connected to a certain exchange, I need to get balances and open orders before I can process trading messages and place orders based on them. It seems to me that Reactive is the best approach to deal with situations that require flow control. Is this a problem for Disruptor?
- Long-term message handlers. Message handlers should be as fast as possible (not blocking the following messages), but what is the right approach if I need to make, say, a rest request in order to create an order as part of a message handler?
source
share