[rabbitmq-discuss] pub-sub part 2: erlang consume

Ben Hood 0x6e6562 at gmail.com
Fri Apr 11 06:38:12 BST 2008


Message that didn't get posted to the list yesterday:

Begin forwarded message:

> From: Ben Hood <0x6e6562 at gmail.com>
> Date: 10 April 2008 11:55:49 BST
> To: Joe Lee <codewalkerjoe at gmail.com>
> Subject: Re: [rabbitmq-discuss] pub-sub part 2: erlang consume
>
> Joe,
>
> On 10 Apr 2008, at 00:17, Joe Lee wrote:
>> (rabbit at home)5> amqp_async_consume:amqp_lifecycle_consume().
>> Connection: {<0.178.0>,direct}
>> ** exception exit: {{amqp_async_consume,amqp_lifecycle_consume,0},
>>                    {line,40},
>>                    match,
>>                    [{'queue.declare_ok',
>>                          
>> <<"amq.q.gen1_rabbit at home_20080409224223_">>,0,0}]}
>>     in function  amqp_async_consume:amqp_lifecycle_consume/0
>
> The reason why this is not working is because the LHS does not match  
> the RHS.
>
> You are trying to match this tuple
>
> #'queue.declare_ok'{queue = Q,
>                        message_count = MessageCount,
>                        consumer_count = ConsumerCount}
>                       = amqp_channel:call(Channel,QueueDeclare)
>
> with this tuple:
>
>> {'queue.declare_ok',
>>                          
>> <<"amq.q.gen1_rabbit at home_20080409224223_">>,0,0}
>
>
> so that fact that Q, which was previously bound to <<"">> is being  
> compared to <"amq.q.gen1_rabbit at home_20080409224223_">> which  
> violates the match condition.
>
> To fix this, don't re-use the *variable* Q, because in Erlang, it's  
> not really a variable (non-destructive assignment).
>
> HTH,
>
> Ben

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080411/306a73c0/attachment.htm 


More information about the rabbitmq-discuss mailing list