[rabbitmq-discuss] Topic exchange erlang client
Andrey Kolchanov
kolchanov at gmail.com
Tue Aug 28 11:57:40 BST 2012
Hello,
I have a topic exchange in my test environment.
I've add some binding to this exchange in web management console.When I
publish a test message with proper routing key via web management console
this message successfully delivered to desired queue.
I'm trying to publish message through erlang client, but message is not
delivering to queue.
What is wrong with my code:
ExchangeName = <<"custom.topic">>,
ExchangeType = <<"topic">>,
Key = <<"K">>,
Msg = <<"123">>,
{ok, Connection} = amqp_connection:start
(#amqp_params_network{username = <<"guest">>, password = <<"guest">>, host = "192.168.1.1"}),
{ok, Channel} = amqp_connection:open_channel(Connection),
#'exchange.declare_ok'{} =
amqp_channel:call(Channel, #'exchange.declare'{exchange=ExchangeName, durable=true, type = ExchangeType}),
ok = amqp_channel:call(Channel, #'basic.publish'{routing_key = Key},
#amqp_msg{props = #'P_basic'{delivery_mode=2}, payload = Msg}) .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120828/b9a74e5e/attachment.htm>
More information about the rabbitmq-discuss
mailing list