Просмотр исходного кода

update search-service RabbitListeners

reghao 4 месяцев назад
Родитель
Сommit
68c35002b8

+ 9 - 5
search/search-service/src/main/java/cn/reghao/tnb/search/app/log/consumer/RabbitListeners.java

@@ -35,11 +35,15 @@ public class RabbitListeners {
             exchange = @Exchange(value = "amq.direct"))
     )
     public void accessLogConsumer(@Payload String msg) {
-        GatewayLog gatewayLog = JsonConverter.jsonToObject(msg, GatewayLog.class);
-        logHandler.pushGatewayLog(gatewayLog);
-        //log.info("{} -> {}", gatewayLog.getRequestId(), gatewayLog.getRequestUrl());
-        AccessLog accessLog = new AccessLog(gatewayLog);
-        accessLogMongo.save(accessLog);
+        try {
+            GatewayLog gatewayLog = JsonConverter.jsonToObject(msg, GatewayLog.class);
+            logHandler.pushGatewayLog(gatewayLog);
+            //log.info("{} -> {}", gatewayLog.getRequestId(), gatewayLog.getRequestUrl());
+            AccessLog accessLog = new AccessLog(gatewayLog);
+            accessLogMongo.save(accessLog);
+        } catch (Exception e) {
+
+        }
     }
 
     @RabbitListener(bindings =@QueueBinding(