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

Introduce channel message receiver #131

Merged
merged 8 commits into from
Apr 17, 2019
Merged

Conversation

ono
Copy link
Collaborator

@ono ono commented Apr 16, 2019

The current version spawns a middle process for every handler registration. This causes a race condition that the message is not coming to the client with a right sequence.

The PR introduces a GenServer which ensures only a single message receiver per channel and client process. This makes sure original sequence of all incoming messages from RabbitMQ via a channel.

@ono ono merged commit ce85578 into master Apr 17, 2019
@ono ono deleted the feature/channel-message-receiver branch April 17, 2019 21:11
@michaelklishin
Copy link

For those who run into errors that look like

GenServer.call(AMQP.Channel.ReceiverManager, {:register_handler, #PID<0.3861.0>, #PID<0.3849.0>, :consume, []}, 5000)

with this version: don't forget to Application.ensure_all_started(:amqp) before you attempt to connect. Code that does not consume (this is realistic in some test suites, for example) would never runs into this.

@ono
Copy link
Collaborator Author

ono commented Apr 24, 2019

@michaelklishin I am expecting that it's usually started by Elixir runtime automatically unless you have a specific setting in your mix.exs or you use old version of Elixir. Or is it when the app starts consumer before amqp app starts? Do you mind sharing more details?

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.

2 participants