Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Message always publish to localhost. Reuse base 'channel' method to publ... #14
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
I'm not a ruby person. What's the difference? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
pavel-drobushevich
Jul 23, 2012
Contributor
Old code call following method:
AMQP::Exchange.default
Source code for this method:
https://github.com/ruby-amqp/amqp/blob/master/lib/amqp/exchange.rb (line 149 and below)
This method has one argument - channel to connect, If this argument is not provided exchange creates default channel which connects to localhost. It is not expected, because FibonacciRpcClient has own channel and in my case it was configured to remote RabbitMQ installation, but as result message try to send to default localhost channel (I don't have local instance).
There are two possible:
- Use exist channel to create exchange
self.channel.default_exchange - Send exist channel to this method
AMQP::Exchange.default(self.channel)
Old code call following method:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
michaelklishin
Jul 23, 2012
Owner
The idea is to not allocate a new channel implicitly. In practical terms, it makes no difference for tutorials but may lead to people doing this unknowingly in real world code, over and over.
The idea is to not allocate a new channel implicitly. In practical terms, it makes no difference for tutorials but may lead to people doing this unknowingly in real world code, over and over. |
pavel-drobushevich commentedJul 18, 2012
...ish and subscribe on one instance (via change connection host to not localhost).