<div>Hi,</div>
<div> </div>
<div> This problem is solved. It is because the rabbitmq version is too old. After i updated to last version, it works. Thanks for your help.</div>
<div> </div>
<div>Fisher<br><br></div>
<div class="gmail_quote">2011/8/4 Alexandru Scvorţov <span dir="ltr"><<a href="mailto:alexandru@rabbitmq.com">alexandru@rabbitmq.com</a>></span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Also, could you please post the output of:<br>$ ulimit -a<br>
<div class="im"><br>Alex<br><br>On Wed, Aug 03, 2011 at 11:31:27AM +0800, Fisher Yu wrote:<br></div>
<div>
<div></div>
<div class="h5">> 2011/8/2 Alexandru Scvorţov <<a href="mailto:alexandru@rabbitmq.com">alexandru@rabbitmq.com</a>><br>><br>> > Hi,<br>> ><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>> > 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>> ><br>> > > Get = #'basic.get'{queue = Queue},<br>> ><br>> > 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>
> ><br>><br>> Changed this, thanks.<br>><br>><br>> ><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<br>
> > mention<br>> > of the memory alarms being set off?<br>> ><br>><br>> There is nothing happening in the server logs, at least nothing being<br>> raised. There is 24G RAM in here, with about 4G active and 11G free at the<br>
> time of testing.<br>><br>><br>><br>> ><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>
> ><br>><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<br>> x86_64 GNU/Linux<br>><br>> Erlang version<br>
> Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:24:24] [rq:24]<br>> [async-threads:0] [kernel-poll:false]<br>><br>> This machine is almost completely idle at the moment as it's a development<br>> server. There is nothing special for the configuration.<br>
><br>><br>> ><br>> > > I kept get error message while connect to rabbitmq server using<br>> > > rabbitmq-erlang-client library. Anyone can help, thanks.<br>> ><br>> > Does this mean you *always* get this error? Or only occasionally?<br>
> ><br>><br>> Every time the test case is run, this error is produced.<br>><br>><br>> ><br>> > Cheers,<br>> > Alex<br>> ><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">>,<br>> > 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>> > > _______________________________________________<br>> > > rabbitmq-discuss mailing list<br>
> > > <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">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>> ><br></div></div></blockquote></div><br>