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><br>3> amqp_async:amqp_lifecycle().<br>Connection: {<0.37.0>,network}<br>ok<br>4> amqp_async_consume:amqp_lifecycle_consume().<br>Connection: {<0.47.0>,network}<br>
Have a look into this one: closed<br>** exception exit: {{amqp_async_consume,amqp_lifecycle_consume,0},<br> {line,80},<br> did_not_receive_message}<br> in function amqp_async_consume:amqp_lifecycle_consume/0<br>
5> <br><br><br>Also, I captured the packet with Wireshark and getting [Unreassembled Packet [incorrect TCP checksum]] and [Dissector bug, protocol AMQP: packet-amqp.c:1252. My guess is that rabbitmq is communicating with amqp-0.8 protocol and Wireshark trying to make sense out of those packets using amqp-0.9 protocol.<br>
<br>Wireshark amqp pub/sub output:<br><br>228 2008-04-10 22:50:59.646435000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [SYN, ACK] Seq=0 Ack=1 Win=6144 Len=0 MSS=16396 TSV=922137 TSER=922137 WS=6<br>
229 2008-04-10 22:50:59.646478000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 37251 > amqp [ACK] Seq=1 Ack=1 Win=32832 Len=0 TSV=922137 TSER=922137<br>230 2008-04-10 22:50:59.648524000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Protocol-Header <br>
231 2008-04-10 22:50:59.648557000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [ACK] Seq=1 Ack=9 Win=6080 Len=0 TSV=922140 TSER=922140<br>232 2008-04-10 22:50:59.760571000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Start <br>
233 2008-04-10 22:50:59.760615000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 37251 > amqp [ACK] Seq=9 Ack=297 Win=33920 Len=0 TSV=922252 TSER=922252<br>234 2008-04-10 22:50:59.777853000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Start-Ok <br>
235 2008-04-10 22:50:59.777891000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [ACK] Seq=297 Ack=139 Win=5952 Len=0 TSV=922269 TSER=922269<br>236 2008-04-10 22:50:59.782283000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Tune <br>
237 2008-04-10 22:50:59.782427000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Tune-Ok <br>238 2008-04-10 22:50:59.821494000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [ACK] Seq=317 Ack=159 Win=6144 Len=0 TSV=922313 TSER=922273<br>
239 2008-04-10 22:50:59.821532000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Open <br>240 2008-04-10 22:50:59.821704000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [ACK] Seq=317 Ack=175 Win=6144 Len=0 TSV=922313 TSER=922313<br>
241 2008-04-10 22:50:59.846424000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Open-Ok <br>242 2008-04-10 22:50:59.870959000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Channel.Open <br>
243 2008-04-10 22:50:59.877764000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP [Unreassembled Packet [incorrect TCP checksum]] <br>244 2008-04-10 22:50:59.878032000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Access.Request <br>
245 2008-04-10 22:50:59.880196000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Access.Request-Ok <br>246 2008-04-10 22:50:59.880396000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Exchange.Declare <br>
247 2008-04-10 22:50:59.881167000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Exchange.Declare-Ok <br>248 2008-04-10 22:50:59.881430000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Basic.Publish Content-Header Content-Body <br>
249 2008-04-10 22:50:59.920486000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [ACK] Seq=378 Ack=322 Win=6144 Len=0 TSV=922412 TSER=922372<br>250 2008-04-10 22:50:59.920515000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Channel.Close <br>
251 2008-04-10 22:50:59.920637000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [ACK] Seq=378 Ack=348 Win=6144 Len=0 TSV=922412 TSER=922412<br>252 2008-04-10 22:50:59.921226000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Channel.Close-Ok <br>
253 2008-04-10 22:50:59.921528000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP [Dissector bug, protocol AMQP: packet-amqp.c:1252: failed assertion "(0)"]<br>
254 2008-04-10 22:50:59.921733000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP [Dissector bug, protocol AMQP: packet-amqp.c:1252: failed assertion "(0)"]<br>
255 2008-04-10 22:50:59.921917000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 37251 > amqp [FIN, ACK] Seq=374 Ack=402 Win=33920 Len=0 TSV=922413 TSER=922413<br>256 2008-04-10 22:50:59.922030000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 37251 [FIN, ACK] Seq=402 Ack=375 Win=6144 Len=0 TSV=922413 TSER=922413<br>
257 2008-04-10 22:50:59.922055000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 37251 > amqp [ACK] Seq=375 Ack=403 Win=33920 Len=0 TSV=922413 TSER=922413<br>258 2008-04-10 22:51:09.766385000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 48524 > 48428 [PSH, ACK] Seq=249 Ack=249 Win=4096 [TCP CHECKSUM INCORRECT] Len=4 TSV=932257 TSER=917257<br>
259 2008-04-10 22:51:09.766603000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 48428 > 48524 [PSH, ACK] Seq=249 Ack=253 Win=513 [TCP CHECKSUM INCORRECT] Len=4 TSV=932258 TSER=932257<br>
260 2008-04-10 22:51:09.766641000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 48524 > 48428 [ACK] Seq=253 Ack=253 Win=4095 Len=0 TSV=932258 TSER=932258<br>261 2008-04-10 22:51:14.617207000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 33647 > amqp [SYN] Seq=0 Win=32792 Len=0 MSS=16396 TSV=937108 TSER=0 WS=6<br>
262 2008-04-10 22:51:14.617251000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 33647 [SYN, ACK] Seq=0 Ack=1 Win=6144 Len=0 MSS=16396 TSV=937108 TSER=937108 WS=6<br>
263 2008-04-10 22:51:14.617287000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 33647 > amqp [ACK] Seq=1 Ack=1 Win=32832 Len=0 TSV=937108 TSER=937108<br>264 2008-04-10 22:51:14.617405000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Protocol-Header <br>
265 2008-04-10 22:51:14.617426000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 33647 [ACK] Seq=1 Ack=9 Win=6080 Len=0 TSV=937108 TSER=937108<br>266 2008-04-10 22:51:14.618507000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Start <br>
267 2008-04-10 22:51:14.618540000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 33647 > amqp [ACK] Seq=9 Ack=297 Win=33920 Len=0 TSV=937110 TSER=937110<br>268 2008-04-10 22:51:14.618730000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Start-Ok <br>
269 2008-04-10 22:51:14.618910000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Tune <br>270 2008-04-10 22:51:14.619114000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Tune-Ok <br>
271 2008-04-10 22:51:14.658486000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 33647 [ACK] Seq=317 Ack=159 Win=6144 Len=0 TSV=937150 TSER=937110<br>272 2008-04-10 22:51:14.658513000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Open <br>
273 2008-04-10 22:51:14.658533000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 33647 [ACK] Seq=317 Ack=175 Win=6080 Len=0 TSV=937150 TSER=937150<br>274 2008-04-10 22:51:14.659453000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Connection.Open-Ok <br>
275 2008-04-10 22:51:14.660066000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Channel.Open <br>276 2008-04-10 22:51:14.660332000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP [Unreassembled Packet [incorrect TCP checksum]] <br>
277 2008-04-10 22:51:14.660548000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Access.Request <br>278 2008-04-10 22:51:14.661351000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Access.Request-Ok <br>
279 2008-04-10 22:51:14.661573000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Queue.Declare <br>280 2008-04-10 22:51:14.686647000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Queue.Declare-Ok <br>
281 2008-04-10 22:51:14.686925000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Queue.Bind <br>282 2008-04-10 22:51:14.687699000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Queue.Bind-Ok <br>
283 2008-04-10 22:51:14.687920000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP [Unreassembled Packet [incorrect TCP checksum]] <br>284 2008-04-10 22:51:14.688307000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> AMQP Basic.Consume-Ok <br>
285 2008-04-10 22:51:14.727486000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 33647 > amqp [ACK] Seq=352 Ack=489 Win=33920 Len=0 TSV=937219 TSER=937179<br>286 2008-04-10 22:51:16.689197000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP 33647 > amqp [FIN, ACK] Seq=352 Ack=489 Win=33920 Len=0 TSV=939180 TSER=937179<br>
287 2008-04-10 22:51:16.690130000 <a href="http://127.0.0.1">127.0.0.1</a> <a href="http://127.0.0.1">127.0.0.1</a> TCP amqp > 33647 [FIN, ACK] Seq=489 Ack=353 Win=6144 Len=0 TSV=939181 TSER=939180<br><br>
Thank you all, it's been a long day for me.<br>Joe<br></div></div>