Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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}),
- amqp_channel:call(Channel, #'basic.publish'{routing_key = Key}, #amqp_msg{props = #'P_basic'{delivery_mode=2}, payload = Msg}),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement