📜 ⬆️ ⬇️

AMQP - Debugging Applications

Development of complex messaging systems using the AMQP protocol has not only to debug the code, but also to understand the structure and routing of messages.
Sometimes it is difficult to understand the reason for this or that hang or lack of communication. However, the RabbitMQ developers included in the rabbitmq-java-client package is the Tracer class,
which allows the console to view information about the exchange.



Tracer is an AMQP proxy that listens to the client port (5673 default) and sends them to the server (5672 default) and back, displaying information on the console.
')
Installation
in three steps:

We work

//
java -cp rabbitmq-client.jar:commons-io-1.2.jar:commons-cli-1.1.jar com.rabbitmq.tools.Tracer
//
runjava.sh com.rabbitmq.tools.Tracer listenPort connectHost connectPort listenPort
- port AMQP ( default 5673)
- connectHost - host RabbitMQ ( default localhost).
- connectPort - , ( default 5672).

further we look:
$cnn = new APMQConection();
1257461452674: conn#74 ch#0 <- {#method<connection.start>(version-major=8,version-minor=0,server properties={product=RabbitMQ, platform=Erlang/OTP, information=Licensed under the MPL. See www.rabbitmq.com, copyright=Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd., version=1.5.4},mechanisms=PLAIN AMQPLAIN,locales=en_US),null,""}
1257461452681: conn#74 ch#0 -> {#method<connection.start-ok>(client-properties={},mechanism=PLAIN,response=guestguest,locale=en_US),null,""}
1257461452682: conn#74 ch#0 <- {#method<connection.tune>(channel-max=0,frame-max=131072,heartbeat=0),null,""}
1257461452682: conn#74 ch#0 -> {#method<connection.tune-ok>(channel-max=0,frame-max=131072,heartbeat=0),null,""}
1257461452683: conn#74 ch#0 -> {#method<connection.open>(virtual-host=/,capabilities=,insist=true),null,""}
1257461452684: conn#74 ch#0 <- {#method<connection.open-ok>(known-hosts=akalend.local:5672),null,""}
1257461452684: conn#74 ch#1 -> {#method<channel.open>(out-of-band=),null,""}
1257461452684: conn#74 ch#1 <- {#method<channel.open-ok>(),null,""}

Source: https://habr.com/ru/post/74609/


All Articles