<br><br>
<div class="gmail_quote">2011/8/5 Alexandru Scvorţov <span dir="ltr">&lt;<a href="mailto:alexandru@rabbitmq.com">alexandru@rabbitmq.com</a>&gt;</span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Glad you solved the problem.<br><br>Quick question: what version of RabbitMQ were you using?<br><br></blockquote>

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