Using multiple LMAX Disruptor

1.2k Views Asked by At

I am new to the LMAX Disruptor, which I am exploring to use it in an multilayered asynchronous project that need to process huge traffic flow.

A request is delivered to the platform to send an SMS, the request is cleaned/checked for simple errors and is logged.

Various other information related to the client who is sending the SMS are fetched and analysed, and other parameters are added to the SMS info.

The right routing route is analyzed and selected. Then from the SMS-info the platform specific protocol params are set and submitted to the router.

Like this there will be flow for receving and processing SMS delivery to log, bill, retry and many others. In every phase there will be concurrent or sequential execution in the program flow. If this is the high level view of the project shall the LMAX disruptor framework be used to communicate (sms-info) between various modules?

If so how many disruptor's righbuffer need to be created?

If my understanding is right, are new ringbuffers created between different every layer/functionality separated?

Can a POJO object be written into the ringbuffer? how can this be adopted to a clustered environemnt? Though I read some docs and had seen some videos on this framework, I can't visualize a solution using this framework.

Any guidelines/examples/visual diagrams/docs or your idea on this would help me a lot.

1

There are 1 best solutions below

1
On

We have played a bit with disruptor and is using it as a library for enabling highly performant, configurable, parallel execution flows .

In the given scenario what I can see are two ring buffer configurations. One for sending the SMS and another for receiving the SMS.

You can also cascade ring buffers in the sending side or receiving side, if you need more complex configurations.

The SMS sending ring buffer configuration can have a event stage flow like enter image description here Similarly the receiving part also can have a stage configuration.

Regarding your question on POJO. Ring buffer has the concept of Event bucket where POJOs can be put as the payload for processing and the Event translator can be used to fill the Event bucket.