[rabbitmq-discuss] Erlang OTP handle

Tim Watson tim at rabbitmq.com
Wed Apr 17 20:48:52 BST 2013


On 17 Apr 2013, at 20:31, Lee Sylvester wrote:

> Thanks Tim.  I'm using this:
> 
> handle_info({#'basic.consume'{exchange=_Exchange, routing_key=_Key}, Packet}, State) ->
> 
> For receiving messages from RabbitMQ… Does that look about right?
> 

No really - basic.consume is a message from to client to the server indicating that you want to receive messages. Try this instead:

handle_info({#'basic.deliver'{delivery_tag = DeliveryTag},
                  #amqp_msg{payload = Payload}}, State) ->

You might want to skim through http://www.rabbitmq.com/amqp-0-9-1-quickref.html if you're not too sure about AMQP classes and methods and what they're for. 

Cheers,
Tim


More information about the rabbitmq-discuss mailing list