[rabbitmq-discuss] Erlang OTP handle

Lee Sylvester lee.sylvester at gmail.com
Wed Apr 17 20:31:37 BST 2013


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?

Thanks,
Lee



On 17 Apr 2013, at 20:24, Tim Watson <watson.timothy at gmail.com> wrote:

> Oh and specifically, the messages will be records, see the header files for details.
> 
> Cheers,
> Tim
> 
> On 17 Apr 2013, at 20:08, Tim Watson <watson.timothy at gmail.com> wrote:
> 
>> Hi again Lee - just responded on erlang-questions. Take a look at amqp_gen_consumer. It does what you're trying to do so you can either use it as a template or just code your consumer process using it's behaviour instead of gen_server's.
>> 
>> Cheers,
>> Tim
>> 
>> On 17 Apr 2013, at 20:04, Lee Sylvester <lee.sylvester at gmail.com> wrote:
>> 
>>> Thank you, Alvaro… However, do you know what the structure of Info is for RabbitMQ messages?  Or is it simply the message binary?
>>> 
>>> Thanks,
>>> Lee
>>> 
>>> 
>>> 
>>> On 17 Apr 2013, at 20:00, Alvaro Videla <videlalvaro at gmail.com> wrote:
>>> 
>>>> Yes, it's possible. Use handle_info in your gen_server behaviour and then pattern match on the parameters.
>>>> 
>>>> handle_info is used for messages that are sent to the process but that are not part of the gen_server API.
>>>> 
>>>> 
>>>> On Wed, Apr 17, 2013 at 8:54 PM, Lee Sylvester <lee.sylvester at gmail.com> wrote:
>>>> Hey guys,
>>>> 
>>>> So, I'm using RabbitMQ with Erlang.  Does anyone know how I'd receive messages through amqp_client using OTP?  The examples only show using a loop with the receive, whereas I'd like to avoid an actual loop where possible.
>>>> 
>>>> Thanks,
>>>> Lee
>>>> _______________________________________________
>>>> rabbitmq-discuss mailing list
>>>> rabbitmq-discuss at lists.rabbitmq.com
>>>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>>> 
>>>> _______________________________________________
>>>> rabbitmq-discuss mailing list
>>>> rabbitmq-discuss at lists.rabbitmq.com
>>>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>> 
>>> _______________________________________________
>>> rabbitmq-discuss mailing list
>>> rabbitmq-discuss at lists.rabbitmq.com
>>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130417/ecc88254/attachment.htm>


More information about the rabbitmq-discuss mailing list