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

fix: Issue with RabbitMQ Message Consumption #134

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohsenHa
Copy link
Contributor

@mohsenHa mohsenHa commented Oct 8, 2024

Fix Issue with RabbitMQ Message Consumption

This update addresses two key issues related to message consumption from RabbitMQ:

  1. Goroutine Management for Output Channel:
    Currently, when a message is received from RabbitMQ, it is passed to the output channel using a goroutine. This results in a new goroutine being created for every message. Once the output channel reaches its buffer limit, all the goroutines are blocked, waiting for space in the channel to send the messages. This update optimizes the message handling to prevent unnecessary goroutine buildup.

  2. Set Prefetch Count to Match Output Channel Buffer:
    RabbitMQ, by default, fetches all messages at once unless a prefetch count is specified. To avoid overwhelming the system with too many messages at once, we have set the RabbitMQ prefetch count to match the buffer size of the output channel. This ensures that only a manageable number of messages are fetched and processed at a time.

@mohsenHa mohsenHa changed the title fix Issue with RabbitMQ Message Consumption fix: Issue with RabbitMQ Message Consumption Oct 8, 2024
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.

1 participant