Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consume records in order #43

Open
david-eckardt-sociomantic opened this issue Feb 15, 2018 · 0 comments
Open

Consume records in order #43

david-eckardt-sociomantic opened this issue Feb 15, 2018 · 0 comments
Assignees

Comments

@david-eckardt-sociomantic
Copy link
Contributor

david-eckardt-sociomantic commented Feb 15, 2018

Some applications need the records to be in order. The current disk overflow push strategy, which favours piping records through the memory queue over the disk overflow if possible, can change the order dramatically. However, there are applications that need the current strategy.

sociomantic-tsunami/dmqnode#30 discusses how to implement a DMQ channel where a Consumer pops the records strictly in the order in which they were pushed. Important for the node/client protocol is that the Consume request needs to be extended to work as follows.
We add a new preserve_order parameter to the Consume request. This parameter specifies whether

  • the memory queue has priority (the current strategy) (false) or
  • all records in this channel should stay in order (true).

The first Consume request that connects to a certain channel with a certain subscriber name sets the preserve_order. From this point on the option is permanently set for this channel/subscriber combination. All subsequent Consume requests with the same channel/subscriber combination are expected to specify the same value for preserve_order as the first one did, otherwise the Consume request will fail. This seems feasible because multiple consumers for the same channel and subscriber are expected to be instances of the same application.

Should there be a need to change the preserve_order option for an existing channel, it would be possible to allow it as long as there is no disk overflow for the channel.

As there is no need for it, the Pop request will not be extended. Once a channel has been consumed from Pop requests are not allowed for it anyway.

So the new protocol features would be

  • dmqproto.client.request.Consume
    • Args: additional bool preserve_order field
    • Notification: additional NodeInfo field to report a preserve_order conflict error
  • dmqproto.common.Consume
    • New message type to report a preserve_order conflict error
@gavin-norman-sociomantic gavin-norman-sociomantic added this to the v14.2.0 milestone Feb 15, 2018
@matthias-wende-sociomantic matthias-wende-sociomantic modified the milestones: v14.3.0, v14.4.0 Feb 5, 2019
@Geod24 Geod24 removed this from the v14.4.0 milestone Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants