Trace log is really helpful. Used it for a first time and now have more questions then before. :)
Testing scenario: 1 primary queue with 1 XML message inside ready for delivery. Consumer should read the message and send it to delay queue with timeout = 20 sec. Sending happens on the separate channel. Here is the trace log:
Result: Sending happens, original message is not deleted, 1 clone to original queue has being added. Particularly it is not clear for me -- where did message with delivery-tag=2 come from !!???
Question number 2: When successful delivery happens I got #method<basic.ack> BEFORE #method<basic.deliver> . It is not logical -- I should first get the message and then send ACK isn't it ?
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1411629100306: <Tracer-0> ch#0 <- {#method<connection.start>(version-major=0, version-minor=9, server-properties={product=RabbitMQ, information=Licensed under the MPL. See
http://www.rabbitmq.com/, platform=Erlang/OTP,capabilities={exchange_exchange_bindings=true, consumer_cancel_notify=true, basic.nack=true, publisher_confirms=true}, copyright=Copyright (C) 2007-2012 VMware, Inc., version=3.0.1}, mechanisms=PLAIN AMQPLAIN, locales=en_US), null, ""}
1411629100318: <Tracer-0> ch#0 -> {#method<connection.start-ok>(client-properties={product=RabbitMQ, information=Licensed under the MPL. See
http://www.rabbitmq.com/, platform=Java,capabilities={exchange_exchange_bindings=true, authentication_failure_close=true, publisher_confirms=true, basic.nack=true, consumer_cancel_notify=true, connection.blocked=true}, copyright=Copyright (C) 2007-2014 GoPivotal, Inc., version=3.3.5}, mechanism=PLAIN, response= guest guest, locale=en_US), null, ""}
1411629100361: <Tracer-0> ch#0 <- {#method<connection.tune>(channel-max=0, frame-max=131072, heartbeat=600), null, ""}
1411629100371: <Tracer-0> ch#0 -> {#method<connection.tune-ok>(channel-max=0, frame-max=131072, heartbeat=30), null, ""}
1411629100372: <Tracer-0> ch#0 -> {#method<connection.open>(virtual-host=/, capabilities=, insist=false), null, ""}
1411629100414: <Tracer-0> ch#0 <- {#method<connection.open-ok>(known-hosts=), null, ""}
1411629100433: <Tracer-0> ch#1 -> {#method<channel.open>(out-of-band=), null, ""}
1411629100474: <Tracer-0> ch#1 <- {#method<channel.open-ok>(channel-id=), null,""}
1411629100484: <Tracer-0> ch#1 -> {#method<exchange.declare>(ticket=0, exchange=anto_topic_exchange, type=topic, passive=false, durable=false, auto-delete=false, internal=false, nowait=false, arguments={}), null, ""}
1411629100526: <Tracer-0> ch#1 <- {#method<exchange.declare-ok>(), null, ""}
1411629100533: <Tracer-0> ch#1 -> {#method<queue.declare>(ticket=0, queue=anto_kmdb, passive=false, durable=true, exclusive=false, auto-delete=false, nowait=false, arguments={}), null, ""}
1411629100574: <Tracer-0> ch#1 <- {#method<queue.declare-ok>(queue=anto_kmdb, message-count=1, consumer-count=0), null, ""}
1411629100580: <Tracer-0> ch#1 -> {#method<queue.bind>(ticket=0, queue=anto_kmdb, exchange=anto_topic_exchange, routing-key=elion.portconf.kmdb.anto, nowait=false, arguments={}), null, ""}
1411629100623: <Tracer-0> ch#1 <- {#method<queue.bind-ok>(), null, ""}
1411629100646: <Tracer-0> ch#1 -> {#method<basic.consume>(ticket=0, queue=anto_kmdb, consumer-tag=, no-local=false, no-ack=false, exclusive=false, nowait=false, arguments={}), null, ""}
1411629100691: <Tracer-0> ch#1 <- {#method<basic.consume-ok>(consumer-tag=amq.ctag-5PHZ3IFIXx7vEpqqVo2whA), null, ""}
1411629100700: <Tracer-0> ch#1 <- {#method<basic.deliver>(consumer-tag=amq.ctag-5PHZ3IFIXx7vEpqqVo2whA, delivery-tag=1, redelivered=false, exchange=anto_topic_exchange, routing-key=elion.portconf.kmdb.anto), #contentHeader<basic>(content-type=application/octet-stream, content-encoding=null, headers=null, delivery-mode=2, priority=0, correlation-id=null, reply-to=null, expiration=null, message-id=n
ull, timestamp=null, type=null, user-id=null, app-id=null, cluster-id=null), "<?xml version="1.0"?>
<ORDER_ANSWER>
<ID>22059</ID>
<ANSWER_STATUS>FAIL</ANSWER_STATUS>
<ANSWER_MSG>Timeout</ANSWER_MSG>
<ACTION>CONFIGURE</ACTION>
<P_NR>P01133291</P_NR>
<ANSWER_DATE>14.07.2014 12:22</ANSWER_DATE>
</ORDER_ANSWER>
"}
1411629100902: <Tracer-0> ch#2 -> {#method<channel.open>(out-of-band=), null, ""}
1411629100945: <Tracer-0> ch#2 <- {#method<channel.open-ok>(channel-id=), null,""}
1411629100946: <Tracer-0> ch#2 -> {#method<queue.declare>(ticket=0, queue=anto_kmdb_delayed, passive=false, durable=true, exclusive=false, auto-delete=false, nowait=false, arguments={x-message-ttl=20000, x-dead-letter-exchange=anto_topic_exchange, x-dead-letter-routing-key=elion.portconf.kmdb.anto}), null, ""}
1411629100990: <Tracer-0> ch#2 <- {#method<queue.declare-ok>(queue=anto_kmdb_delayed, message-count=0, consumer-count=0), null, ""}
1411629100998: <Tracer-0> ch#2 -> {#method<basic.publish>(ticket=0, exchange=anto_topic_exchange, routing-key=elion.portconf.kmdb.anto.delay, mandatory=false, immediate=false),#contentHeader<basic>(content-type=application/octet-stream, content-encoding=null, headers=null, delivery-mode=2, priority=0, correlation-id=null, reply-to=null, expiration=null, message-id=null, timestamp=null, type=null, user-id=null, app-id=null, cluster-id=null), "<?xml version="1.0"?>
<ORDER_ANSWER>
<ID>22059</ID>
<ANSWER_STATUS>FAIL</ANSWER_STATUS>
<ANSWER_MSG>Timeout</ANSWER_MSG>
<ACTION>CONFIGURE</ACTION>
<P_NR>P01133291</P_NR>
<ANSWER_DATE>14.07.2014 12:22</ANSWER_DATE>
</ORDER_ANSWER>
"}
1411629101001: <Tracer-0> ch#2 -> {#method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0), null, ""}
1411629101040: <Tracer-0> ch#1 <- {#method<basic.deliver>(consumer-tag=amq.ctag-5PHZ3IFIXx7vEpqqVo2whA, delivery-tag=2, redelivered=false, exchange=anto_topic_exchange, routing-key=elion.portconf.kmdb.anto.delay), #contentHeader<basic>(content-type=application/octet-stream, content-encoding=null, headers=null, delivery-mode=2, priority=0, correlation-id=null, reply-to=null, expiration=null, message-id=null, timestamp=null, type=null, user-id=null, app-id=null, cluster-id=null), "<?xml version="1.0"?>
<ORDER_ANSWER>
<ID>22059</ID>
<ANSWER_STATUS>FAIL</ANSWER_STATUS>
<ANSWER_MSG>Timeout</ANSWER_MSG>
<ACTION>CONFIGURE</ACTION>
<P_NR>P01133291</P_NR>
<ANSWER_DATE>14.07.2014 12:22</ANSWER_DATE>
</ORDER_ANSWER>
"}
1411629101041: <Tracer-0> ch#2 <- {#method<channel.close-ok>(), null, ""}
1411629101045: <Tracer-0> ch#1 -> {#method<basic.ack>(delivery-tag=1, multiple=false), null, ""}