From bebc16d1b7f07b5aa024173587de35c3f8b3674c Mon Sep 17 00:00:00 2001 From: Carol <947752894@qq.com> Date: Thu, 30 Sep 2021 11:10:12 +0800 Subject: [PATCH] KafkaUtil MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增方法 --- .idea/checkstyle-idea.xml | 16 ++++ .idea/runConfigurations.xml | 10 +++ .../14399913ca07717830f9b08ee87644884fc2959a | 3 + .../1759e0760a24aae1fd0b2b5d7d8622112c621b0e | 48 +++++++++++ .../1c4b500508bae883bea47d0637c267e8c57d7580 | 3 + .../21fd7f9a07ee140f9ce9ae11bbe161bdd456cbc8 | 21 +++++ .../490c965ee8a02ce158895987485283bb4b666ab6 | 22 ++--- .../4ffd3a6de814df96de78c74e6c16f964b4fe9a03 | 86 +++++++++++++++++++ .../644b718a1d63acca44c411c399624e16ce98e11c | 29 +++++++ .../6b5bb34dca0a1a09968bad0dc5ab4ad5434df80e | 11 +++ .../74438aca9f4a48488fe204b00a7429cabb247abb | 0 .../82864735cd8af377e6ad061ae189505a1e3e9d7c} | 0 .../899c5b5653c6a42950622470eb34ab3cd5851009 | 8 ++ .../a43b6e3feeba3336586237a758acfa97b791be5b | 29 +++++++ .../df021943680d67b4f49e98599f4bb0e86803c590 | 77 ++++++++++++++++- .../e00232faab93cb27b9940f780c75123903d70b1c | 61 +++++++++++++ .../e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5 | 21 +++++ .../eaa75651d9d6785c2bd75843529d61a722450af5} | 0 .../fdadf7a612307c5bb8e90739949b439a1891d886 | 5 ++ .idea/sonarlint/issuestore/index.pb | 54 ++++++------ .idea/workspace.xml | 70 ++++++++++++--- pom.xml | 2 +- .../cnkj/common/utils/data/KafkaUtil.java | 59 +++++++++++++ .../site/cnkj/common/utils/date/DateUtil.java | 76 ++++++++++------ .../common/utils/system/GracefulShutdown.java | 22 ++--- 25 files changed, 645 insertions(+), 88 deletions(-) create mode 100644 .idea/checkstyle-idea.xml create mode 100644 .idea/runConfigurations.xml delete mode 100644 .idea/sonarlint/issuestore/7/4/74438aca9f4a48488fe204b00a7429cabb247abb rename .idea/sonarlint/issuestore/{1/1/1195786afcb95315b3ec156ea91e7166c2c2cf10 => 8/2/82864735cd8af377e6ad061ae189505a1e3e9d7c} (100%) rename .idea/sonarlint/issuestore/{1/5/157e0e9285b69e300624f35e79300c0ed6098936 => e/a/eaa75651d9d6785c2bd75843529d61a722450af5} (100%) diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..2f2c3c1 --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..797acea --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/1/4/14399913ca07717830f9b08ee87644884fc2959a b/.idea/sonarlint/issuestore/1/4/14399913ca07717830f9b08ee87644884fc2959a index e69de29..0493b2e 100644 --- a/.idea/sonarlint/issuestore/1/4/14399913ca07717830f9b08ee87644884fc2959a +++ b/.idea/sonarlint/issuestore/1/4/14399913ca07717830f9b08ee87644884fc2959a @@ -0,0 +1,3 @@ + +\ +java:S1118":Add a private constructor to hide the implicit public one.(ʁ8/ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/1/7/1759e0760a24aae1fd0b2b5d7d8622112c621b0e b/.idea/sonarlint/issuestore/1/7/1759e0760a24aae1fd0b2b5d7d8622112c621b0e index e69de29..64dd7db 100644 --- a/.idea/sonarlint/issuestore/1/7/1759e0760a24aae1fd0b2b5d7d8622112c621b0e +++ b/.idea/sonarlint/issuestore/1/7/1759e0760a24aae1fd0b2b5d7d8622112c621b0e @@ -0,0 +1,48 @@ + +b java:S1128"FDefine and throw a dedicated exception instead of using a generic one.(ʉ8ᆋ/ +c java:S112"FDefine and throw a dedicated exception instead of using a generic one.(8↋/ +L +java:S3740"/Provide the parametrized type for this generic.(8↋/ +L +java:S3740"/Provide the parametrized type for this generic.(8ㆋ/ +L +java:S3740>"/Provide the parametrized type for this generic.(8ㆋ/ +L +java:S3740>"/Provide the parametrized type for this generic.(8ㆋ/ +L +java:S3740Y"/Provide the parametrized type for this generic.(8ㆋ/ +L +java:S3740\"/Provide the parametrized type for this generic.(8ㆋ/ +L +java:S3740w"/Provide the parametrized type for this generic.(8ㆋ/ +R +java:S3740"/Provide the parametrized type for this generic.(8䆋/ +M +java:S3740"/Provide the parametrized type for this generic.(8䆋/ +M +java:S3740"/Provide the parametrized type for this generic.(8䆋/ +R +java:S3740"/Provide the parametrized type for this generic.(8䆋/ +\ +java:S1118":Add a private constructor to hide the implicit public one.(8醋/ +o +java:S3776"RRefactor this method to reduce its Cognitive Complexity from 30 to the 15 allowed.(8ꆋ/ +Q +java:S2864"4Iterate over the "entrySet" instead of the "keySet".(8ɇ/ +o +java:S37768"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(ʉ8臋/ + +java:S11308"lRemove the declaration of thrown exception 'java.lang.Exception', as it cannot be thrown from method's body.(ʉ8釋/ +e +java:S53619"HReplace this call to "replaceAll()" by a call to the "replace()" method.(DŽ8/ +V +java:S2864:"4Iterate over the "entrySet" instead of the "keySet".(Ĩ8/ +j +java:S5361A"HReplace this call to "replaceAll()" by a call to the "replace()" method.(8/ +j +java:S5361K"HReplace this call to "replaceAll()" by a call to the "replace()" method.(ҩ8ň/ +] java:S125a" +java:S1643*"Use a StringBuilder instead.(8/ +> +java:S1643,"Use a StringBuilder instead.(͒8/ +S +java:S1153*"1Directly append the argument of String.valueOf().(8/ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/d/f/df021943680d67b4f49e98599f4bb0e86803c590 b/.idea/sonarlint/issuestore/d/f/df021943680d67b4f49e98599f4bb0e86803c590 index a191a95..0301b27 100644 --- a/.idea/sonarlint/issuestore/d/f/df021943680d67b4f49e98599f4bb0e86803c590 +++ b/.idea/sonarlint/issuestore/d/f/df021943680d67b4f49e98599f4bb0e86803c590 @@ -1,2 +1,77 @@ - squid:S1697"~Either reverse the equality operator in the "propertiesPathPrefix" null test, or reverse the logical operator that follows it.(̚8ۅ. \ No newline at end of file +c java:S112"FDefine and throw a dedicated exception instead of using a generic one.(8/ +h java:S112"FDefine and throw a dedicated exception instead of using a generic one.(8/ +Q +java:S3740q"/Provide the parametrized type for this generic.(޷8/ +Q +java:S3740r"/Provide the parametrized type for this generic.(٬8/ +Q +java:S3740r"/Provide the parametrized type for this generic.(٬8/ +M +java:S3740"/Provide the parametrized type for this generic.(8/ +\ +java:S1118":Add a private constructor to hide the implicit public one.(۟8/ +[ +java:S4719;"9Replace charset name argument with StandardCharsets.UTF_8(8/ +V +java:S4719J"9Replace charset name argument with StandardCharsets.UTF_8(8/ +B +java:S2129s" Remove this "String" constructor(8/ +h +java:S3252"EUse static access with "com.alibaba.fastjson.JSON" for "parseObject".(8/ +O +java:S1602",Remove useless curly braces around statement(8/ +u +java:S3776"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(8/ +X +java:S1133"5Do not forget to remove this deprecated code someday.(8/ +K +java:S1123"(Add the missing @deprecated Javadoc tag.(8/ +C +java:S2129" Remove this "String" constructor(Ŷ8/ +C +java:S2129" Remove this "String" constructor(8/ +\ +java:S4719"9Replace charset name argument with StandardCharsets.UTF_8(8/ +[ java:S106"9Replace this use of System.out or System.err by a logger.(񗸽8/ +I +java:S1075"&Remove this hard-coded path-delimiter.(8/ +u +java:S3776"RRefactor this method to reduce its Cognitive Complexity from 49 to the 15 allowed.(8/ +X +java:S1133"5Do not forget to remove this deprecated code someday.(8/ +K +java:S1123"(Add the missing @deprecated Javadoc tag.(8/ +\ +java:S4719"9Replace charset name argument with StandardCharsets.UTF_8(諅8/ +\ +java:S4719"9Replace charset name argument with StandardCharsets.UTF_8(8/ +W +java:S4719"9Replace charset name argument with StandardCharsets.UTF_8(8/ +W +java:S4719"9Replace charset name argument with StandardCharsets.UTF_8(¶8/ +d java:S899"BDo something with the "boolean" value returned by "createNewFile".(А8؏/ +o +java:S1192"LDefine a constant instead of duplicating this literal ".properties" 4 times.(ٰ8㏁/ +h +java:S1192;"FDefine a constant instead of duplicating this literal "UTF-8" 7 times.(8䏁/ +u +java:S1192"WDefine a constant instead of duplicating this literal "spring.profiles.active" 5 times.(8䏁/ +u +java:S1192"WDefine a constant instead of duplicating this literal "application.properties" 3 times.(ۘ8䏁/ +s java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8珁/ +s java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8珁/ +` +java:S1155H">Use isEmpty() to check whether the collection is empty or not.(Ȅ8珁/ +\ +java:S4973"9Use the "equals" method if value comparison was intended.(ٰ8/ +k +java:S2095w"NUse try-with-resources or close this "LineNumberReader" in a "finally" clause.(8/ +k +java:S2095e"NUse try-with-resources or close this "LineNumberReader" in a "finally" clause.(8/ +e +java:S2095d"HUse try-with-resources or close this "FileReader" in a "finally" clause.(8/ +e +java:S2095v"HUse try-with-resources or close this "FileReader" in a "finally" clause.(8/ +V +java:S2589"8Remove this expression which always evaluates to "false"(8/ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/e/0/e00232faab93cb27b9940f780c75123903d70b1c b/.idea/sonarlint/issuestore/e/0/e00232faab93cb27b9940f780c75123903d70b1c index e69de29..d0d71f4 100644 --- a/.idea/sonarlint/issuestore/e/0/e00232faab93cb27b9940f780c75123903d70b1c +++ b/.idea/sonarlint/issuestore/e/0/e00232faab93cb27b9940f780c75123903d70b1c @@ -0,0 +1,61 @@ + +R +java:S3740"/Provide the parametrized type for this generic.(˴8ـ/ +M +java:S3740"/Provide the parametrized type for this generic.(8ـ/ +J +java:S2447{"-Null is returned but a "Boolean" is expected.(8ڀ/ +K +java:S2447"-Null is returned but a "Boolean" is expected.(8܀/ +K +java:S2447"-Null is returned but a "Boolean" is expected.(8߀/ +I +java:S1168"+Return an empty collection instead of null.(8߀/ +I +java:S1168"+Return an empty collection instead of null.(8߀/ +I +java:S1168"+Return an empty collection instead of null.(8߀/ +I +java:S1168"+Return an empty collection instead of null.(8/ +I +java:S1168"+Return an empty collection instead of null.(8/ +I +java:S1168"+Return an empty collection instead of null.(8/ +I +java:S1168"+Return an empty collection instead of null.(8/ +v +java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(I8/ +I +java:S1168"+Return an empty collection instead of null.(8/ +v +java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(I8/ +I +java:S1168"+Return an empty collection instead of null.(8/ +8 +java:S3457"Not enough arguments.(8/ +8 +java:S3457"Not enough arguments.(8/ + +java:S1319"mThe return type of this method should be an interface such as "Set" rather than the implementation "HashSet".(8/ + +java:S1319"mThe return type of this method should be an interface such as "Set" rather than the implementation "HashSet".(𷕅8/ +H +java:S5411"*Use the primitive boolean expression here.(8/ +H +java:S5411"*Use the primitive boolean expression here.(8/ +H +java:S5411"*Use the primitive boolean expression here.(8/ +H +java:S5411"*Use the primitive boolean expression here.(8/ +M +java:S5411"*Use the primitive boolean expression here.(8/ +p +java:S2259."SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(8/ +q +java:S2259"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(8/ +q +java:S2259"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(8/ +p +java:S2259"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(ȅ8/ +q +java:S2259"SA "NullPointerException" could be thrown; "getConnectionFactory()" can return null.(֏8/ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/e/7/e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5 b/.idea/sonarlint/issuestore/e/7/e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5 index e69de29..69efe07 100644 --- a/.idea/sonarlint/issuestore/e/7/e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5 +++ b/.idea/sonarlint/issuestore/e/7/e7ba402f75a71f1f452cbf16986ed26aa0c6f1b5 @@ -0,0 +1,21 @@ + +Q +java:S3740"/Provide the parametrized type for this generic.(⋠8/ +Q +java:S3740"/Provide the parametrized type for this generic.(⋠8/ +L +java:S3740"/Provide the parametrized type for this generic.(8/ +L +java:S3740"/Provide the parametrized type for this generic.(8/ +Q +java:S3740#"/Provide the parametrized type for this generic.(8/ +p java:S116"ORename this field "NAME" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/ +o java:S116"NRename this field "PID" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ֶ8/ +r java:S116"QRename this field "TOPICS" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(⋠8/ +k java:S116"ORename this field "INFO" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/ +h +java:S3252H"FUse static access with "com.alibaba.fastjson.JSON" for "toJSONString".(֝8/ + +java:S1319#"rThe type of the "customInfo" object should be an interface such as "Map" rather than the implementation "HashMap".(8/ +` +java:S1155,">Use isEmpty() to check whether the collection is empty or not.(8/ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/1/5/157e0e9285b69e300624f35e79300c0ed6098936 b/.idea/sonarlint/issuestore/e/a/eaa75651d9d6785c2bd75843529d61a722450af5 similarity index 100% rename from .idea/sonarlint/issuestore/1/5/157e0e9285b69e300624f35e79300c0ed6098936 rename to .idea/sonarlint/issuestore/e/a/eaa75651d9d6785c2bd75843529d61a722450af5 diff --git a/.idea/sonarlint/issuestore/f/d/fdadf7a612307c5bb8e90739949b439a1891d886 b/.idea/sonarlint/issuestore/f/d/fdadf7a612307c5bb8e90739949b439a1891d886 index e69de29..7575429 100644 --- a/.idea/sonarlint/issuestore/f/d/fdadf7a612307c5bb8e90739949b439a1891d886 +++ b/.idea/sonarlint/issuestore/f/d/fdadf7a612307c5bb8e90739949b439a1891d886 @@ -0,0 +1,5 @@ + +t +java:S3077"WUse a thread-safe type; adding "volatile" is not enough to make this field thread-safe.(8/ +o +java:S1215$"TDon't try to be smarter than the JVM, remove this call to run the garbage collector.(ݧ \ No newline at end of file diff --git a/.idea/sonarlint/issuestore/index.pb b/.idea/sonarlint/issuestore/index.pb index d0df8d4..801e339 100644 --- a/.idea/sonarlint/issuestore/index.pb +++ b/.idea/sonarlint/issuestore/index.pb @@ -10,8 +10,6 @@ i .gitignore,a\5\a5cc2925ca8258af241be7e5b0381edf30266302 > .gitattributes,2\4\24139dae656713ba861751fb2c2ac38839349a7a -9 - README.md,8/e/8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d k ;src/main/java/site/cnkj/common/config/AsyncExecutePool.java,4\1\416390ba57649e9f4e6365934e9a6827cca3ffed p @@ -26,33 +24,43 @@ i 9src/main/java/site/cnkj/common/object/redis/Receiver.java,4\a\4a24c23f6158d7abc5657040e232691adcee44ac m =src/main/java/site/cnkj/common/object/servlet/BaseResult.java,1\9\19affac2f7e5749f37c36532ef281eec1befbd05 -m -=src/main/java/site/cnkj/common/object/servlet/CommonInfo.java,6\b\6b5bb34dca0a1a09968bad0dc5ab4ad5434df80e -m -=src/main/java/site/cnkj/common/object/servlet/DataResult.java,1\c\1c4b500508bae883bea47d0637c267e8c57d7580 -s -Csrc/main/java/site/cnkj/common/object/servlet/ResponseBodyCode.java,b\c\bc46480ac8ea27c54208391c0607483f70591f52 l - - - - - + + + + + + + + + + + + + + + + + + - + + + + + - + + + - + 1574318981558 1574320188766 @@ -809,7 +848,18 @@ - + +