|
|
@@ -1,7 +1,9 @@
|
|
|
-package cn.reghao.tnb.message.app.rabbit;
|
|
|
+package cn.reghao.tnb.message.app.rabbit.listener;
|
|
|
|
|
|
import cn.reghao.jutil.jdk.serializer.JsonConverter;
|
|
|
import cn.reghao.tnb.message.api.dto.msg.BaseMessage;
|
|
|
+import cn.reghao.tnb.message.app.model.po.AccessLog;
|
|
|
+import cn.reghao.tnb.message.app.model.po.RuntimeLog;
|
|
|
import cn.reghao.tnb.message.app.service.MessageConsumer;
|
|
|
import cn.reghao.tnb.message.app.ws.WsConnection;
|
|
|
import cn.reghao.tnb.message.app.ws.msg.ChatPayload;
|
|
|
@@ -52,14 +54,6 @@ public class RabbitListeners {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*@RabbitListener(bindings =@QueueBinding(
|
|
|
- value = @Queue(value = "tnb.message.verify", durable = "true"),
|
|
|
- key = "tnb.account.message",
|
|
|
- exchange = @Exchange(value = "amq.direct"))
|
|
|
- )
|
|
|
- public void verifyMessageConsumer(@Payload String msg) {
|
|
|
- }*/
|
|
|
-
|
|
|
@RabbitListener(bindings =@QueueBinding(
|
|
|
value = @Queue(value = "tnb.message.account", durable = "true"),
|
|
|
key = "tnb.message.account",
|
|
|
@@ -77,4 +71,24 @@ public class RabbitListeners {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @RabbitListener(bindings =@QueueBinding(
|
|
|
+ value = @Queue(value = "tnb.log.access", durable = "true"),
|
|
|
+ key = "tnb.log.access",
|
|
|
+ exchange = @Exchange(value = "amq.direct"))
|
|
|
+ )
|
|
|
+ public void accessLogConsumer(@Payload String msg) {
|
|
|
+ AccessLog accessLog = JsonConverter.jsonToObject(msg, AccessLog.class);
|
|
|
+ log.info("{} -> {}", accessLog.getRequestId(), accessLog.getRequestUrl());
|
|
|
+ }
|
|
|
+
|
|
|
+ @RabbitListener(bindings =@QueueBinding(
|
|
|
+ value = @Queue(value = "tnb.log.runtime", durable = "true"),
|
|
|
+ key = "tnb.log.runtime",
|
|
|
+ exchange = @Exchange(value = "amq.direct"))
|
|
|
+ )
|
|
|
+ public void runtimeLogConsumer(@Payload String msg) {
|
|
|
+ RuntimeLog runtimeLog = JsonConverter.jsonToObject(msg, RuntimeLog.class);
|
|
|
+ log.info("{} -> {}:{}", runtimeLog.getApp(), runtimeLog.getApp(), runtimeLog.getHost());
|
|
|
+ }
|
|
|
}
|