My process is sending acks to RabbitMQ and they aren't getting recognized. How do I configure RabbitMQ to log every ack it receives?
$ cat /etc/rabbitmq/rabbitmq.conf
log.file.level = debug
log.connection.level = debug
log.channel.level = debug
The RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
The tracing plugin may show the information you need. Otherwise, use Wireshark to examine the TCP packets. The AMQP protocol analyzer makes it easy to see the flow of messages.
You may not be including the correct delivery tag in your ack, just a thought - https://www.rabbitmq.com/confirms.html#consumer-acknowledgements
Related
I'm new to RabbitMQ,
just went over the documentation but didn't find any mechanism on checking message integrity. Message consumption acknowledgment only checks delivered or not but what if the message payload is contaminated. Or is it supported by AMQP protocol?
Thanks in advance!
RabbitMQ does not modify the message contents, nor does it perform integrity checks. It would be up to the publishing and consuming applications to do this. I suggest computing a checksum and adding it as a message header.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
As a AmqpReceiver, what's the difference among the different DeliveryStates for a received message.
Runing a ReceiverTest for test, see https://github.com/vert-x3/vertx-amqp-client/blob/master/src/test/java/io/vertx/amqp/ReceiverTest.java.
It always got the same result when running testReceptionWithAcceptedMessages, testReceptionWithRejectedMessages: All the messages in the test queue are deleted.
Is it right that the message is still deleted from the MQ server when it is marked as rejected or released? Where can I find more docs about this?
Can Vert.x AMQP Client do the same things as the RabbitMQ client when consuming a queue? For example, positive or negative acknowledgements, multi-acks and requeueing etc. See https://www.rabbitmq.com/confirms.html#basics.
Thanks.
In those tests the client is Accepting and Rejecting the messages from the ActiveMQ Artemis broker. The broker will either discard the message when accepted, or DLQ the message when rejected under the configuration in the tests. You can configure the broker differently in your own case but for the sake of the tests it isn't relevant. What the broker you are talking to does when you Accept, Release, Rejected or Modify a delivery via a set disposition is going to vary depending on the broker you use and its configuration.
You can refer to section 3.3 and section 3.4 of the AMQP 1.0 specification for a definition of how delivery state affect deliveries being available, acquired or archived.
I came across an interesting subject when reading the book "RabbitMQ in Action" by Manning. Apparently it's possible to set up consumers to be able to receive all RabbitMQ logging in real time in the consumer.
I read that RabbitMQ publishes logging to an exchange of type topic called amq.rabbitmq.log. Consumers can listen to specific severity levels, for example it can be filtered by setting the routing key to error, warning or info.
My question is; I installed a default RabbitMQ server on my PC, but I couldn't find any exchange called amq.rabbitmq.log. Only one which could be related is amq.rabbitmq.trace, but this one is used for events (events like queue.deleted, queue.created, ...), in other words that one is not what I'm looking for.
Can anyone bring clarification to my questions? Why is the amq.rabbitmq.log exchange not available on a clean RabbitMQ server installation?
citation:
Perhaps when you were listing exchanges using rabbitmqctl you spotted
an exchange called amq.rabbitmq.log whose type is topic. RabbitMQ will
publish its logs to that exchange using the severity level as a
routing key - you'll get error, warning and info. Based on what you
learned from the previous chapters you can create a consumer to
listen to those logs and react accordingly.
You have to enable it. Create the /etc/rabbitmq/rabbitmq.conf file and ensure that this line is present in it:
log.exchange = true
I just grepped the source for the rabbitmq.com website and don't see that setting documented anywhere. If you'd like, file a new issue in that repository and I'll fix it, or open your own PR to do so.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
It is a bit late, but hope it help someone. So far it works for me. The exchange "amq.rabbitmq.log" will be created automatically by the rabbitmq broker itself. The RabbitMQ broker version that I am using is: 3.8.1
add
log.exchange = true
into your rabbitmq.conf file and restart your rabbitmq service.
You will need to restart your rabbitmq service everytime you had updated the rabbitmq.conf file.
open cmd and enter the following in windows:
rabbitmq-service stop
rabbitmq-service install
rabbitmq-service start
rabbitmqctl start_app
I read the official document of Rabbitmq, it is not really clear for me what was that?
its something like Consumer Ack but with a difference that the Publisher Confirm is send by rabbitmq server to Publisher client when the server get the message from publisher client?
Can someone explain more about it?
thanks in advance.
its something like Consumer Ack but with a difference that the
Publisher Confirm is send by rabbitmq server to Publisher client when
the server get the message from publisher client?
Yes. When you enable publisher confirms, and your publisher receives acknowledgement that the message is published, you can be certain of it.
Without publisher confirms, you can lose messages in several cases. One example: your application could publish the data to the TCP buffer, but then crash, or the server itself could crash. Another example: a network device could fail mid-delivery. Another example: RabbitMQ itself could crash after receiving the TCP data containing your message.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.
We have observed the following behavior of RabbitMQ and are trying to understand if it is correct and how to resolve it.
Scenario:
A (persistent) message is delivered into a durable queue
The (single) Consumer (Spring-AMQP) takes the message and starts processing => Message goes from READY to UNACK
Now the broker is shut down => Client correctly reports "Channel shutdown"
The consumer finishes the processing, but can not acknowledge the message as the broker is still down
Broker is started again => Client reconnects
As a result, one message remains unack'ed forever (or until the client is restarted).
Side note: In the Rabbit Admin UI, I can see that two channels are existing now. The "dead" one that was created before the broker restart, containing the unacked message and a new one that is healthy.
Is this behavior expected to be like that? It seems to me "correct" in the way, that RabbitMQ can not know after the broker restart, whether the message processing was completed or not. But what solution would exist than to get that unacked message back into the queue and to heal the system without restarting the consumer process?
The RabbitMQ team monitors this mailing list and only sometimes answers questions on StackOverflow.
Is this behavior expected to be like that? It seems to me "correct" in the way, that RabbitMQ can not know after the broker restart, whether the message processing was completed or not.
Yes, you are observing expected behavior. RabbitMQ will re-enqueue the message once it determines that the consumer is really dead. Since your consumer re-connects with what must be the same consumer tag as before, it is up to that process to ack or nack the message.