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

转载于:https://www.cnblogs.com/Harriet/p/10149144.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值