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

Channels are NOT thread safe for concurrent consume/publish #327

Closed
koliyo opened this issue Apr 23, 2018 · 2 comments
Closed

Channels are NOT thread safe for concurrent consume/publish #327

koliyo opened this issue Apr 23, 2018 · 2 comments

Comments

@koliyo
Copy link

koliyo commented Apr 23, 2018

From what I understand in the following issues, the library is designed for thread saftey using the same channel in multiple goroutines.

I have found that this is not true if

  1. Consuming and publishing to the same channel
  2. Auto-ack is disabled on the consumer

I do not have a small example to show, but it was resolved when I changed my setup to using separate channels for consuming and publishing.

If this kind of usage is discouraged it should really be mentioned in the documentation.

@lukebakken
Copy link
Contributor

lukebakken commented Apr 23, 2018

This has already been discussed in #270. It seems like an anti-pattern to use the same channel (or connection, for that matter) to consume and publish. Why would you do that? @michaelklishin should have more to say as well.

I have found that this is not true

Can you elaborate? Do you get exceptions or other errors? "this is not true" is a meaningless statement.

I do not have a small example to show

Opening an issue without code and / or instructions to reproduce the issue is not helpful. It would be appreciated if you provide code to reproduce, or at the very least, detailed steps to do so.

If this kind of usage is discouraged it should really be mentioned in the documentation.

If this turns out to be an actual issue and not just non-optimal code, we would welcome a pull request. This library and its associated documentation are all available in this repository.

@koliyo
Copy link
Author

koliyo commented Apr 25, 2018

Ok, thanks for reply, and sorry for not being more helpful with the report. I don't have time to investigate this further right now I'm afraid. It is working very well now that I split up the consume and publish channels.

I'm new to using AMQP and it was not really obvious to me that separate channels would be the preferred design. Not sure why I did not find the #270 issue when I was looking for info on thread safety.

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

No branches or pull requests

2 participants