?’? ???, ? ?? ? ???????? ??????? ???? ???????, ?????.
- ? ??????: ????? ??????????
- ? ????????: ?’? ????????? ???????? ?????? ???????, ????????, ??????????? ??????, ?????????? ??? ?? ??.
- ? ??? ?? ????? ??:??
- ? ?? ????: ?????://???????.????.????.???/
- ? ???????????? ??????:?? ?????

1 问题描述
咱就是说,消费过后的消息怎么看呢?于是我找到了Trace 这个插件,我们只要进入docker容器里面,或者你怎么部署的也行,找到了之后开启这个插件就行
1.1 命令启动trace插件
启动命令
rabbitmq-plugins enable rabbitmq_tracing
rabbitmqctl trace_on

1.2 查看日志文件
需要注意的是,windows上面有编解码问题,可能是乱码,最好还是去Linux里面把日志文件弄下来,或者直接在里面查看吧。记录一下日志路径:text类型是比较适合人看的,json类型是用过BASE64编码过的,所以看你的需求。
/var/tmp/rabbitmq-tracing
root@rabbitmq1:/var/tmp/rabbitmq-tracing# cat test.log ================================================================================2022-08-25T10:40:21.280+00:00: Message published
Node: rabbit@rabbitmq1
Connection: 192.168.2.35:64833 ->172.18.0.2:5672
Virtual host: /
User: rabbitmq
Channel: 2
Exchange: springOperLogExchange
Routing keys: [<<"springOperLog">>]
Routed queues: [<<"springOperLogQueue">>]
Properties: [{<<"priority">>,signedint,0},
{<<"delivery_mode">>,signedint,2},
{<<"headers">>,table,
[{<<"__TypeId__">>,longstr,
<<"com.ruoyi.system.api.domain.SysOperLog">>}]},
{<<"content_encoding">>,longstr,<<"UTF-8">>},
{<<"content_type">>,longstr,<<"application/json">>}]
Payload:
{"searchValue":null,"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"params":{},"operId":null,"title":"个人信息","businessType":2,"businessTypes":null,"method":"com.ruoyi.system.controller.SysProfileController.updatePwd()","requestMethod":"PUT","operatorType":1,"operName":"admin","deptName":null,"operUrl":"/user/profile/updatePwd","operIp":"127.0.0.1","operParam":"admin1234 admin123","jsonResult":"{\"msg\":\"操作成功\",\"code\":200}","status":0,"errorMsg":null,"operTime":null}================================================================================2022-08-25T10:40:21.280+00:00: Message received
Node: rabbit@rabbitmq1
Connection: 192.168.2.35:64833 ->172.18.0.2:5672
Virtual host: /
User: rabbitmq
Channel: 1
Exchange: springOperLogExchange
Routing keys: [<<"springOperLog">>]
Queue: springOperLogQueue
Properties: [{<<"priority">>,signedint,0},
{<<"delivery_mode">>,signedint,2},
{<<"headers">>,table,
[{<<"__TypeId__">>,longstr,
<<"com.ruoyi.system.api.domain.SysOperLog">>}]},
{<<"content_encoding">>,longstr,<<"UTF-8">>},
{<<"content_type">>,longstr,<<"application/json">>}]
Payload:
{"searchValue":null,"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"params":{},"operId":null,"title":"个人信息","businessType":2,"businessTypes":null,"method":"com.ruoyi.system.controller.SysProfileController.updatePwd()","requestMethod":"PUT","operatorType":1,"operName":"admin","deptName":null,"operUrl":"/user/profile/updatePwd","operIp":"127.0.0.1","operParam":"admin1234 admin123","jsonResult":"{\"msg\":\"操作成功\",\"code\":200}","status":0,"errorMsg":null,"operTime":null}
版权归原作者 河海哥yyds 所有, 如有侵权,请联系我们删除。