<br><br><div class="gmail_quote">2011/8/2 Alexandru Scvorţov <span dir="ltr">&lt;<a href="mailto:alexandru@rabbitmq.com" target="_blank">alexandru@rabbitmq.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
<div><br>
&gt; ** Reason for termination ==<br>
&gt; ** {{badmatch,{error,enomem}},<br>
&gt;     [{amqp_main_reader,handle_inet_async,2},<br>
&gt;      {gen_server,handle_msg,5},<br>
&gt;      {proc_lib,init_p_do_apply,3}]}<br>
<br>
</div>Strictly speaking, that means you&#39;ve run out of memory.  Not sure how<br>
that could happen, though.<br>
<br>
There&#39;s an error in your example:<br>
<div><br>
&gt;         Get = #&#39;basic.get&#39;{queue = Queue},<br>
<br>
</div>should be<br>
<br>
&gt;         Get = #&#39;basic.get&#39;{queue = list_to_binary(Queue)},<br>
<br>
Actually, you&#39;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&#39;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&#39;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&#39;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>
&gt;   I kept get error message while connect to rabbitmq server using<br>
&gt; 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>
&gt; Hi<br>
&gt;<br>
&gt;   I kept get error message while connect to rabbitmq server using<br>
&gt; rabbitmq-erlang-client library. Anyone can help, thanks.<br>
&gt;<br>
&gt; Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:24:24] [rq:24]<br>
&gt; [async-threads:0] [kernel-poll:false]<br>
&gt; Eshell V5.8.4  (abort with ^G)<br>
&gt; 1&gt; test:start().<br>
&gt; =ERROR REPORT==== 2-Aug-2011::08:40:18 ===<br>
&gt; ** Generic server &lt;0.46.0&gt; terminating<br>
&gt; ** Last message in was<br>
&gt; {inet_async,#Port&lt;0.1109&gt;,1,{ok,&lt;&lt;65,77,81,80,1,1,8&gt;&gt;}}<br>
&gt; ** When Server state == {state,#Port&lt;0.1109&gt;,&lt;0.39.0&gt;,&lt;0.41.0&gt;,<br>
&gt;                                {method,rabbit_framing_amqp_0_9_1},<br>
&gt;                                none}<br>
&gt; ** Reason for termination ==<br>
&gt; ** {{badmatch,{error,enomem}},<br>
&gt;     [{amqp_main_reader,handle_inet_async,2},<br>
&gt;      {gen_server,handle_msg,5},<br>
&gt;      {proc_lib,init_p_do_apply,3}]}<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; %%test.erl<br>
&gt;<br>
&gt; -module(test).<br>
&gt; -include_lib(&quot;amqp_client/include/amqp_client.hrl&quot;).<br>
&gt; -compile(export_all).<br>
&gt; start() -&gt;<br>
&gt;         {ok, Connection} =<br>
&gt; amqp_connection:start(#amqp_params_network{username= &lt;&lt;&quot;myuser&quot;&gt;&gt;, password=<br>
&gt; &lt;&lt;&quot;mypassword&quot;&gt;&gt;}),<br>
&gt;         {ok, Channel} = amqp_connection:open_channel(Connection),<br>
&gt;         Queue = &quot;my_queue&quot;,<br>
&gt;         Declare = #&#39;queue.declare&#39;{queue = list_to_binary(Queue),<br>
&gt; durable=true},<br>
&gt;         #&#39;queue.declare_ok&#39;{} = amqp_channel:call(Channel, Declare),<br>
&gt;         Get = #&#39;basic.get&#39;{queue = Queue},<br>
&gt;         {#&#39;basic.get_ok&#39;{delivery_tag = Tag}, Content}<br>
&gt;                        = amqp_channel:call(Channel, Get),<br>
&gt;         io:format(&quot;received message ~p&quot;, [Content]),<br>
&gt;         %% Close the channel<br>
&gt;         amqp_channel:close(Channel),<br>
&gt;         %% Close the connection<br>
&gt;         amqp_connection:close(Connection),<br>
&gt;         ok.<br>
<br>
</div></div>&gt; _______________________________________________<br>
&gt; rabbitmq-discuss mailing list<br>
&gt; <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
&gt; <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>