[rabbitmq-discuss] erlang client problem (badarg in {amqp_channel, handle_regular_method, 3})

Alexander Sviridov alexander.sviridov at gmail.com
Tue Mar 23 22:15:07 GMT 2010


Hello!

I'm new to RabbitMQ (and Erlang too), trying to get message from
queue. Getting this:

=INFO REPORT==== 23-Mar-2010::11:24:47 ===
Negotiated maximums: (Channel = 0, Frame= 131072, Heartbeat=0)

=ERROR REPORT==== 23-Mar-2010::11:30:21 ===
** Generic server <0.49.0> terminating
** Last message in was {'$gen_cast',
                           {method,
                               {'basic.deliver',
                                   <<"amq.ctag-/M/5ibuENfSOypENL/
Cc0g==">>,1,

false,<<"notifier">>,<<"notify.tick">>},
                               {content,60,none,
                                   <<...>>,
                                   [<<...content here....>>]}}}

** Reason for termination ==
** {badarg,[{dict,fetch,
                  [<<"amq.ctag-/M/5ibuENfSOypENL/Cc0g==">>,
                   {dict,0,16,16,8,80,48,
                         {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[]},
                         {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[],
                           []}}}]},
            {amqp_channel,handle_regular_method,3},
            {gen_server,handle_msg,5},
            {proc_lib,init_p_do_apply,3}]}


Server info:
[{<<"product">>,longstr,<<"RabbitMQ">>},
                             {<<"version">>,longstr,<<"1.5.4">>},
                             {<<"platform">>,longstr,<<"Erlang/
OTP">>},
                             {<<"copyright">>,longstr,
                              <<"Copyright (C) 2007-2009 LShift Ltd.,
Cohesive Financial Technologies LLC., and Rabbit Technologies
Ltd.">>},
                             {<<"information">>,longstr,
                              <<"Licensed under the MPL.  See
http://www.rabbitmq.com/">>}]

Client:
changeset:   691:eea6142b6845
date:        Mon Mar 15 15:23:43 2010 +1300
summary:     Merge bug21949 into default

my code:
listen_loop(Channel, Q, Ticket) ->
  BasicConsume = #'basic.consume'{ticket = Ticket,
                                  queue = Q,
                                  nowait = true},
  ok
      = amqp_channel:call(Channel, BasicConsume),

  %% If the registration was sucessful, the consumer will
  %% be notified

  receive
        #'basic.consume_ok'{consumer_tag = Tag} -> ok
  end,
  receive
       {#'basic.deliver'{exchange  =  Exchange},
        Content}  ->
           #content{payload_fragments_rev  =  [Payload]}
            =  Content,
           io:format("Message  received:  ~p~n",  [Payload])
  end,

  listen_loop(Channel, Q, Ticket).


I'm doing something in a wrong way, I guess...

Any help will be appreciated, thank you!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100324/35f51cd1/attachment.htm 


More information about the rabbitmq-discuss mailing list