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

fixes #358 - the connection:opened event should be emited after all operations ? #364

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

Conversation

karlvlam
Copy link

@karlvlam karlvlam commented Mar 12, 2018

Creating receiver link right after 'connection:opened' event will get duplicated messages. Using process.nextTick() to create the link can avoid the issue.

Please review whether this fix is appropriate or not...


This change is Reviewable

@tony-gutierrez
Copy link

@noodlefrenzy Can we get some integrations of these fixes?!

@amarzavery
Copy link
Collaborator

@princjef - What do you think?

@princjef
Copy link
Collaborator

princjef commented Apr 6, 2018

The current behavior should not be a new thing. Though I don't know the original intent of the code, my understanding of the connection:opened event is that it specifically indicates that the AMQP connection was opened successfully. To that end, the event is currently being fired in the right place.

That being said, you typically need at least a connection+session to really do anything in AMQP. That's what the connected event is for. It tells you when your client is ready to work with links, etc. There isn't a constant for it in the client, but you should be able to listen to that instead of modifying the semantics of the connection:opened event. Give that a shot and let me know if it resolves your issue.

For reference, the connected event is fired at https://github.com/noodlefrenzy/node-amqp10/blob/master/lib/amqp_client.js#L214 and https://github.com/noodlefrenzy/node-amqp10/blob/master/lib/amqp_client.js#L218.

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.

4 participants