Skip to content

Conversation

@korzha
Copy link
Contributor

@korzha korzha commented Apr 15, 2021

We have ran into similar issue described here https://www.quickfixj.org/jira/browse/QFJ-968

We have a huge fix message flow and if we restart our service after a while (after fixing some errors),
our resend request becomes really big and takes a few minutes to fulfill.
Live messages go into the SessionState's messageQueue and fill our whole memory (tens of gigs) in just a few minutes very quickly and the process crashes OOM.

My proposal is to allow to provide a custom implementation of the message queue like you do with MessageStore for example. This will let us store have our implementation of the queue to flush queue on disk.
I've added new constructor to Session to keep old api in place.

@wangvic
Copy link

wangvic commented Apr 15, 2021

This is a very useful change. I want this featue/improvement to be included in the next release version.

Copy link
Member

@chrjohn chrjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@korzha thanks for the PR. In general I think this could be useful.
Could you please take a look? About 750 tests are failing.

Could you also please fix the indentation (2 spaces instead of 4).

On another note: did you try using the already implemented watermark-based queue? It propagates the back pressure to the socket and could prevent the OOM. However, given the amount of data you receive it could quickly fill up the socket buffer of the sending side.

@chrjohn
Copy link
Member

chrjohn commented Apr 15, 2021

@wangvic apart from the things that still need to be looked at this PR could probably be part of 3.0.0 or the minor release after the next.

Copy link
Member

@chrjohn chrjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests need fixing. Looks like a general problem around Logon process.

@korzha
Copy link
Contributor Author

korzha commented Apr 16, 2021

@chrjohn Yes, sorry for the noise.
I think I've fixed them now, let's wait for ci results.

And thanks for suggestion about using watermark queue. Unfortunately we need to keep all the messages we receive without blocking upstream.

@korzha korzha force-pushed the QFJ-968 branch 4 times, most recently from 614dcd8 to be776e4 Compare April 19, 2021 13:37
@korzha korzha marked this pull request as draft April 19, 2021 14:51
@korzha korzha marked this pull request as ready for review April 22, 2021 15:57
@korzha korzha requested a review from chrjohn April 22, 2021 15:57
@chrjohn
Copy link
Member

chrjohn commented May 2, 2021

Thanks so far, I will review in due course. Looking good at first sight.

@chrjohn chrjohn added this to the QFJ 3.0.0 milestone May 2, 2021
@chrjohn
Copy link
Member

chrjohn commented Sep 12, 2022

Closing and reopening to trigger new build jobs.

@chrjohn chrjohn closed this Sep 12, 2022
@chrjohn chrjohn reopened this Sep 12, 2022
Copy link
Member

@chrjohn chrjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Finally gotten around to merge it. Had to do two minor changes in the tests.

@chrjohn chrjohn merged commit ee9b2da into quickfix-j:master Sep 12, 2022
@korzha korzha deleted the QFJ-968 branch September 13, 2022 14:33
Dmitriy-Yugay pushed a commit to Dmitriy-Yugay/quickfixj that referenced this pull request Nov 21, 2022
…ckfix-j#380)

* [QFJ-968] Allow provision of custom Message Queue implementation
Co-authored-by: Andrei Korzhevskii <andrei.korzhevskii@gs.com>
Co-authored-by: Christoph John <christoph.john@macd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants