Skip to content

Commit 961b21b

Browse files
Message always publish to localhost. Reuse base 'channel' method to publish and subscribe on one instance (via change connection host to not localhost).
1 parent a582ef5 commit 961b21b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ruby/rpc_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def call(n, &block)
3333
corr_id = rand(10_000_000).to_s
3434
self.requests[corr_id] = nil
3535
self.callback_queue.append_callback(:declare) do
36-
AMQP::Exchange.default.publish(n.to_s, :routing_key => "rpc_queue", :reply_to => self.callback_queue.name, :correlation_id => corr_id)
36+
self.channel.default_exchange.publish(n.to_s, :routing_key => "rpc_queue", :reply_to => self.callback_queue.name, :correlation_id => corr_id)
3737

3838
EM.add_periodic_timer(0.1) do
3939
# p self.requests

0 commit comments

Comments
 (0)