<br><br><div class="gmail_quote">2011/8/2 Alexandru Scvorţov <span dir="ltr"><<a href="mailto:alexandru@rabbitmq.com" target="_blank">alexandru@rabbitmq.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<div><br>
> ** Reason for termination ==<br>
> ** {{badmatch,{error,enomem}},<br>
> [{amqp_main_reader,handle_inet_async,2},<br>
> {gen_server,handle_msg,5},<br>
> {proc_lib,init_p_do_apply,3}]}<br>
<br>
</div>Strictly speaking, that means you've run out of memory. Not sure how<br>
that could happen, though.<br>
<br>
There's an error in your example:<br>
<div><br>
> Get = #'basic.get'{queue = Queue},<br>
<br>
</div>should be<br>
<br>
> Get = #'basic.get'{queue = list_to_binary(Queue)},<br>
<br>
Actually, you'd probably be better off converting Queue to a binary from<br>
the start.<br></blockquote><div><br>Changed this, thanks.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<br>
Still, the failure is during the initial handshake, so that can't be the<br>
cause.<br>
<br>
Have a look in the server logs: is there a matching error? Is there any mention<br>
of the memory alarms being set off?<br></blockquote><div><br>There is nothing happening in the server logs, at least nothing being raised. There is 24G RAM in here, with about 4G active and 11G free at the time of testing.<br>
<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<br>
What OS are you using? What version of Erlang? Is there anything<br>
special about the system's configuration? Is it under heavy load?<br></blockquote><div><br><br>The distribution is Ubuntu 10.04, <br>uname -a<br>Linux fs21 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:25:51 UTC 2011 x86_64 GNU/Linux<br>
<br>Erlang version<br>Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:24:24] [rq:24] [async-threads:0] [kernel-poll:false]<br>
<br>This machine is almost completely idle at the moment as it's a development server. There is nothing special for the configuration.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div><br>
> I kept get error message while connect to rabbitmq server using<br>
> rabbitmq-erlang-client library. Anyone can help, thanks.<br>
<br>
</div>Does this mean you *always* get this error? Or only occasionally?<br></blockquote><div><br>Every time the test case is run, this error is produced.<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<br>
Cheers,<br>
Alex<br>
<div><div></div><div><br>
On Tue, Aug 02, 2011 at 09:43:46PM +0800, Fisher Yu wrote:<br>
> Hi<br>
><br>
> I kept get error message while connect to rabbitmq server using<br>
> rabbitmq-erlang-client library. Anyone can help, thanks.<br>
><br>
> Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:24:24] [rq:24]<br>
> [async-threads:0] [kernel-poll:false]<br>
> Eshell V5.8.4 (abort with ^G)<br>
> 1> test:start().<br>
> =ERROR REPORT==== 2-Aug-2011::08:40:18 ===<br>
> ** Generic server <0.46.0> terminating<br>
> ** Last message in was<br>
> {inet_async,#Port<0.1109>,1,{ok,<<65,77,81,80,1,1,8>>}}<br>
> ** When Server state == {state,#Port<0.1109>,<0.39.0>,<0.41.0>,<br>
> {method,rabbit_framing_amqp_0_9_1},<br>
> none}<br>
> ** Reason for termination ==<br>
> ** {{badmatch,{error,enomem}},<br>
> [{amqp_main_reader,handle_inet_async,2},<br>
> {gen_server,handle_msg,5},<br>
> {proc_lib,init_p_do_apply,3}]}<br>
><br>
><br>
><br>
> %%test.erl<br>
><br>
> -module(test).<br>
> -include_lib("amqp_client/include/amqp_client.hrl").<br>
> -compile(export_all).<br>
> start() -><br>
> {ok, Connection} =<br>
> amqp_connection:start(#amqp_params_network{username= <<"myuser">>, password=<br>
> <<"mypassword">>}),<br>
> {ok, Channel} = amqp_connection:open_channel(Connection),<br>
> Queue = "my_queue",<br>
> Declare = #'queue.declare'{queue = list_to_binary(Queue),<br>
> durable=true},<br>
> #'queue.declare_ok'{} = amqp_channel:call(Channel, Declare),<br>
> Get = #'basic.get'{queue = Queue},<br>
> {#'basic.get_ok'{delivery_tag = Tag}, Content}<br>
> = amqp_channel:call(Channel, Get),<br>
> io:format("received message ~p", [Content]),<br>
> %% Close the channel<br>
> amqp_channel:close(Channel),<br>
> %% Close the connection<br>
> amqp_connection:close(Connection),<br>
> ok.<br>
<br>
</div></div>> _______________________________________________<br>
> rabbitmq-discuss mailing list<br>
> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
> <a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br>
</blockquote></div><br>