<br><div class="gmail_quote">On Wed, Jun 29, 2011 at 2:57 PM, Alexander Kuleshov <span dir="ltr"><<a href="mailto:kuleshovmail@gmail.com">kuleshovmail@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello,<br>
<br>
I try to send messsage to rabbitmq-server:<br>
<br>
send_message(Channel, Host, Password, Message) -><br>
% TODO maybe change routing_key on sit_in_reply<br>
amqp_channel:cast(Channel, #'basic.publish'{exchange = <<"">>},<br>
routing_key = <<"test">>,<br>
#amqp_msg{payload = Message}).<br>
<br>
But get error:<br>
<br>
Error in process <0.431.0> with exit value:<br>
{function_clause,[{gen_server,cast, [2,{cast,{'basic.publish',0,<<0<br>
bytes>>,<<7 bytes>>,false,false},<br>
{amqp_msg,{'P_basic',undefined,undefined,undefined,undefined,undefined,undefined,<br>
undefined,undefined,undefined,undefined,undefined...<br>
<br>
How can i fix it? How can i correctly send message to rabbitmq-server?<br>
<br></blockquote><div><br>It looks like the closing curly brace is in the wrong place. The following should work (I tend to use call instead of cast, but I think they're equivalent in this case):<br><br>send_message(Channel, Host, Password, Message) -><br>
amqp_channel:call(Channel,<br> #'basic.publish'{exchange = <<"">>, routing_key = <<"test">>},<br> #amqp_msg{payload = Message}<br> ).<br><br><br>Robby<br>
<br></div></div>