Advertisement
Guest User

Untitled

a guest
Oct 17th, 2013
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.50 KB | None | 0 0
  1. #'queue.declare_ok'{queue = ReplyQueue} = amqp_channel:call(Channel, #'queue.declare'{}),
  2. Publish = #'basic.publish'{exchange = <<"">>, routing_key = <<"report_print">>},
  3. Props = #'P_basic'{reply_to = ReplyQueue, headers = ["key", "value"]},
  4. Msg = #amqp_msg{props = Props, payload = term_to_binary(<<"Hello, world!">>)},
  5. amqp_channel:cast(Channel, Publish, Msg).
  6.  
  7. % ...
  8.  
  9. amqp_channel:subscribe(Channel, #'basic.consume'{queue = ReplyQueue, no_ack = true}, self()),
  10. receive
  11.     #'basic.consume_ok'{} -> ok
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement