0

消息追踪之rabbitmq_tracing

 2 years ago
source link: https://blog.csdn.net/as140507/article/details/101104900
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

消息追踪之rabbitmq_tracing

rabbitmq_tracing

1、启动命令

rabbitmq-plugins disable rabbitmq_tracing

[root@i-rovnykap default]# ./sbin/rabbitmq-plugins enable rabbitmq_tracing
Plugin configuration unchanged.

Applying plugin configuration to rabbit@i-rovnykap... nothing to do.
2、停止命令

rabbitmq-plugins disable rabbitmq_tracing

[root@i-rovnykap default]# ./sbin/rabbitmq-plugins disable rabbitmq_tracing
The following plugins have been disabled:
rabbitmq_tracing

Applying plugin configuration to rabbit@i-rovnykap... stopped 1 plugin.

二、trace 配置

1、安装成功显示

Management插件-->Admin-->Trace

2、Add a new trace解释:
名字解释valusName创建trace名程 Format类型(显示类型 看这个喜好)TEXT/JSONMax payload bytes消息最大限制 Pattern拦截类型 publish.# (接入),deliver.#(接出) ,#.amq.directueue(指定交换机), #.myqueue(指定一个Queue)
3、添加Trace

在这里配置Currently running traces配置接入和接出,类型为text,Trace log files 日志文件 点击可查看

4、添加后rabbitmq变化

Exchanges 里多 amq.rabbitmq.log ,amq.rabbitmq.trace

queue里amq.gen-R60Ptq9muO4lFQ7S7e7WbQ ,amq.gen-j7cs4JpsM2Inhe5OWTTSqw

5、日志显示

trace1.log 接入消息记录

================================================================================
2018-12-20 10:47:50:346: Message published

Node:         rabbit@i-rovnykap
Connection:   172.16.255.6:60520 -> 10.6.4.156:5672
Virtual host: /
User:         guest
Channel:      1
Exchange:    
Routing keys: [<<"testHello">>]
Routed queues: [<<"testHello">>]
Properties:   [{<<"priority">>,signedint,0},
              {<<"delivery_mode">>,signedint,2},
              {<<"headers">>,table,[]},
              {<<"content_encoding">>,longstr,<<"UTF-8">>},
              {<<"content_type">>,longstr,<<"text/plain">>}]
Payload:
hello1 Thu Dec 20 10:47:46 CST 2018

================================================================================
2018-12-20 10:48:19:135: Message published

Node:         rabbit@i-rovnykap
Connection:   172.16.255.6:60573 -> 10.6.4.156:5672
Virtual host: /
User:         guest
Channel:      1
Exchange:    
Routing keys: [<<"testHello">>]
Routed queues: [<<"testHello">>]
Properties:   [{<<"priority">>,signedint,0},
              {<<"delivery_mode">>,signedint,2},
              {<<"headers">>,table,[]},
              {<<"content_encoding">>,longstr,<<"UTF-8">>},
              {<<"content_type">>,longstr,<<"text/plain">>}]
Payload:
hello1 Thu Dec 20 10:48:15 CST 2018

trace2.log 接出消息记录

================================================================================
2018-12-20 10:57:29:647: Message received

Node:         rabbit@i-rovnykap
Connection:   172.16.255.6:61360 -> 10.6.4.156:5672
Virtual host: /
User:         guest
Channel:      1
Exchange:    
Routing keys: [<<"testHello">>]
Queue:       testHello
Properties:   [{<<"priority">>,signedint,0},
              {<<"delivery_mode">>,signedint,2},
              {<<"headers">>,table,[]},
              {<<"content_encoding">>,longstr,<<"UTF-8">>},
              {<<"content_type">>,longstr,<<"text/plain">>}]
Payload:
hello1 Thu Dec 20 10:47:46 CST 2018
               {<<"headers">>,table,[]},
               {<<"content_encoding">>,longstr,<<"UTF-8">>},
               {<<"content_type">>,longstr,<<"text/plain">>}]
Payload: 
hello1 Thu Dec 20 10:47:46 CST 2018

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK