优化Kafka认证方式,删除配置项通过连接端口判断
This commit is contained in:
@@ -41,7 +41,6 @@ public class OneSidedWindowFunction extends ProcessAllWindowFunction<String, Tup
|
||||
for (String input : inputs) {
|
||||
if (StringUtil.isNotBlank(input)) {
|
||||
JSONObject object = JSONObject.parseObject(input);
|
||||
|
||||
String commonSchemaType = object.getString(JsonProConfig.SCHEMA_TYPE);
|
||||
String sipCallId = object.getString(JsonProConfig.SIP_CALL_ID);
|
||||
|
||||
@@ -52,10 +51,14 @@ public class OneSidedWindowFunction extends ProcessAllWindowFunction<String, Tup
|
||||
* 针对SIP日志进行处理
|
||||
*/
|
||||
if (JsonProConfig.SIP_MARK.equals(commonSchemaType) && StringUtil.isNotBlank(sipCallId)) {
|
||||
if (commonStreamDir != JsonProConfig.DOUBLE) {
|
||||
putKeyAndMsg(input, sipCallId, sipOriHmList, "SIP", out);
|
||||
if (checkSipCompleteness(object)) {
|
||||
if (commonStreamDir != JsonProConfig.DOUBLE) {
|
||||
putKeyAndMsg(input, sipCallId, sipOriHmList, "SIP", out);
|
||||
} else {
|
||||
separateInnerIp(object, out);
|
||||
}
|
||||
} else {
|
||||
separateInnerIp(object, out);
|
||||
out.collect(new Tuple3<>("", "violation", input));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,4 +367,10 @@ public class OneSidedWindowFunction extends ProcessAllWindowFunction<String, Tup
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkSipCompleteness(JSONObject object) {
|
||||
return object.containsKey(JsonProConfig.SIP_ORIGINATOR_IP) &&
|
||||
object.containsKey(JsonProConfig.SIP_ORIGINATOR_PORT) &&
|
||||
object.containsKey(JsonProConfig.SIP_RESPONDER_IP) &&
|
||||
object.containsKey(JsonProConfig.SIP_RESPONDER_PORT);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user