-
Notifications
You must be signed in to change notification settings - Fork 620
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
Comments
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.
Can you elaborate? Do you get exceptions or other errors? "this is not true" is a meaningless statement.
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 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. |
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. |
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
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.
The text was updated successfully, but these errors were encountered: