<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 &lt;<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> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;message_count = MessageCount,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;consumer_count = ConsumerCount}<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 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> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;&lt;"amq.q.gen1_rabbit@home_20080409224223_">>,0,0}<br> </blockquote> <br> <br></div> so that fact that Q, which was previously bound to &lt;&lt;"">> is being compared to &lt;"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.&nbsp; It helped me get over that problem.&nbsp; Now I have another issue with the consume code.<br><br>I tried looking into mnesia tables and ets tables, but not much help.&nbsp; Receive is timing out at after 2000 ->&nbsp; exit(did_not_receive_message) end.&nbsp; Only reason for to get timeout is when there isn't a message in the exchange.&nbsp; This shouldn't be the case because I just published the message.<br> <br>&nbsp;receive<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {#'basic.deliver'{delivery_tag = DeliveryTag}, Content} -><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #content{payload_fragments_rev = [Payload]} = Content,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; io:format("Message received: ~p~n", [Payload])<br> &nbsp;&nbsp;&nbsp; after 2000 -><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(did_not_receive_message)<br>&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; queue = Q,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; consumer_tag = &lt;&lt;"">>,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; no_local = false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; no_ack = true,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclusive = false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nowait = false},<br>&nbsp;&nbsp;&nbsp; #'basic.consume_ok'{consumer_tag = ConsumerTag}&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 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>