<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><html>On 11 Apr 2008, at 05:24, Joe Lee wrote:</html><br class="Apple-interchange-newline"><blockquote type="cite">Hello all,<br><br><div class="gmail_quote">On Thu, Apr 10, 2008 at 6:55 AM, Ben Hood <<a href="mailto:0x6e6562@gmail.com">0x6e6562@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> You are trying to match this tuple<div class="Ih2E3d"><br> <br> #'queue.declare_ok'{queue = Q,<br> message_count = MessageCount,<br> consumer_count = ConsumerCount}<br> = amqp_channel:call(Channel,QueueDeclare)<br> <br></div> with this tuple:<div class="Ih2E3d"><br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> {'queue.declare_ok',<br> <<"amq.q.gen1_rabbit@home_20080409224223_">>,0,0}<br> </blockquote> <br> <br></div> so that fact that Q, which was previously bound to <<"">> is being compared to <"amq.q.gen1_rabbit@home_20080409224223_">> which violates the match condition.<br> <br> To fix this, don't re-use the *variable* Q, because in Erlang, it's not really a variable (non-destructive assignment).<br> </blockquote><div><br>I have tried what Ben suggested and used a new variable called Q1. It helped me get over that problem. Now I have another issue with the consume code.<br><br>I tried looking into mnesia tables and ets tables, but not much help. Receive is timing out at after 2000 -> exit(did_not_receive_message) end. Only reason for to get timeout is when there isn't a message in the exchange. This shouldn't be the case because I just published the message.<br> <br> receive<br> {#'basic.deliver'{delivery_tag = DeliveryTag}, Content} -><br> #content{payload_fragments_rev = [Payload]} = Content,<br> io:format("Message received: ~p~n", [Payload])<br> after 2000 -><br> exit(did_not_receive_message)<br> end<br></div></div></blockquote></div><br><div><div>f you are using the same code that you posted yesterday, this won't work because you are consuming from the wrong queue:</div><div><br></div><div>BasicConsume = #'basic.consume'{ticket = Ticket,<br> queue = Q,<br> consumer_tag = <<"">>,<br> no_local = false,<br> no_ack = true,<br> exclusive = false,<br> nowait = false},<br> #'basic.consume_ok'{consumer_tag = ConsumerTag} <br> = amqp_channel:call(Channel, BasicConsume, self()),</div><div><br></div><div>You need to consume from the queue whose name you stored in Q1.</div><div><br></div><div>HTH,</div><div><br></div><div>Ben</div></div></body></html>