[GH-ISSUE #410] Can the consumer group function be supported? #1195

Closed
opened 2026-03-07 22:07:04 +03:00 by kerem · 4 comments
Owner

Originally created by @erosiners on GitHub (Mar 5, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/410

Originally assigned to: @hibiken on GitHub.

Originally created by @erosiners on GitHub (Mar 5, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/410 Originally assigned to: @hibiken on GitHub.
kerem 2026-03-07 22:07:04 +03:00
Author
Owner

@hibiken commented on GitHub (Mar 6, 2022):

@erosiners Thank you for opening an issue!

Could you provide more details? It'd be easier to understand if you could provide an example use case.

<!-- gh-comment-id:1059890733 --> @hibiken commented on GitHub (Mar 6, 2022): @erosiners Thank you for opening an issue! Could you provide more details? It'd be easier to understand if you could provide an example use case.
Author
Owner

@erosiners commented on GitHub (Mar 6, 2022):

For example, after a user has successfully registered, multiple consumers may send emails or text messages to users at the same time and add points to users when a message is published. Emails and text messages are independent services, and they all need to subscribe to receive messages before processing them. The current single-consumer model cannot complete the appeal function.
My English is not good, I hope you can understand

<!-- gh-comment-id:1059933514 --> @erosiners commented on GitHub (Mar 6, 2022): For example, after a user has successfully registered, multiple consumers may send emails or text messages to users at the same time and add points to users when a message is published. Emails and text messages are independent services, and they all need to subscribe to receive messages before processing them. The current single-consumer model cannot complete the appeal function. My English is not good, I hope you can understand
Author
Owner

@hibiken commented on GitHub (Mar 6, 2022):

@erosiners Thank you for providing more details!

Asynq does not support something like Kafka consumer group, so you need to use a different approach.

Using the example above, I can think of two approaches:

  1. Multiple messages approach: Enqueue one task for sending email and enqueue another task for sending text message
  2. Single message approach: Enqueue one task to send notifications (email + text message) and include idempotent key. Within the task handler, call EmailService and TextMessageService with the idempotent key (we need this idempotent key to make sure that we send one email and one text message, even if the task gets retried multiple times)

Let me know if you have any questions :)

<!-- gh-comment-id:1059973170 --> @hibiken commented on GitHub (Mar 6, 2022): @erosiners Thank you for providing more details! Asynq does not support something like Kafka consumer group, so you need to use a different approach. Using the example above, I can think of two approaches: 1. **Multiple messages approach**: Enqueue one task for sending email and enqueue another task for sending text message 2. **Single message approach**: Enqueue one task to send notifications (email + text message) and include idempotent key. Within the task handler, call EmailService and TextMessageService with the idempotent key (we need this idempotent key to make sure that we send one email and one text message, even if the task gets retried multiple times) Let me know if you have any questions :)
Author
Owner

@hibiken commented on GitHub (Mar 22, 2022):

Closing this, feel free to reopen this issue if you have follow-up questions :)

<!-- gh-comment-id:1074581795 --> @hibiken commented on GitHub (Mar 22, 2022): Closing this, feel free to reopen this issue if you have follow-up questions :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#1195
No description provided.