[rabbitmq-discuss] publish to empty exchange works, while publish to correct exchange doesn't

Marcin Krol mrkafk at gmail.com
Tue Jan 25 20:44:41 GMT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everyone,

Yes, it's RPC time again. ;-)

In client:

chan.exchange_declare(exchange = rpc_res_exch,type='direct')
chan.queue_declare(queue = myqueue)
chan.queue_bind(exchange = rpc_res_exch, queue = myqueue)


Now, when I do in server:

ch.basic_publish(
    exchange = '',
    properties = pika.BasicProperties(correlation_id =
props.correlation_id + '_' + mynode),
    routing_key = props.reply_to,
    body = str(response))

... messages get delivered to 'myqueue'.

But when I do:

ch.basic_publish(
    exchange = rpc_res_exch,
    properties = pika.BasicProperties(correlation_id =
props.correlation_id + '_' + mynode),
    routing_key = props.reply_to,
    body = str(response))

... messages do NOT get delivered to the queue.

I checked with rabbitmqctl list_queues (it should show number of
messages in queue next to queue name, right?)


Can anyone please explain this mystery to me?




Server code:

http://pastie.org/pastes/1497146/text

Client code:

http://pastie.org/pastes/1497144/text





- --

Regards,
mk

- --
Premature optimization is the root of all fun.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNPzY5AAoJEFMgHzhQQ7hOPukH/1b/vgYnUh0raxBZI7iBSJVe
dJqGQIU2thBGKoklNVvVqGU8CBs706q3mgf53Fpxx8QMBUle9TyeJ3jdVuPKRnP7
Nvy+XL6Jqtg9FbWXThim/pgLcvBs1FgVxwlPs/kRnK6B/b0IyyUzrqDUoWBxzKBN
Epenj62QCyOPwOvGeCcAlbwba2O0ds7IuOinj7nFkbFu+PojP1DPvj5eQ4UUoI/h
GXqlbJbxi3+Rt3b4pR7hx/Jf3/Ya4TYIM4sxGikMpl6nNHV8y7cqQyikZ1iBoeJU
+0+BXFj/DEEcjnMTi8aty+/tY4xB7G/osYsBURfWprHg9OE8EoNYpor3/M7JdKU=
=y55B
-----END PGP SIGNATURE-----


More information about the rabbitmq-discuss mailing list