消息追踪之rabbitmq_tracing

消息追踪之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解释:

 

名字解释valus
Name 创建trace名程  
Format 类型(显示类型 看这个喜好) TEXT/JSON
Max 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
posted @ 2018-12-20 14:31  可_乐  阅读(2391)  评论(1编辑  收藏  举报