{"id":3316,"date":"2023-11-02T17:20:32","date_gmt":"2023-11-02T09:20:32","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=3316"},"modified":"2023-11-13T16:29:24","modified_gmt":"2023-11-13T08:29:24","slug":"springboot-kafka-%e5%ae%9e%e7%8e%b0%e5%bb%b6%e6%97%b6%e9%98%9f%e5%88%97","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/java\/springboot-kafka-%e5%ae%9e%e7%8e%b0%e5%bb%b6%e6%97%b6%e9%98%9f%e5%88%97\/","title":{"rendered":"springboot kafka \u5b9e\u73b0\u5ef6\u65f6\u961f\u5217"},"content":{"rendered":"<div class=\"wxsyncmain\" style=\"text-align: left;\">\n<p><span style=\"letter-spacing: 0.034em;\"><strong style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; white-space: normal; background-color: #ffffff;\"><span style=\"color: #888888; font-size: 20px;\">\u201c<\/span><\/strong><span style=\"font-size: 16px; letter-spacing: 0.578px; background-color: #ffffff; color: #888888;\"><span style=\"letter-spacing: 0.578px;\">\u672c\u6587\u7ae0springboot kafka \u5b9e\u73b0\u5ef6\u65f6\u961f\u5217\uff0c\u4f7f\u7528Kafka\u6d88\u8d39\u8005\u7684pause\u51fd\u6570\uff08<\/span><span style=\"letter-spacing: 0.578px;\">\u6682\u505c\uff09\u548cresume\u51fd\u6570\uff08\u6062\u590d\uff09+\u7ebf\u7a0b\u6c60+\u5b9a\u65f6\u4efb\u52a1+\u4e8b\u4ef6\u76d1\u542c\u673a\u5236+\u5de5\u5382\u6a21\u5f0f<\/span><strong><span style=\"font-size: 20px;\">\u201d<\/span><\/strong><\/span><\/span><\/p>\n<p><span style=\"letter-spacing: 0.034em;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170142463.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.562962962962963\" data-type=\"png\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170142463.png\" data-ratio=\"0.562962962962963\" data-type=\"png\" data-w=\"1080\" \/><\/noscript><\/span><\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u597d\u6587\u63a8\u8350\uff1a<\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\"><a style=\"letter-spacing: 0.578px;\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUxMjY5NzEyMw==&amp;mid=2247483967&amp;idx=1&amp;sn=fe54b7904bad7d69933681e701f70703&amp;chksm=f9613473ce16bd654ad5312da7772027db31f2af742ff316c9c75a22e6aa0c2f94465e4e90eb&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >2.5\u4e07\u5b57\u8bb2\u89e3DDD\u9886\u57df\u9a71\u52a8\u8bbe\u8ba1\uff0c\u4ece\u7406\u8bba\u5230\u5b9e\u8df5\u638c\u63e1DDD\u5206\u5c42\u67b6\u6784\u8bbe\u8ba1\uff0c\u8d76\u7d27\u6536\u85cf\u8d77\u6765\u5427\uff01<\/a><\/p>\n<p style=\"margin-bottom: 16px; white-space: normal; outline: 0px; background-color: #ffffff; letter-spacing: normal; font-size: 16px; color: #4d4d4d; line-height: 26px; overflow: auto hidden;\"><a style=\"outline: 0px; cursor: pointer;\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUxMjY5NzEyMw==&amp;mid=2247483905&amp;idx=1&amp;sn=0d41bb19e96fe72db59c97ba276ca2e5&amp;chksm=f961344dce16bd5bd9d62e54c2b5e7ac7d4ff8c184de2493c25c6136997f104b3b82f19fc3bd&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >springboot\u4e0b\u4f18\u96c5\u5e72\u6389if else\uff0c\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u901a\u8fc7\u516c\u53f8\u4ee3\u7801\u5ba1\u67e5\uff01\uff01\uff01<\/a><\/p>\n<p style=\"margin-bottom: 16px; white-space: normal; outline: 0px; background-color: #ffffff; letter-spacing: normal; font-size: 16px; color: #4d4d4d; line-height: 26px; overflow: auto hidden;\"><a style=\"outline: 0px; cursor: pointer;\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUxMjY5NzEyMw==&amp;mid=2247483853&amp;idx=1&amp;sn=35b34529296b174ad1b45609121440ea&amp;chksm=f9613781ce16be9723ef0eab9598213734ebe3fd581b8a7f9f4839c6ed67a6010c07c7ea8ed7&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >\u4f7f\u7528\u9ad8\u5e76\u53d1\u5229\u5668redis\u2014\u89e3\u51b3\u6dd8\u5b9d\/\u5fae\u535a\u7684\u3010\u70ed\u95e8\u641c\u7d22\u3011\u548c\u3010\u6700\u8fd1\u641c\u7d22\u3011\u7684\u529f\u80fd<\/a><\/p>\n<p>\u6587\u7ae0\u76ee\u5f55<\/p>\n<p>\u4e00\u3001\u5ef6\u65f6\u961f\u5217\u5b9a\u4e49<\/p>\n<p>\u4e8c\u3001\u5e94\u7528\u573a\u666f<\/p>\n<p>\u4e09\u3001\u6280\u672f\u5b9e\u73b0\u65b9\u6848\uff1a<\/p>\n<p>1. Redis<\/p>\n<p>2. Kafka<\/p>\n<p>3. RabbitMQ<\/p>\n<p>4. RocketMQ<\/p>\n<p>\u56db\u3001Kafka\u5ef6\u65f6\u961f\u5217\u80cc\u666f<\/p>\n<p>\u4e94\u3001Kafka\u5ef6\u65f6\u961f\u5217\u5b9e\u73b0\u601d\u8def<\/p>\n<p>\u516d\u3001Kafka\u5ef6\u65f6\u961f\u5217\u67b6\u6784\u56fe<\/p>\n<p>\u4e03\u3001kafka\u5ef6\u65f6\u4efb\u52a1\u4ee3\u7801\u5b9e\u73b0<\/p>\n<p>1. KafkaSyncConsumer\uff1aKafka\u6d88\u8d39\u8005<\/p>\n<p>2. KafkaDelayQueue\uff1aKafka\u5ef6\u8fdf\u961f\u5217<\/p>\n<p>3. KafkaDelayQueueFactory\uff1aKafka\u5ef6\u8fdf\u961f\u5217\u5de5\u5382<\/p>\n<p>4. KafkaPollListener\uff1aKafka\u5ef6\u8fdf\u961f\u5217\u4e8b\u4ef6\u76d1\u542c<\/p>\n<p>5. KafkaDelayConfig\uff1aKafka\u5ef6\u65f6\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>\u516b\u3001\u5982\u4f55\u4f7f\u7528kafka\u5ef6\u65f6\u961f\u5217<\/p>\n<p>\u4e5d\u3001\u6d4b\u8bd5<\/p>\n<p>\u5341\u3001\u603b\u7ed3<\/p>\n<section style=\"max-width: 100%; box-sizing: border-box; color: #3e3e3e; font-size: 16px; white-space: normal; background-color: #ffffff; overflow-wrap: break-word !important; margin-bottom: 0px;\">\n<section style=\"max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n<section style=\"max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n<section style=\"padding-right: 20px; padding-left: 20px; max-width: 100%; box-sizing: border-box; line-height: 0.8; word-wrap: break-word !important;\">\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; text-align: center; word-wrap: break-word !important;\"><span style=\"max-width: 100%; box-sizing: border-box; color: #1aad19; font-size: 24px; word-wrap: break-word !important;\">01<\/span><\/p>\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; text-align: center; word-wrap: break-word !important;\"><span style=\"max-width: 100%; box-sizing: border-box; letter-spacing: 0px; color: #1aad19; font-size: 20px; word-wrap: break-word !important;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px;\">\n<p style=\"max-width: 100%; min-height: 1em; color: #3e3e3e; font-size: 16px; white-space: normal; background-color: #ffffff; box-sizing: border-box !important; overflow-wrap: break-word !important; margin-bottom: 0px;\">\n<p style=\"max-width: 100%; min-height: 1em; color: #3e3e3e; font-size: 16px; white-space: normal; background-color: #ffffff; text-align: center; box-sizing: border-box !important; overflow-wrap: break-word !important; margin-bottom: 0px;\"><span style=\"max-width: 100%; font-size: 20px; box-sizing: border-box !important; word-wrap: break-word !important;\"><span style=\"max-width: 100%; box-sizing: border-box !important; word-wrap: break-word !important;\"><span style=\"letter-spacing: 0.578px;\">\u5ef6\u65f6\u961f\u5217\u5b9a\u4e49<\/span><\/span><\/span><\/p>\n<p style=\"max-width: 100%; min-height: 1em; color: #3e3e3e; font-size: 16px; white-space: normal; background-color: #ffffff; box-sizing: border-box !important; overflow-wrap: break-word !important; margin-bottom: 0px;\">\n<p style=\"max-width: 100%; min-height: 1em; color: #3e3e3e; font-size: 16px; white-space: normal; background-color: #ffffff; box-sizing: border-box !important; overflow-wrap: break-word !important; margin-bottom: 0px;\">\n<p style=\"margin-bottom: 0px;\">\n<section style=\"max-width: 100%; box-sizing: border-box; color: #3e3e3e; font-size: 16px; white-space: normal; background-color: #ffffff; overflow-wrap: break-word !important; margin-bottom: 0px;\">\n<section style=\"max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n<section style=\"max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">\u5ef6\u65f6\u961f\u5217\uff1a\u662f\u4e00\u79cd\u6d88\u606f\u961f\u5217\uff0c\u53ef\u4ee5\u7528\u4e8e\u5728\u6307\u5b9a\u65f6\u95f4\u6216\u7ecf\u8fc7\u4e00\u5b9a\u65f6\u95f4\u540e\u6267\u884c\u67d0\u79cd\u64cd\u4f5c\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">\u5c0f\u7f16\u5df2\u7ecf\u505a\u597d\u4e86Kafka\u5ef6\u65f6\u961f\u5217\u7684\u5c01\u88c5\uff0c\u4ee5\u540e\u53ea\u9700\u8981\u4e00\u884c\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0kafka\u5ef6\u65f6\u961f\u5217\u4e86\uff0c\u4ee3\u7801\u4e2d\u6709\u8be6\u7ec6\u6ce8\u91ca\uff0c\u5b8c\u6574\u4ee3\u7801\u5df2\u7ecf\u7ed9\u5927\u5bb6\u6574\u7406\u597d\u4e86\uff0c\u9886\u53d6\u65b9\u5f0f\u653e\u5728\u4e86\u6587\u7ae0\u672b\u3002<\/span><\/section>\n<section style=\"padding-right: 10px; padding-left: 10px; max-width: 100%; box-sizing: border-box; line-height: 1.6; word-wrap: break-word !important;\">\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; word-wrap: break-word !important;\">\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; word-wrap: break-word !important;\">\n<section style=\"max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n<section style=\"max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n<section style=\"max-width: 100%; box-sizing: border-box; word-wrap: break-word !important;\">\n<section style=\"padding-right: 20px; padding-left: 20px; max-width: 100%; box-sizing: border-box; line-height: 0.8; word-wrap: break-word !important;\">\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; text-align: center; word-wrap: break-word !important;\"><span style=\"max-width: 100%; box-sizing: border-box; color: #1aad19; font-size: 24px; word-wrap: break-word !important;\">02<\/span><\/p>\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; text-align: center; word-wrap: break-word !important;\"><span style=\"max-width: 100%; box-sizing: border-box; letter-spacing: 0px; color: #1aad19; font-size: 20px; word-wrap: break-word !important;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; text-align: center; word-wrap: break-word !important;\"><span style=\"max-width: 100%; font-size: 20px; box-sizing: border-box !important; word-wrap: break-word !important;\"><span style=\"letter-spacing: 0.578px;\">\u5e94\u7528\u573a\u666f<\/span><\/span><\/p>\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; text-align: center; word-wrap: break-word !important;\">\n<p style=\"max-width: 100%; box-sizing: border-box; min-height: 1em; word-wrap: break-word !important;\">\n<\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">1\uff0c\u8ba2\u5355\u8d85\u65f6\u81ea\u52a8\u53d6\u6d88\uff1a\u7528\u6237\u4e0b\u5355\u540e\uff0c\u5982\u679c\u5728\u6307\u5b9a\u65f6\u95f4\u5185\u672a\u5b8c\u6210\u652f\u4ed8\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u53d6\u6d88\u8ba2\u5355\uff0c\u91ca\u653e\u5e93\u5b58\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">2\uff0c\u5b9a\u65f6\u63a8\u9001\uff1a\u6bd4\u5982\u6d88\u606f\u901a\u77e5\uff0c\u7528\u6237\u9884\u7ea6\u67d0\u4e2a\u670d\u52a1\uff0c\u7cfb\u7edf\u4f1a\u5728\u670d\u52a1\u5f00\u59cb\u524d\u4e00\u5b9a\u65f6\u95f4\u53d1\u9001\u63d0\u9192\u77ed\u4fe1\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">3\uff0c\u5b9a\u65f6\u4efb\u52a1\uff1a\u5c06\u9700\u8981\u5b9a\u65f6\u6267\u884c\u7684\u4efb\u52a1\u653e\u5165\u5ef6\u65f6\u961f\u5217\u4e2d\uff0c\u7b49\u5230\u6307\u5b9a\u7684\u65f6\u95f4\u5230\u8fbe\u65f6\u518d\u8fdb\u884c\u6267\u884c\uff0c\u4f8b\u5982\u751f\u6210\u62a5\u8868\u3001\u7edf\u8ba1\u6570\u636e\u7b49\u64cd\u4f5c\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">4\uff0c\u9650\u65f6\u62a2\u8d2d\uff1a\u5c06\u9650\u65f6\u62a2\u8d2d\u7684\u7ed3\u675f\u65f6\u95f4\u653e\u5165\u5ef6\u65f6\u961f\u5217\u4e2d\uff0c\u5f53\u65f6\u95f4\u5230\u8fbe\u65f6\u81ea\u52a8\u4e0b\u67b6\u5546\u54c1\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">......<\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px;\">\n<section style=\"margin-bottom: 0px; color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; white-space: normal; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">03<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; white-space: normal; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 20px;\"><span style=\"letter-spacing: 0.578px;\">\u6280\u672f\u5b9e\u73b0\u65b9\u6848<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0px; color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; white-space: normal; background-color: #ffffff; text-align: center;\">\n<section style=\"margin-bottom: 0px; color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-indent: 0em; white-space: normal; background-color: #ffffff; line-height: 1.6em;\"><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">1. Redis<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">1.1 \u4f18\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460Redis\u7684\u5ef6\u8fdf\u961f\u5217\u662f\u57fa\u4e8eRedis\u7684sorted set\u5b9e\u73b0\u7684\uff0c\u6027\u80fd\u8f83\u9ad8\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461Redis\u7684\u5ef6\u8fdf\u961f\u5217\u53ef\u4ee5\u901a\u8fc7TTL\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\uff0c\u7075\u6d3b\u6027\u8f83\u9ad8\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462\u7b80\u5355\u6613\u7528\uff0c\u9002\u7528\u4e8e\u5c0f\u578b\u7cfb\u7edf\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2463\u6027\u80fd\u8f83\u9ad8\uff0c\u652f\u6301\u9ad8\u5e76\u53d1\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 1.2 \u7f3a\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460\u53ef\u9760\u6027\u76f8\u5bf9\u8f83\u4f4e\uff0c\u53ef\u80fd\u4f1a\u4e22\u5931\u6d88\u606f\uff0c\u5c31\u7b97redis\u6700\u9ad8\u7ea7\u522b\u7684\u6301\u4e45\u5316\u4e5f\u662f\u6709\u53ef\u80fd\u4e22\u4e00\u6761\u7684\uff0c\u6bcf\u6b21\u8bf7\u6c42\u90fd\u505aaof\uff0c\u4f46\u662faof\u662f\u5f02\u6b65\u7684\uff0c\u6240\u4ee5\u4e0d\u4fdd\u8bc1\u8fd9\u4e00\u6761\u64cd\u4f5c\u80fd\u88ab\u6301\u4e45\u5316\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461\u800c\u4e14Redis\u6301\u4e45\u5316\u7684\u7279\u6027\u4e5f\u5bfc\u81f4\u5176\u5728\u6570\u636e\u91cf\u8f83\u5927\u65f6\uff0c\u5b58\u50a8\u548c\u67e5\u8be2\u6548\u7387\u9010\u6e10\u964d\u4f4e\uff0c\u6b64\u65f6\u4f1a\u9700\u8981\u5bf9\u5176\u8fdb\u884c\u5206\u7247\u548c\u8d1f\u8f7d\u5747\u8861\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462Redis\u7684\u5ef6\u8fdf\u961f\u5217\u9700\u8981\u624b\u52a8\u5b9e\u73b0\u6d88\u606f\u91cd\u8bd5\u673a\u5236\uff0c\u66f4\u4e25\u8c28\u7684\u6d88\u606f\u961f\u5217\u9700\u8981\u6570\u636e\u5e93\u515c\u5e95\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 1.3 \u5e94\u7528\u573a\u666f\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460\u9002\u7528\u4e8e\u8f83\u5c0f\u89c4\u6a21\u7684\u7cfb\u7edf\uff0c\u5b9e\u65f6\u6027\u8981\u6c42\u8f83\u9ad8\u7684\u573a\u666f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461\u9002\u7528\u4e8e\u8f7b\u91cf\u7ea7\u7684\u4efb\u52a1\u8c03\u5ea6\u548c\u6d88\u606f\u901a\u77e5\u573a\u666f\uff0c\u9002\u5408\u77ed\u671f\u5ef6\u8fdf\u4efb\u52a1\uff0c\u4e0d\u9002\u5408\u957f\u671f\u4efb\u52a1\uff0c\u4f8b\u5982\u8ba2\u5355\u8d85\u65f6\u672a\u652f\u4ed8\u7b49\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">2. Kafka<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 2.1 \u4f18\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460Kafka\u7684\u4f18\u70b9\u5728\u4e8e\u5176\u9ad8\u5e76\u53d1\u3001\u9ad8\u541e\u5410\u91cf\u548c\u53ef\u6269\u5c55\u6027\u5f3a\uff0c\u540c\u65f6\u652f\u6301\u5206\u7247\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461\u53ef\u9760\u6027\u9ad8\uff0c\u652f\u6301\u5206\u5e03\u5f0f\u548c\u6d88\u606f\u6301\u4e45\u5316\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462\u6d88\u8d39\u8005\u53ef\u4ee5\u968f\u65f6\u56de\u6eaf\u6d88\u8d39\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2463\u652f\u6301\u591a\u4e2a\u6d88\u8d39\u8005\u5e76\u884c\u6d88\u8d39\u3001\u6d88\u8d39\u8005\u7ec4\u7b49\u673a\u5236\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 2.2 \u7f3a\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460\u6ca1\u6709\u539f\u751f\u7684\u5ef6\u8fdf\u961f\u5217\u529f\u80fd\uff0c\u9700\u8981\u4f7f\u7528topic\u548c\u6d88\u8d39\u8005\u7ec4\u6765\u5b9e\u73b0\uff0c\u5b9e\u73b0\u5ef6\u8fdf\u961f\u5217\u9700\u8981\u989d\u5916\u7684\u5f00\u53d1\u5de5\u4f5c\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461\u6d88\u8d39\u8005\u9700\u8981\u4e3b\u52a8\u62c9\u53d6\u6570\u636e\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5ef6\u8fdf\uff0c\u7cbe\u5ea6\u4e0d\u662f\u7279\u522b\u9ad8\u3002\u5728\u6b64\u6848\u4f8b\u4e2d\u4ee3\u7801\u5df2\u7ecf\u5b9e\u73b0\u4e86\uff0c\u76f4\u63a5\u62ff\u6765\u4f7f\u7528\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 2.3 \u5e94\u7528\u573a\u666f\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u9002\u7528\u4e8e\u5927\u89c4\u6a21\u7684\u6570\u636e\u5904\u7406\uff0c\u5b9e\u65f6\u6027\u8981\u6c42\u8f83\u9ad8\u7684\uff0c\u9ad8\u541e\u5410\u91cf\u7684\u6d88\u606f\u5904\u7406\u573a\u666f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">3. RabbitMQ<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 3.1 \u4f18\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460RabbitMQ\u7684\u5ef6\u8fdf\u961f\u5217\u662f\u901a\u8fc7RabbitMQ\u7684\u63d2\u4ef6\u5b9e\u73b0\u7684\uff0c\u6613\u4e8e\u90e8\u7f72\u548c\u4f7f\u7528\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461RabbitMQ\u7684\u5ef6\u8fdf\u961f\u5217\u652f\u6301\u6d88\u606f\u91cd\u8bd5\u548c\u6d88\u606f\u987a\u5e8f\u5904\u7406\uff0c\u53ef\u9760\u6027\u8f83\u9ad8\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462\u652f\u6301\u6d88\u606f\u6301\u4e45\u5316\u548c\u5206\u5e03\u5f0f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2463\u652f\u6301\u4f18\u5148\u7ea7\u961f\u5217\u548c\u6b7b\u4fe1\u961f\u5217\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2464\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u63d2\u4ef6\u548c\u5de5\u5177\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 3.2 \u7f3a\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460RabbitMQ\u7684\u5ef6\u8fdf\u961f\u5217\u6027\u80fd\u8f83\u4f4e\uff0c\u4e0d\u9002\u7528\u4e8e\u9ad8\u541e\u5410\u91cf\u7684\u573a\u666f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461\u6027\u80fd\u8f83\u4f4e\uff0c\u4e0d\u9002\u5408\u9ad8\u5e76\u53d1\u573a\u666f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462\u5b9e\u73b0\u5ef6\u8fdf\u961f\u5217\u9700\u8981\u989d\u5916\u7684\u914d\u7f6e\uff0c\u4f46\u662f\u914d\u7f6e\u5c31\u5f88\u7b80\u5355\u4e86\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 3.3\u5e94\u7528\u573a\u666f\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u9002\u7528\u4e8e\u4e2d\u5c0f\u578b\u7684\u4efb\u52a1\u8c03\u5ea6\u548c\u6d88\u606f\u901a\u77e5\uff0c\u5bf9\u53ef\u9760\u6027\u8981\u6c42\u9ad8\u7684\u573a\u666f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">4. RocketMQ<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 4.1 \u4f18\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460RocketMQ\u7684\u5ef6\u8fdf\u961f\u5217\u662fRocketMQ\u539f\u751f\u652f\u6301\u7684\uff0c\u6613\u4e8e\u4f7f\u7528\u548c\u90e8\u7f72\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461RocketMQ\u7684\u5ef6\u8fdf\u961f\u5217\u652f\u6301\u6d88\u606f\u91cd\u8bd5\u548c\u6d88\u606f\u987a\u5e8f\u5904\u7406\uff0c\u53ef\u9760\u6027\u8f83\u9ad8\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462\u9ad8\u6027\u80fd\u548c\u9ad8\u541e\u5410\u91cf\uff0c\u652f\u6301\u5206\u5e03\u5f0f\u548c\u6d88\u606f\u6301\u4e45\u5316\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2463RocketMQ\u4f7f\u7528\u7b80\u5355\uff0c\u6027\u80fd\u597d\uff0c\u5e76\u4e14\u652f\u6301\u5ef6\u8fdf\u961f\u5217\u529f\u80fd\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 4.2 \u7f3a\u70b9\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460RocketMQ\u7684\u5ef6\u8fdf\u961f\u5217\u4e0d\u652f\u6301\u52a8\u6001\u6dfb\u52a0\u6216\u5220\u9664\u961f\u5217\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461RocketMQ\u7684\u5ef6\u8fdf\u961f\u5217\u9700\u8981\u4fdd\u8bc1\u6d88\u606f\u7684\u987a\u5e8f\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6d88\u606f\u5ef6\u8fdf\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462\u5728\u8282\u70b9\u5d29\u6e83\u540e\uff0cRocketMQ\u6709\u53ef\u80fd\u53d1\u751f\u6d88\u606f\u4e22\u5931\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\"> 4.3 \u5e94\u7528\u573a\u666f\uff1a<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2460\u9002\u7528\u4e8e\u5927\u89c4\u6a21\u7684\u6570\u636e\u5904\u7406\uff0c\u5bf9\u6027\u80fd\u548c\u541e\u5410\u91cf\u8981\u6c42\u8f83\u9ad8\u7684\u573a\u666f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2461\u9002\u5408\u4e8e\u4efb\u52a1\u91cf\u8f83\u5927\u3001\u9700\u8981\u5ef6\u8fdf\u6d88\u606f\u548c\u5b9a\u65f6\u6d88\u606f\u7684\u573a\u666f\u3002\u4f8b\u5982\u7535\u5546\u5e73\u53f0\u3001\u793e\u4ea4\u8f6f\u4ef6\u7b49\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">\u2462\u9002\u7528\u4e8e\u5206\u5e03\u5f0f\u4efb\u52a1\u8c03\u5ea6\u548c\u9ad8\u53ef\u9760\u6027\u6d88\u606f\u901a\u77e5\u573a\u666f\u3002<\/span><\/section>\n<section style=\"margin-bottom: 0px; color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-indent: 0em; white-space: normal; background-color: #ffffff; line-height: 1.6em;\"><\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">04<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 20px;\"><span style=\"letter-spacing: 0.578px;\">Kafka\u5ef6\u65f6\u961f\u5217\u80cc\u666f<\/span><\/span><\/p>\n<p><span style=\"background-color: #ffffff; color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-indent: 0em;\">1. \u57fa\u4e8e\u4ee5\u4e0a\u56db\u79cd\u5b9e\u73b0\u5ef6\u65f6\u961f\u5217\u7684\u5206\u6790\u6765\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u6280\u672f\u65b9\u6848\u7684\u57fa\u7840\u4e0a\u5462\uff0c\u4e0d\u540c\u516c\u53f8\u7684mq\u7684\u57fa\u7840\u8bbe\u65bd\u4e0d\u540c\uff0c\u5982\u679c\u53ea\u6709Kafka\uff0c\u4e5f\u6ca1\u5fc5\u8981\u5f15\u5165RabbitMQ\u548cRocketMq\u6765\u5b9e\u73b0\uff0c\u5f15\u5165\u65b0\u7684\u7ec4\u4ef6\u4e5f\u4f1a\u987a\u4fbf\u5e26\u6765\u65b0\u7684\u95ee\u9898\u3002<\/span><\/p>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px 0px 24px; text-indent: 0em;\"><span style=\"color: #3e3e3e; background-color: #ffffff; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">2. \u7f51\u4e0a\u641cKafka\u5b9e\u73b0\u5ef6\u65f6\u961f\u5217\u6709\u5f88\u591a\u6587\u7ae0\uff0c\u5f88\u591a\u6587\u7ae0\u8bf4\u4f7f\u7528Kafka\u5185\u90e8\u7684\u65f6\u95f4\u8f6e\uff0c\u652f\u6301\u5ef6\u65f6\u64cd\u4f5c\uff0c\u4f46\u8fd9\u662fKafka\u81ea\u5df1\u5185\u90e8\u4f7f\u7528\u7684\uff0c\u65f6\u95f4\u8f6e\u53ea\u662f\u4e00\u4e2a\u5de5\u5177\u7c7b\uff0c\u7528\u6237\u65e0\u6cd5\u5c06\u5176\u4f5c\u4e3a\u5ef6\u8fdf\u961f\u5217\u6765\u4f7f\u7528\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px 0px 24px; text-indent: 0em;\"><span style=\"color: #3e3e3e; background-color: #ffffff; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">3. Kafka\u5ef6\u65f6\u961f\u5217\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u4f7f\u7528Kafka\u6d88\u8d39\u8005\u7684\u6682\u505c\u548c\u6062\u590d\u673a\u5236\u6765\u5b9e\u73b0\u3002<\/span><\/section>\n<p>1. \u57fa\u4e8e\u4ee5\u4e0a\u56db\u79cd\u5b9e\u73b0\u5ef6\u65f6\u961f\u5217\u7684\u5206\u6790\u6765\uff0c\u9009\u62e9\u5bf9\u5e94\u7684\u6280\u672f\u65b9\u6848\u7684\u57fa\u7840\u4e0a\u5462\uff0c\u4e0d\u540c\u516c\u53f8\u7684mq\u7684\u57fa\u7840\u8bbe\u65bd\u4e0d\u540c\uff0c\u5982\u679c\u53ea\u6709Kafka\uff0c\u4e5f\u6ca1\u5fc5\u8981\u5f15\u5165RabbitMQ\u548cRocketMq\u6765\u5b9e\u73b0\uff0c\u5f15\u5165\u65b0\u7684\u7ec4\u4ef6\u4e5f\u4f1a\u987a\u4fbf\u5e26\u6765\u65b0\u7684\u95ee\u9898\u3002<\/p>\n<p>2. \u7f51\u4e0a\u641cKafka\u5b9e\u73b0\u5ef6\u65f6\u961f\u5217\u6709\u5f88\u591a\u6587\u7ae0\uff0c\u5f88\u591a\u6587\u7ae0\u8bf4\u4f7f\u7528Kafka\u5185\u90e8\u7684\u65f6\u95f4\u8f6e\uff0c\u652f\u6301\u5ef6\u65f6\u64cd\u4f5c\uff0c\u4f46\u8fd9\u662fKafka\u81ea\u5df1\u5185\u90e8\u4f7f\u7528\u7684\uff0c\u65f6\u95f4\u8f6e\u53ea\u662f\u4e00\u4e2a\u5de5\u5177\u7c7b\uff0c\u7528\u6237\u65e0\u6cd5\u5c06\u5176\u4f5c\u4e3a\u5ef6\u8fdf\u961f\u5217\u6765\u4f7f\u7528\u3002<\/p>\n<p>3. Kafka\u5ef6\u65f6\u961f\u5217\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u4f7f\u7528Kafka\u6d88\u8d39\u8005\u7684\u6682\u505c\u548c\u6062\u590d\u673a\u5236\u6765\u5b9e\u73b0\u3002<\/p>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">05<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 20px;\"><span style=\"letter-spacing: 0.578px;\">Kafka\u5ef6\u65f6\u961f\u5217\u5b9e<\/span><span style=\"letter-spacing: 0.578px;\">\u73b0\u601d\u8def<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">1. \u89e3\u51b3\u4e00\u4e2a\u95ee\u9898\u524d\u9996\u5148\u8981\u660e\u786e\u95ee\u9898\uff0c\u5982\u4f55\u8ba9Kafka\u6709\u5ef6\u65f6\u961f\u5217\u7684\u529f\u80fd\u5462\uff1f<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">2. \u5c31\u662f\u5728Kafka\u6d88\u8d39\u8005\u6d88\u8d39\u7684\u65f6\u5019\u5ef6\u65f6\u6d88\u8d39\uff0c\u4e0d\u4e45\u641e\u5b9a\u4e86\u561b<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">3. \u90a3\u5982\u4f55\u5ef6\u65f6\u6d88\u8d39\u5462\uff0c\u7f51\u4e0a\u6709\u4e9b\u6587\u7ae0\u4f7f\u7528Thread.sleep\u8fdb\u884c\u5ef6\u65f6\u6d88\u8d39\u8fd9\u662f\u4e0d\u9760\u8c31\u7684\uff08\u4eb2\u8eab\u5b9e\u8df5\uff09\uff0csleep\u7684\u65f6\u95f4\u8d85\u8fc7\u4e86Kafka\u914d\u7f6e\u7684max.poll.records\u65f6\u95f4\uff0c\u6d88\u8d39\u8005\u65e0\u6cd5\u53ca\u65f6\u63d0\u4ea4offset\uff0ckafka\u5c31\u4f1a\u8ba4\u4e3a\u8fd9\u4e2a\u6d88\u8d39\u8005\u5df2\u7ecf\u6302\u4e86\uff0c\u4f1a\u8fdb\u884crebalance\u4e5f\u5c31\u662f\u91cd\u65b0\u5206\u914d\u5206\u533a\u7ed9\u6d88\u8d39\u8005\uff0c\u4ee5\u4fdd\u8bc1\u6bcf\u4e2a\u5206\u533a\u53ea\u88ab\u4e00\u4e2a\u6d88\u8d39\u8005\u6d88\u8d39<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">4. \u4e5f\u6709\u540c\u5b66\u8bf4\u4e86\uff0c\u4e3a\u4e86\u4e0d\u53d1\u751frebalance\uff0c\u90a3\u53ef\u4ee5\u589e\u52a0max.poll.records\u65f6\u95f4\u554a\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u8bdd\uff0c\u5982\u679c\u8981sleep\u51e0\u5929\u7684\u65f6\u95f4\uff0c\u96be\u9053max.poll.records\u8981\u5199\u51e0\u5929\u7684\u65f6\u95f4\u561b\uff0c\u6709\u8fddKafka\u7684\u8bbe\u8ba1\u539f\u7406\u4e86\uff0c\u90a3\u600e\u4e48\u529e\u5462\uff1f<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">5. \u8fd9\u65f6\u5019Kafka\u7684pause\u6682\u505c\u6d88\u8d39\u548cresume\u6062\u590d\u6d88\u8d39\u5c31\u767b\u573a\u4e86\uff0cpause\u6682\u505c\u67d0\u4e2a\u5206\u533a\u4e4b\u540e\u6d88\u8d39\u8005\u4e0d\u4f1a\u518dpoll\u62c9\u53d6\u8be5\u5206\u533a\u7684\u6d88\u606f\uff0c\u76f4\u5230resume\u6062\u590d\u8be5\u5206\u533a\u4e4b\u540e\u624d\u4f1a\u91cd\u65b0poll\u6d88\u606f\u3002<\/span><\/section>\n<section style=\"letter-spacing: 0.578px; white-space: normal; line-height: 1.6em; text-align: justify; margin: 0px; text-indent: 0em;\"><span style=\"color: #3e3e3e; font-size: 16px; letter-spacing: 0.578px; text-decoration: none solid #3e3e3e;\">6. \u6211\u5df2\u7ecf\u505a\u597d\u4e86Kafka\u5ef6\u65f6\u961f\u5217\u7684\u5c01\u88c5\uff0c\u4ee5\u540e\u53ea\u9700\u8981\u4e00\u884c\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5ef6\u65f6\u961f\u5217\u4e86<\/span><\/section>\n<section>\n<section style=\"letter-spacing: 0.578px; line-height: 1.6em; text-indent: 0em;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">06<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 20px;\"><span style=\"letter-spacing: 0.578px;\">Kafka\u5ef6\u65f6\u961f\u5217\u5b9e<\/span><span style=\"letter-spacing: 0.578px;\">\u73b0\u601d\u8def<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section style=\"letter-spacing: 0.578px; text-indent: 0em; line-height: 1.6em;\"><span style=\"letter-spacing: 0.578px; text-decoration-style: solid; text-decoration-color: #3e3e3e;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"letter-spacing: 0.578px; white-space: normal;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170144941.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.8907407407407407\" data-type=\"png\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"letter-spacing: 0.578px; white-space: normal;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170144941.png\" data-ratio=\"0.8907407407407407\" data-type=\"png\" data-w=\"1080\" \/><\/noscript><\/span><\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">07<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 20px;\"><span style=\"letter-spacing: 0.578px;\">kafka\u5ef6\u65f6\u4efb\u52a1\u4ee3\u7801\u5b9e\u73b0<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff; text-align: center;\">\n<section>\n<section style=\"letter-spacing: 0.578px; line-height: 1.6em; text-indent: 0em;\"><span style=\"letter-spacing: 0.578px; text-decoration-style: solid; text-decoration-color: #3e3e3e;\"><span style=\"letter-spacing: 0.578px;\">\u4ee5\u4e0b\u4ee3\u7801\u53ea\u5217\u51fa\u4e86\u6838\u5fc3\u5b9e\u73b0\uff0c\u5b8c\u6574\u4ee3\u7801\u5df2\u7ecf\u7ed9\u5927\u5bb6\u6574\u7406\u597d\u4e86\uff0c\u53ef\u4ee5\u5173\u6ce8\u3010\u5fae\u4fe1\u516c\u4f17\u53f7\u3011\u5fae\u4fe1\u641c\u7d22\u3010\u8001\u677f\u6765\u4e00\u676fjava\u3011\uff0c\u7136\u540e\u3010\u52a0\u7fa4\u3011\u76f4\u63a5\u83b7\u53d6\u6e90\u7801\u3002<\/span><\/span><\/section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u6e90\u7801\u76ee\u5f55\uff1a<\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170147782.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.5509259259259259\" data-type=\"png\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170147782.png\" data-ratio=\"0.5509259259259259\" data-type=\"png\" data-w=\"1080\" \/><\/noscript><\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">1. KafkaSyncConsumer\uff1aKafka\u6d88\u8d39\u8005<\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u8be5\u7c7b\u5c01\u88c5\u4e86\u4e00\u4e2a\u7ebf\u7a0b\u5b89\u5168\u7684KafkaConsumer\uff0c\u56e0\u4e3a\u539f\u751f\u7684 KafkaConsumer\u662f\u4e0d\u652f\u6301\u7ebf\u7a0b\u5171\u4eab\u7684\uff0c\u76f4\u63a5\u4f7f\u7528\u4f1a\u62a5\u9519\uff1ajava.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access<\/p>\n<div style=\"text-align: left;\">package com.wdyin.kafka.delay;<\/p>\n<p>import org.apache.kafka.clients.consumer.ConsumerRecords;<br \/>\nimport org.apache.kafka.clients.consumer.KafkaConsumer;<br \/>\nimport org.apache.kafka.clients.consumer.OffsetAndMetadata;<br \/>\nimport org.apache.kafka.common.TopicPartition;<\/p>\n<p>import java.time.Duration;<br \/>\nimport java.util.Collections;<br \/>\nimport java.util.Map;<br \/>\nimport java.util.Properties;<br \/>\nimport java.util.Set;<\/p>\n<p>\/**<br \/>\n* Kafka\u540c\u6b65\u6d88\u8d39\u8005 * @author WDYin * @date 2023\/4\/14<br \/>\n**\/<br \/>\npublic class KafkaSyncConsumer&lt;K, V&gt; extends KafkaConsumer&lt;K, V&gt; {<br \/>\nKafkaSyncConsumer(Properties properties) {<br \/>\nsuper(properties);<br \/>\n}<\/p>\n<p>@Override<br \/>\npublic synchronized ConsumerRecords&lt;K, V&gt; poll(Duration timeout) {<br \/>\nreturn super.poll(timeout);<br \/>\n}<\/p>\n<p>@Override<br \/>\npublic synchronized Set&lt;TopicPartition&gt; paused() {<br \/>\nreturn super.paused();<br \/>\n}<\/p>\n<p>synchronized void pauseAndSeek(TopicPartition partition, long offset) {<br \/>\nsuper.pause(Collections.singletonList(partition));<br \/>\nsuper.seek(partition, offset);<br \/>\n}<\/p>\n<p>@Override<br \/>\npublic synchronized void commitSync(Map&lt;TopicPartition, OffsetAndMetadata&gt; offsets) {<br \/>\nsuper.commitSync(offsets);<br \/>\n}<\/p>\n<p>synchronized void resume(TopicPartition topicPartition) {<br \/>\nsuper.resume(Collections.singleton(topicPartition));<br \/>\n}<\/p>\n<p>@Override<br \/>\npublic synchronized void commitSync() {<br \/>\nsuper.commitSync();<br \/>\n}<br \/>\n}<\/p><\/div>\n<section>\n<pre data-lang=\"java\"><\/pre>\n<\/section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">2. KafkaDelayQueue\uff1aKafka\u5ef6\u8fdf\u961f\u5217<\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u5b9a\u4e49\u4e00\u4e2aKafka\u5ef6\u671f\u961f\u5217\uff0c\u5305\u542b\u7684\u5185\u5bb9\uff1aKafkaDelayQueue\uff0c\u5176\u4e2d\u6709\u5ef6\u8fdf\u961f\u5217\u914d\u7f6e\uff0c\u4e3b\u9898\uff0c\u6d88\u8d39\u7ec4\uff0c\u5ef6\u8fdf\u65f6\u95f4\uff0c\u76ee\u6807\u4e3b\u9898\uff0cKafkaSyncConsumer\uff0cApplicationContext\uff0cpoll\u7ebf\u7a0b\u6c60\uff0cdelay\u7ebf\u7a0b\u6c60\u7b49\u7b49<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<div>package com.wdyin.kafka.delay;<\/p>\n<p>import lombok.Getter;<br \/>\nimport lombok.Setter;<br \/>\nimport lombok.extern.slf4j.Slf4j;<br \/>\nimport org.apache.kafka.clients.consumer.ConsumerRecords;<br \/>\nimport org.apache.kafka.common.TopicPartition;<br \/>\nimport org.slf4j.Logger;<br \/>\nimport org.slf4j.LoggerFactory;<br \/>\nimport org.springframework.context.ApplicationContext;<br \/>\nimport org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;<\/p>\n<p>import java.time.Duration;<br \/>\nimport java.util.Collections;<br \/>\nimport java.util.concurrent.ThreadPoolExecutor;<\/p>\n<p>\/**<br \/>\n* kafka\u5ef6\u65f6\u961f\u5217 * * @Author WDYin * @Date 2022\/7\/2<br \/>\n**\/<br \/>\n@Slf4j<br \/>\n@Getter<br \/>\n@Setter<br \/>\nclass KafkaDelayQueue&lt;K, V&gt; {<br \/>\nprivate String topic;<br \/>\nprivate String group;<br \/>\nprivate Integer delayTime;<br \/>\nprivate String targetTopic;<br \/>\nprivate KafkaDelayConfig kafkaDelayConfig;<br \/>\nprivate KafkaSyncConsumer&lt;K, V&gt; kafkaSyncConsumer;<br \/>\nprivate ApplicationContext applicationContext;<br \/>\nprivate ThreadPoolTaskScheduler threadPoolPollTaskScheduler;<br \/>\nprivate ThreadPoolTaskSchedulerthreadPoolDelayTaskScheduler;<br \/>\n}<\/p><\/div>\n<\/section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">3. KafkaDelayQueueFactory\uff1aKafka\u5ef6\u8fdf\u961f\u5217\u5de5\u5382<\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">Kafka\u5ef6\u671f\u961f\u5217\u7684\u5de5\u5382\uff0c\u7528\u4e8e\u53ca\u5176\u7ba1\u7406\u5ef6\u8fdf\u961f\u5217<\/p>\n<div>package com.wdyin.kafka.delay;<\/p>\n<p>import lombok.Data;<br \/>\nimport org.apache.kafka.clients.consumer.ConsumerConfig;<br \/>\nimport org.springframework.context.ApplicationContext;<br \/>\nimport org.springframework.util.Assert;<br \/>\nimport org.springframework.util.StringUtils;<\/p>\n<p>import java.util.Properties;<\/p>\n<p>\/**<br \/>\n* \u5ef6\u65f6\u961f\u5217\u5de5\u5382 * @author WDYin * @date 2023\/4\/17<br \/>\n**\/<br \/>\n@Datapublic<br \/>\nclass KafkaDelayQueueFactory {<br \/>\nprivate KafkaDelayConfig kafkaDelayConfig;<br \/>\nprivate Properties properties;<br \/>\nprivate ApplicationContext applicationContext;<br \/>\nprivate Integer concurrency;<\/p>\n<p>public KafkaDelayQueueFactory(Properties properties, KafkaDelayConfig kafkaDelayConfig) {<br \/>\nAssert.notNull(properties, \"properties cannot null\");<br \/>\nAssert.notNull(kafkaDelayConfig.getDelayThreadPool(), \"delayThreadPool cannot null\");<br \/>\nAssert.notNull(kafkaDelayConfig.getPollThreadPool(), \"pollThreadPool cannot null\");<br \/>\nAssert.notNull(kafkaDelayConfig.getPollInterval(), \"pollInterval cannot null\");<br \/>\nAssert.notNull(kafkaDelayConfig.getPollTimeout(), \"timeout cannot null\");<br \/>\nthis.properties = properties;<br \/>\nthis.kafkaDelayConfig = kafkaDelayConfig;<br \/>\n}<\/p>\n<p>public void listener(String topic, String group, Integer delayTime, String targetTopic) {<br \/>\nif (StringUtils.isEmpty(topic)) {<br \/>\nthrow new RuntimeException(\"topic cannot empty\");<br \/>\n}<br \/>\nif (StringUtils.isEmpty(group)) {<br \/>\nthrow new RuntimeException(\"group cannot empty\");<br \/>\n}<br \/>\nif (StringUtils.isEmpty(delayTime)) {<br \/>\nthrow new RuntimeException(\"delayTime cannot empty\");<br \/>\n}<br \/>\nif (StringUtils.isEmpty(targetTopic)) {<br \/>\nthrow new RuntimeException(\"targetTopic cannot empty\");<br \/>\n}<br \/>\nKafkaSyncConsumer&lt;String, String&gt; kafkaSyncConsumer = createKafkaSyncConsumer(group);<br \/>\nKafkaDelayQueue&lt;String, String&gt; kafkaDelayQueue = createKafkaDelayQueue(topic, group, delayTime, targetTopic, kafkaSyncConsumer);<br \/>\nkafkaDelayQueue.send();<br \/>\n}<\/p>\n<p>private KafkaDelayQueue&lt;String, String&gt; createKafkaDelayQueue(String topic, String group, Integer delayTime, String targetTopic, KafkaSyncConsumer&lt;String, String&gt; kafkaSyncConsumer) {<br \/>\nKafkaDelayQueue&lt;String, String&gt; kafkaDelayQueue = new KafkaDelayQueue&lt;&gt;(kafkaSyncConsumer, kafkaDelayConfig);<br \/>\nAssert.notNull(applicationContext, \"kafkaDelayQueue need applicationContext\");<br \/>\nkafkaDelayQueue.setApplicationContext(applicationContext);<br \/>\nkafkaDelayQueue.setDelayTime(delayTime);<br \/>\nkafkaDelayQueue.setTopic(topic);<br \/>\nkafkaDelayQueue.setGroup(group);<br \/>\nkafkaDelayQueue.setTargetTopic(targetTopic);<br \/>\nreturn kafkaDelayQueue;<br \/>\n}<\/p>\n<p>private KafkaSyncConsumer&lt;String, String&gt; createKafkaSyncConsumer(String group) {<br \/>\nproperties.put(ConsumerConfig.GROUP_ID_CONFIG, group);<br \/>\nreturn new KafkaSyncConsumer&lt;&gt;(properties);<br \/>\n}<br \/>\n}<\/p><\/div>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">4. KafkaPollListener\uff1aKafka\u5ef6\u8fdf\u961f\u5217\u4e8b\u4ef6\u76d1\u542c<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<div>package com.wdyin.kafka.delay;<\/p>\n<p>import lombok.extern.slf4j.Slf4j;<br \/>\nimport org.apache.kafka.clients.consumer.ConsumerRecord;<br \/>\nimport org.apache.kafka.clients.consumer.ConsumerRecords;<br \/>\nimport org.apache.kafka.clients.consumer.OffsetAndMetadata;<br \/>\nimport org.apache.kafka.common.TopicPartition;<br \/>\nimport org.springframework.context.ApplicationListener;<br \/>\nimport org.springframework.kafka.core.KafkaTemplate;<\/p>\n<p>import java.time.Instant;<br \/>\nimport java.time.LocalDateTime;<br \/>\nimport java.time.ZoneId;<br \/>\nimport java.util.*;<\/p>\n<p>\/**<br \/>\n* \u5ef6\u65f6\u961f\u5217\u76d1\u542c * @Author : WDYin * @Date : 2021\/5\/7 * @Desc :<br \/>\n*\/<br \/>\n@Slf4jpublic<br \/>\nclass KafkaPollListener&lt;K, V&gt; implements ApplicationListener&lt;KafkaPollEvent&lt;K, V&gt;&gt; {<br \/>\nprivate KafkaTemplate kafkaTemplate;<\/p>\n<p>public KafkaPollListener(KafkaTemplate kafkaTemplate) {<br \/>\nthis.kafkaTemplate = kafkaTemplate;<br \/>\n}<\/p>\n<p>@Override<br \/>\npublic void onApplicationEvent(KafkaPollEvent&lt;K, V&gt; event) {<br \/>\nConsumerRecords&lt;K, V&gt; records = (ConsumerRecords&lt;K, V&gt;) event.getSource();<br \/>\nInteger delayTime = event.getDelayTime();<br \/>\nKafkaDelayQueue&lt;K, V&gt; kafkaDelayQueue = event.getKafkaDelayQueue();<br \/>\nKafkaSyncConsumer&lt;K, V&gt; kafkaSyncConsumer = kafkaDelayQueue.getKafkaSyncConsumer(); \/\/1.\u83b7\u53d6poll\u5230\u7684\u6709\u6d88\u606f\u7684\u5206\u533a Set&lt;TopicPartition&gt; partitions = records.partitions(); \/\/2.\u5b58\u50a8\u9700\u8981commit\u7684\u6d88\u606f,\u63d0\u9ad8\u6548\u7387\u6279\u91cf\u63d0\u4ea4 Map&lt;TopicPartition, OffsetAndMetadata&gt; commitMap = new HashMap&lt;&gt;(); \/\/3.\u904d\u5386\u6709\u6d88\u606f\u7684\u5206\u533a partitions.forEach((partition) -&gt; { List&lt;ConsumerRecord&lt;K, V&gt;&gt; consumerRecords = records.records(partition); \/\/4.\u904d\u5386\u5206\u533a\u91cc\u9762\u7684\u6d88\u606f for (ConsumerRecord&lt;K, V&gt; record : consumerRecords) { \/\/5.\u83b7\u53d6\u6d88\u606f\u521b\u5efa\u65f6\u95f4 long startTime = (record.timestamp() \/ 1000) * 1000; long endTime = startTime + delayTime; \/\/6.\u4e0d\u7b26\u5408\u6761\u4ef6\u7684\u5206\u533a\u6682\u505c\u6d88\u8d39 long now = System.currentTimeMillis(); if (endTime &gt; now) { kafkaSyncConsumer.pauseAndSeek(partition, record.offset()); \/\/7.\u4f7f\u7528 schedule()\u6267\u884c\u5b9a\u65f6\u4efb\u52a1 kafkaDelayQueue.getThreadPoolPollTaskScheduler().schedule(kafkaDelayQueue.delayTask(partition), new Date(endTime)); \/\/\u65e0\u9700\u7ee7\u7eed\u6d88\u8d39\u8be5\u5206\u533a\u4e0b\u7684\u5176\u4ed6\u6d88\u606f\uff0c\u76f4\u63a5\u6d88\u8d39\u5176\u4ed6\u5206\u533a break; } log.info(\"{}: partition:{}, offset:{}, key:{}, value:{}, messageDate:{}, nowDate:{}, messageDate:{}, nowDate:{}\", Thread.currentThread().getName() + \"#\" + Thread.currentThread().getId(), record.topic() + \"-\" + record.partition(), record.offset(), record.key(), record.value(), LocalDateTime.ofInstant(Instant.ofEpochMilli(startTime), ZoneId.systemDefault()), LocalDateTime.now(), startTime, Instant.now().getEpochSecond()); \/\/\u53d1\u9001\u76ee\u6807\u4e3b\u9898 kafkaTemplate.send(kafkaDelayQueue.getTargetTopic(), record.value()); \/\/\u66f4\u65b0\u9700\u8981commit\u7684\u6d88\u606f commitMap.put(partition, new OffsetAndMetadata(record.offset() + 1)); } }); \/\/8.\u6279\u91cf\u63d0\u4ea4,\u63d0\u9ad8\u6548\u7387,commitSync\u8017\u65f6\u51e0\u767e\u6beb\u79d2<br \/>\nif (!commitMap.isEmpty()) {<br \/>\nkafkaSyncConsumer.commitSync(commitMap);<br \/>\n}<br \/>\n}<br \/>\n}<\/p><\/div>\n<\/section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">5. KafkaConfig\uff1aKafka\u914d\u7f6e\u6587\u4ef6<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<div>package com.wdyin.kafka.delay;<\/p>\n<p>import lombok.Data;<\/p>\n<p>\/**<br \/>\n* \u5ef6\u65f6\u961f\u5217\u914d\u7f6e * @author WDYin * @date 2023\/4\/16<br \/>\n**\/<br \/>\n@Datapublic<br \/>\nclass KafkaDelayConfig {<br \/>\nprivate Integer pollInterval;<br \/>\nprivate Integer pollTimeout;<br \/>\nprivate Integer pollThreadPool;<br \/>\nprivate Integer delayThreadPool;<\/p>\n<p>public KafkaDelayConfig() {<br \/>\n}<br \/>\n}<\/p><\/div>\n<\/section>\n<p><span style=\"display: none; line-height: 0px;\">\u200d<\/span><\/p>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; text-wrap: wrap; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">08<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"color: #3e3e3e; background-color: #ffffff; font-size: 16px; letter-spacing: 0.578px; text-decoration: none;\">\u5982\u4f55\u4f7f\u7528kafka\u5ef6\u65f6\u961f\u5217<\/span><\/p>\n<section>\n<section style=\"letter-spacing: 0.578px; line-height: 1.6em; text-indent: 0em;\"><\/section>\n<\/section>\n<\/section>\n<p>\u81ea\u5df1\u9879\u76ee\u4e2d\u5f15\u5165\u4ee5\u4e0a\u4ee3\u7801\u4e4b\u540e\uff0c\u4f7f\u7528KafkaDelayApplication\uff1a\u4e00\u4e2aKafka\u5ef6\u8fdf\u4efb\u52a1\u6ce8\u518c\u7a0b\u5e8f\uff0c\u6ce8\u610f\u4e00\u4e2a\u5ef6\u65f6\u4e3b\u9898\u5bf9\u5e94\u4e00\u4e2a\u5ef6\u8fdf\u65f6\u95f4\uff0c\u540e\u7eed\u6709\u65b0\u7684\u5ef6\u8fdf\u4efb\u52a1\u53ea\u9700\u8981\u5728\u6b64\u6ce8\u518c\u5ef6\u8fdf\u4efb\u52a1\u7684\u76d1\u542c\u5373\u53ef\uff01\u5f00\u7bb1\u5373\u7528\uff01<\/p>\n<p>\u4f7f\u7528\u6d41\u7a0b\uff1a<\/p>\n<p>\u751f\u4ea7\u8005\u53d1\u9001\u6d88\u606f\u5230\u3010\u5ef6\u65f6\u4e3b\u9898\u3011\u2014\u2014\u81ea\u5df1\u5199<\/p>\n<p>\u7136\u540eKafka\u5c06\u6d88\u606f\u4ece\u3010\u5ef6\u65f6\u4e3b\u9898\u3011\u7ecf\u8fc7\u3010\u5ef6\u65f6\u65f6\u95f4\u3011\u540e\u53d1\u9001\u5230\u3010\u76ee\u6807\u4e3b\u9898\u3011\u2014\u2014\u4ee5\u4e0b\u4ee3\u7801<\/p>\n<p>\u81ea\u5df1\u521b\u5efa\u6d88\u8d39\u8005\u6d88\u8d39\u3010\u76ee\u6807\u4e3b\u9898\u3011\u2014\u2014\u81ea\u5df1\u5199<\/p>\n<div>import org.springframework.stereotype.Component;<\/p>\n<p>import javax.annotation.PostConstruct;<br \/>\nimport javax.annotation.Resource;<\/p>\n<p>\/**<br \/>\n* @author WDYin * @date 2023\/4\/18<br \/>\n**\/<br \/>\n@Componentpublic<br \/>\nclass KafkaDelayApplication {<br \/>\n@Resource<br \/>\nprivate KafkaDelayQueueFactory kafkaDelayQueueFactory;<\/p>\n<p>\/**<br \/>\n* \u5ef6\u8fdf\u4efb\u52a1\u90fd\u53ef\u4ee5\u914d\u7f6e\u5728\u8fd9\u91cc * Kafka\u5c06\u6d88\u606f\u4ece\u3010\u5ef6\u65f6\u4e3b\u9898\u3011\u7ecf\u8fc7\u3010\u5ef6\u65f6\u65f6\u95f4\u3011\u540e\u53d1\u9001\u5230\u3010\u76ee\u6807\u4e3b\u9898\u3011<br \/>\n*\/<br \/>\n@PostConstruct<br \/>\npublic void init() { \/\/\u5ef6\u8fdf30\u79d2<br \/>\nkafkaDelayQueueFactory.listener(\"delay-30-second-topic\", \"delay-30-second-group\", 1 * 30 * 1000, \"delay-60-second-target-topic\");<br \/>\n\/\/\u5ef6\u8fdf60\u79d2<br \/>\nkafkaDelayQueueFactory.listener(\"delay-60-second-topic\", \"delay-60-second-group\", 1 * 60 * 1000, \"delay-60-second-target-topic\");<br \/>\n\/\/\u5ef6\u8fdf30\u5206\u949f<br \/>\nkafkaDelayQueueFactory.listener(\"delay-30-minute-topic\", \"delay-30-minute-group\", 30 * 60 * 1000, \"delay-30-minute-target-topic\");<br \/>\n}<br \/>\n}<\/p><\/div>\n<\/section>\n<\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">09<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 20px;\"><span style=\"letter-spacing: 0.578px;\">\u6d4b\u8bd5<\/span><\/span><\/p>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">1. \u5148\u5f80\u5ef6\u65f6\u4e3b\u9898\u3010delay-60-second-topic\u3011\u53d1\u9001\u4e00\u5343\u6761\u6d88\u606f\uff0c\u4e00\u517110\u4e2a\u5206\u533a\uff0c\u6bcf\u4e2a\u5206\u533a100\u6761\u6d88\u606f\uff0c\u6d88\u606f\u65f6\u95f4\u662f2023-04-21 16:37:26\u5206\uff0c\u5ef6\u8fdf\u6d88\u606f\u6d88\u8d39\u65f6\u95f4\u5c31\u5e94\u8be5\u662f2023-04-21 16:38:26<\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170150656.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.5138888888888888\" data-type=\"png\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170150656.png\" data-ratio=\"0.5138888888888888\" data-type=\"png\" data-w=\"1080\" \/><\/noscript><\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">2. \u5ef6\u65f6\u961f\u5217\u8fdb\u884c\u6d88\u8d39\uff1a\u901a\u8fc7\u65e5\u5fd7\u67e5\u770b\uff0c\u6d88\u606f\u65e5\u671f\u548c\u5ef6\u8fdf\u961f\u5217\u6d88\u8d39\u6d88\u606f\u65f6\u95f4\u6b63\u597d\u76f8\u5dee\u4e00\u5206\u949f<\/p>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170154761.png\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-ratio=\"0.3675925925925926\" data-type=\"png\" data-w=\"1080\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170154761.png\" data-ratio=\"0.3675925925925926\" data-type=\"png\" data-w=\"1080\" \/><\/noscript><\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<section style=\"padding-right: 20px; padding-left: 20px; line-height: 0.8;\">\n<p style=\"text-align: center;\"><span style=\"color: #1aad19; font-size: 24px;\">10<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"letter-spacing: 0px; color: #1aad19; font-size: 20px;\">\u2014<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 20px;\"><span style=\"letter-spacing: 0.578px;\">\u603b\u7ed3<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<p style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<ol class=\"list-paddingleft-1\" style=\"list-style-type: decimal;\">\n<li>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u672c\u6848\u4f8b\u5df2\u6210\u529f\u5b9e\u73b0Kafka\u7684\u5ef6\u65f6\u961f\u5217\uff0c\u5e76\u8fdb\u884c\u5b9e\u6d4b\uff0c\u4ee3\u7801\u5f15\u5165\u53ef\u7528\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">Kafka\u5b9e\u73b0\u7684\u5ef6\u65f6\u961f\u5217\u652f\u6301\u79d2\u7ea7\u522b\u7684\u5ef6\u65f6\u4efb\u52a1\uff0c\u4e0d\u652f\u6301\u6beb\u79d2\u7ea7\u522b\uff0c\u4f46\u662f\u6beb\u79d2\u7ea7\u522b\u7684\u5ef6\u65f6\u4efb\u52a1\u4e5f\u6ca1\u6709\u610f\u4e49<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u6ce8\u610f\u4e00\u4e2a\u4e3b\u9898\u5bf9\u5e94\u7684\u5ef6\u65f6\u65f6\u95f4\u662f\u4e00\u81f4\u7684\uff0c\u4e0d\u80fd\u5728\u540c\u4e00\u4e2a\u4e3b\u9898\u91cc\u653e\u4e0d\u540c\u65f6\u95f4\u7684\u5ef6\u65f6\u4efb\u52a1\u3002<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u6b64\u65b9\u6848\u7684\u7f3a\u70b9\u5c31\u662f\uff0c\u5982\u679c\u6570\u636e\u91cf\u5f88\u5927\uff0c\u4e00\u5b9a\u8981\u4fdd\u8bc1Kafka\u7684\u6d88\u8d39\u80fd\u529b\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5ef6\u8fdf\uff0c\u7cbe\u5ea6\u4e0d\u662f\u7279\u522b\u9ad8\uff0c\u4e0d\u8fc7\u5982\u679c\u5ef6\u8fdf\u5c0f\u65f6\u7ea7\u522b\u7684\u4efb\u52a1\uff0c\u5dee\u5f02\u4e2a\u51e0\u79d2\u79cd\u80af\u5b9a\u53ef\u4ee5\u63a5\u53d7\u7684\uff0c\u4e00\u822c\u573a\u666f\u80af\u5b9a\u6ee1\u8db3\u3002<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-bottom: 0px; letter-spacing: 0.578px; white-space: normal; color: #3e3e3e; font-size: 16px; background-color: #ffffff;\">\n<section>\n<section>\n<p style=\"letter-spacing: 0.578px; white-space: normal;\">\u5b8c\u6574\u4ee3\u7801\u5df2\u7ecf\u7ed9\u5927\u5bb6\u6574\u7406\u597d\u4e86\uff0c\u53ef\u4ee5\u5173\u6ce8\u3010\u5fae\u4fe1\u516c\u4f17\u53f7\u3011\u5fae\u4fe1\u641c\u7d22\u3010\u8001\u677f\u6765\u4e00\u676fjava\u3011\uff0c\u7136\u540e\u3010\u52a0\u7fa4\u3011\u76f4\u63a5\u83b7\u53d6\u6e90\u7801\u3002<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/li>\n<\/ol>\n<p style=\"letter-spacing: 0.578px;\">\n<p style=\"letter-spacing: 0.578px;\">\u597d\u6587\u63a8\u8350\uff1a<\/p>\n<p style=\"letter-spacing: 0.578px;\"><a style=\"letter-spacing: 0.578px;\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUxMjY5NzEyMw==&amp;mid=2247483967&amp;idx=1&amp;sn=fe54b7904bad7d69933681e701f70703&amp;chksm=f9613473ce16bd654ad5312da7772027db31f2af742ff316c9c75a22e6aa0c2f94465e4e90eb&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >2.5\u4e07\u5b57\u8bb2\u89e3DDD\u9886\u57df\u9a71\u52a8\u8bbe\u8ba1\uff0c\u4ece\u7406\u8bba\u5230\u5b9e\u8df5\u638c\u63e1DDD\u5206\u5c42\u67b6\u6784\u8bbe\u8ba1\uff0c\u8d76\u7d27\u6536\u85cf\u8d77\u6765\u5427\uff01<\/a><\/p>\n<p style=\"margin-bottom: 16px; outline: 0px; white-space: normal; background-color: #ffffff; letter-spacing: normal; font-size: 16px; color: #4d4d4d; line-height: 26px; overflow: auto hidden;\"><a style=\"outline: 0px; cursor: pointer;\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUxMjY5NzEyMw==&amp;mid=2247483905&amp;idx=1&amp;sn=0d41bb19e96fe72db59c97ba276ca2e5&amp;chksm=f961344dce16bd5bd9d62e54c2b5e7ac7d4ff8c184de2493c25c6136997f104b3b82f19fc3bd&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >springboot\u4e0b\u4f18\u96c5\u5e72\u6389if else\uff0c\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u901a\u8fc7\u516c\u53f8\u4ee3\u7801\u5ba1\u67e5\uff01\uff01\uff01<\/a><\/p>\n<p style=\"margin-bottom: 16px; outline: 0px; white-space: normal; background-color: #ffffff; letter-spacing: normal; font-size: 16px; color: #4d4d4d; line-height: 26px; overflow: auto hidden;\"><a style=\"outline: 0px; cursor: pointer;\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUxMjY5NzEyMw==&amp;mid=2247483853&amp;idx=1&amp;sn=35b34529296b174ad1b45609121440ea&amp;chksm=f9613781ce16be9723ef0eab9598213734ebe3fd581b8a7f9f4839c6ed67a6010c07c7ea8ed7&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noopener\" data-itemshowtype=\"0\" data-linktype=\"2\" rel=\"nofollow\" >\u4f7f\u7528\u9ad8\u5e76\u53d1\u5229\u5668redis\u2014\u89e3\u51b3\u6dd8\u5b9d\/\u5fae\u535a\u7684\u3010\u70ed\u95e8\u641c\u7d22\u3011\u548c\u3010\u6700\u8fd1\u641c\u7d22\u3011\u7684\u529f\u80fd<\/a><\/p>\n<p style=\"letter-spacing: 0.578px;\"><strong style=\"outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; white-space: normal; background-color: #ffffff;\"><span style=\"outline: 0px; font-weight: 400; letter-spacing: 0.544px; color: #4d4d4d;\">\u66f4\u591a\u597d\u6587\u70b9\u51fb\u4e0b\u65b9<\/span><\/strong><span style=\"outline: 0px; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; color: #ff0000;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px; font-weight: 400; letter-spacing: 0.544px;\">\u3010<\/span><\/strong><strong style=\"outline: 0px;\"><span style=\"outline: 0px; font-weight: 400; letter-spacing: 0.544px;\">\u9605\u8bfb<\/span><\/strong><span style=\"outline: 0px; letter-spacing: 0.544px;\">\u539f\u6587<\/span><strong style=\"outline: 0px;\"><span style=\"outline: 0px; font-weight: 400; letter-spacing: 0.544px;\">\u3011\uff01\uff01\uff01<\/span><\/strong><\/span><\/p>\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: \u8001\u677f\u6765\u4e00\u676fjava<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u201c\u672c\u6587\u7ae0springboot kafka \u5b9e\u73b0\u5ef6\u65f6\u961f\u5217\uff0c\u4f7f\u7528Kafka\u6d88\u8d39\u8005\u7684pause\u51fd\u6570\uff08\u6682\u505c\uff09\u548cresume\u51fd\u6570\uff08\u6062\u590d\uff09+\u7ebf &#8230;<\/p>\n","protected":false},"author":1,"featured_media":3310,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[2,16,34],"tags":[],"class_list":["post-3316","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-kafka","category-34"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170139818-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170142463.png","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170139818-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170139818-1024x435.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170142463.png","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170139818-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170139818-1024x435.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170139818.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170142463.png","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170142463.png","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170144941.png","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170144941.png","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170147782.png","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170147782.png","id":"image5"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170150656.png","id":"image6"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170150656.png","id":"image7"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170154761.png","id":"image8"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/11\/20231102170154761.png","id":"image9"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Java","post_date":"2023-11-02","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":606,"next_post_id":3724,"next_post_title":"Java + lua = \u738b\u70b8\uff01\uff01","previous_post_id":3168,"previous_post_title":"Java8 Stream \u4e00\u884c\u4ee3\u7801\u5b9e\u73b0\u6570\u636e\u5206\u7ec4\u7edf\u8ba1\u3001\u6392\u5e8f\u3001\u6700\u5927\u503c\u3001\u6700\u5c0f\u503c\u3001\u5e73\u5747\u503c\u3001\u603b\u6570\u3001\u5408\u8ba1","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=3316"}],"version-history":[{"count":2,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3316\/revisions"}],"predecessor-version":[{"id":3638,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3316\/revisions\/3638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/3310"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=3316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=3316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=3316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}