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

Make the topic configurable for RedisMessageQueue #363

Closed
Tracked by #359
masci opened this issue Nov 13, 2024 · 3 comments · Fixed by #421
Closed
Tracked by #359

Make the topic configurable for RedisMessageQueue #363

masci opened this issue Nov 13, 2024 · 3 comments · Fixed by #421
Labels

Comments

@masci
Copy link
Member

masci commented Nov 13, 2024

No description provided.

@abdulhuq-cimulate
Copy link

@masci I wonder if this will address the issue I reported here.

TL;DR: When using RedisMQ with multiple replicas of the workflow, each workflow replica consumes and processes the same message from RedisMQ and as a result, the control plane ends up receiving duplicate responses from the workflow.
Using a single replica of SimpleMQ has resolved this problem but since it stores the MQ and Consumers in memory, we are planning on adding support for consumers to use a Redis KV store to make the SimpleMQ more resilient to pod restarts.

@masci
Copy link
Member Author

masci commented Jan 7, 2025

@abdulhuq-cimulate that's a first step but it won't completely fix the issue: at the moment there's no policy around how messages are dispatched, some queues like Simple only supports one consumer per topic, others will happily relay the same message in the same topic to an arbitrary number of consumers (I guess this is your case).

My idea to fix it would be to introduce an explicit delivery policy, something like:

  • DELIVER_ONCE that will deliver the message to at most one consumer, using round robin or random choice
  • DELIVER_ALL that will deliver the message to all the registered consumers

For example we could set the delivery policy when creating the control plane, so it'll be unique for all the deployments and not dependent on the message queue backend (or happy to brainstorm other options).

@abdulhuq-cimulate
Copy link

@abdulhuq-cimulate that's a first step but it won't completely fix the issue: at the moment there's no policy around how messages are dispatched, some queues like Simple only supports one consumer per topic, others will happily relay the same message in the same topic to an arbitrary number of consumers (I guess this is your case).

My idea to fix it would be to introduce an explicit delivery policy, something like:

  • DELIVER_ONCE that will deliver the message to at most one consumer, using round robin or random choice
  • DELIVER_ALL that will deliver the message to all the registered consumers

For example we could set the delivery policy when creating the control plane, so it'll be unique for all the deployments and not dependent on the message queue backend (or happy to brainstorm other options).

Your fix makes sense.

I had a similar core idea but required introducing unncessary complexity by adding a separate MQ server that uses various existing MQs as backend that could take care of delivering messages only once using round robin. Alternatively, extend SimpleMQ to support different MQ backends.

Introducing a delivery policy for the messages in the control plane does make more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants