-
Notifications
You must be signed in to change notification settings - Fork 621
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
Question: Sending and Publishing on the same channel #270
Comments
In general the protocol in no way prevents you from consuming and publishing on the same channel. If your publishers run into resource alarms it may be a good idea to use separate connections so that consumers can perform other operations (e.g. declare queues or bind them) even an alarm is in effect (consumers are not blocked by alarms in any way when it comes to deliveries). There can be something specific to this client that must be considered when publishing and consuming on the same connection but I cannot immediately think of anything. @streadway @gerhard do you have anything to add? |
@michaelklishin thanks for your reply. |
@fho see documentation. |
@michaelklishin thanks, I don't think the quoted part from the documentation is about resource alarms.
Scenario: I have unreceived deliveries in the queue on the server. I'm iterating over the messages from the Delivery channel. If not, what is the meaning of the quoted documentation? |
I don't see how unconsumed deliveries can block publishes. There is no response to The comment in question was added in 962fd41 5 years ago. Perhaps @streadway can remember what it was about. |
If I want to use rabbitMQ connection for multiple goruotine, Should I make each connection for consume and publish? like this?
or Is it just ok making channel per goroutine? by using one amqp.Connection or Is there any connection pooling method? |
@michaelklishin |
i would like to know more about this thought ..any thoughts ? |
Hello, I have a question regarding the documentation of
Consume()
.So it's not safe to
Publish()
a message when iterating over thechan Delivery
fromConsume()
? A unreceived delivery could deadlock thePublish()
.The only safe way is to have a separate connection for the publisher and the consumer?
Using a different channel for
Publish()
would still be unsafe?The text was updated successfully, but these errors were encountered: