Debugging

Spring AMQP 提供了大量的日志记录,尤其是在 DEBUG 级别的日志记录。

Spring AMQP provides extensive logging, especially at the DEBUG level.

如果希望监视应用程序和代理之间的 AMQP 协议,你可以使用一个 WireShark 等工具,其中有一个用于解码此协议的插件。或者 RabbitMQ Java 客户端带有称为 Tracer 的非常有用的类。当作为 main 运行时,默认情况下,它监听 5673 端口,并连接到本地主机上的 5672 端口。你可以运行它,并将你的连接工厂配置更改为连接到本地主机上的 5673 端口。它会在控制台上显示解码后的协议。有关更多详细信息,请参阅 Tracer Javadoc。

If you wish to monitor the AMQP protocol between the application and broker, you can use a tool such as WireShark, which has a plugin to decode the protocol. Alternatively, the RabbitMQ Java client comes with a very useful class called Tracer. When run as a main, by default, it listens on port 5673 and connects to port 5672 on localhost. You can run it and change your connection factory configuration to connect to port 5673 on localhost. It displays the decoded protocol on the console. Refer to the Tracer Javadoc for more information.