{"id":24481,"date":"2025-04-19T10:12:12","date_gmt":"2025-04-19T02:12:12","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/24481.html"},"modified":"2025-04-19T10:12:12","modified_gmt":"2025-04-19T02:12:12","slug":"kafka%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e7%ae%80%e5%8d%95%e9%83%a8%e7%bd%b2%e4%bb%a5%e5%8f%8a%e6%b6%88%e6%81%af%e7%9a%84%e7%94%9f%e4%ba%a7%e3%80%81%e6%b6%88%e8%b4%b9%e3%80%81%e7%9b%91%e6%8e%a7","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/24481.html","title":{"rendered":"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"1.%20%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E5%AE%89%E8%A3%85Kafka-toc\" style=\"margin-left:0px\">1. \u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5Kafka<\/p>\n<p id=\"1.1%20%E7%9B%B4%E6%8E%A5%E5%AE%89%E8%A3%85%EF%BC%88%E5%8F%82%E8%80%83%EF%BC%89-toc\" style=\"margin-left:40px\">1.1 \u76f4\u63a5\u5b89\u88c5<\/p>\n<p id=\"1.2%20%E4%BD%BF%E7%94%A8%E9%95%9C%E5%83%8F%E6%96%B9%E5%BC%8F%E9%85%8D%E7%BD%AE%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8-toc\" style=\"margin-left:40px\">1.2 \u4f7f\u7528\u955c\u50cf\u65b9\u5f0f\u914d\u7f6e\u5230\u670d\u52a1\u5668<\/p>\n<p id=\"1.%20%E5%87%86%E5%A4%87Kafka%E9%95%9C%E5%83%8F-toc\" style=\"margin-left:80px\">1. \u51c6\u5907Kafka\u955c\u50cf<\/p>\n<p id=\"(1)%20%E8%BF%9C%E7%A8%8B%E6%8B%89%E5%8F%96Kafka%E9%95%9C%E5%83%8F-toc\" style=\"margin-left:80px\">(1) \u8fdc\u7a0b\u62c9\u53d6Kafka\u955c\u50cf<\/p>\n<p id=\"(2)%20%E5%9C%A8%E6%9C%AC%E5%9C%B0%E4%B8%8B%E8%BD%BD%E9%95%9C%E5%83%8F%E5%B9%B6%E4%B8%8A%E4%BC%A0%E8%87%B3%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8-toc\" style=\"margin-left:80px\">(2) \u5728\u672c\u5730\u4e0b\u8f7d\u955c\u50cf\u5e76\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u542f\u52a8<\/p>\n<p id=\"-toc\" style=\"margin-left:40px\">\n<p id=\"2.%20%E5%88%9B%E5%BB%BA%E9%85%8D%E7%BD%AE%E7%9B%AE%E5%BD%95-toc\" style=\"margin-left:80px\">2. \u521b\u5efa\u914d\u7f6e\u76ee\u5f55<\/p>\n<p id=\"1.%203%20%E7%BC%96%E5%86%99Docker%20Compose%E6%96%87%E4%BB%B6-toc\" style=\"margin-left:40px\">1. 3 \u7f16\u5199Docker Compose\u6587\u4ef6<\/p>\n<p id=\"1.%204%20%E5%90%AF%E5%8A%A8Kafka%E6%9C%8D%E5%8A%A1-toc\" style=\"margin-left:40px\">1. 4 \u542f\u52a8Kafka\u670d\u52a1<\/p>\n<p id=\"(2)%20%E6%B5%8B%E8%AF%95Kafka%E6%9C%8D%E5%8A%A1-toc\" style=\"margin-left:80px\">(2) \u6d4b\u8bd5Kafka\u670d\u52a1<\/p>\n<p id=\"2.%20%E5%9C%A8%E9%A1%B9%E7%9B%AE%E4%B8%AD%E8%BF%9B%E8%A1%8C%E8%B0%83%E7%94%A8-toc\" style=\"margin-left:0px\">2. \u5728\u9879\u76ee\u4e2d\u8fdb\u884c\u8c03\u7528<\/p>\n<p id=\"2.1%C2%A0%E6%B6%88%E6%81%AF%E7%9A%84%E7%94%9F%E4%BA%A7%EF%BC%9A-toc\" style=\"margin-left:40px\">2.1\u00a0\u6d88\u606f\u7684\u751f\u4ea7&#xff1a;<\/p>\n<p id=\"%EF%BC%881%EF%BC%89%E9%A6%96%E5%85%88%E5%AE%89%E8%A3%85%20Confluent.Kafka%20%E5%BA%93%EF%BC%88NuGet%20%E5%8C%85%EF%BC%89-toc\" style=\"margin-left:80px\">&#xff08;1&#xff09;\u9996\u5148\u5b89\u88c5 Confluent.Kafka \u5e93&#xff08;NuGet \u5305&#xff09;<\/p>\n<p id=\"%EF%BC%882%EF%BC%89%E5%90%91Kafka%E6%89%80%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%94%9F%E4%BA%A7%E6%B6%88%E6%81%AF%EF%BC%9A-toc\" style=\"margin-left:80px\">&#xff08;2&#xff09;\u5411Kafka\u6240\u5728\u670d\u52a1\u5668\u751f\u4ea7\u6d88\u606f&#xff1a;<\/p>\n<p id=\"2.2%20%E6%B6%88%E6%81%AF%E7%9A%84%E6%B6%88%E8%B4%B9%EF%BC%9A-toc\" style=\"margin-left:40px\">2.2 \u6d88\u606f\u7684\u6d88\u8d39&#xff1a;<\/p>\n<p id=\"3.%20%E8%87%AA%E5%AE%9A%E4%B9%89Kafka%E7%9B%91%E6%8E%A7-toc\" style=\"margin-left:0px\">3. \u81ea\u5b9a\u4e49Kafka\u76d1\u63a7<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"1.%20%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E5%AE%89%E8%A3%85Kafka\">1. \u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5Kafka<\/h2>\n<p>\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5Kafka\u67092\u79cd\u65b9\u5f0f&#xff1a;<\/p>\n<h3 id=\"1.1%20%E7%9B%B4%E6%8E%A5%E5%AE%89%E8%A3%85%EF%BC%88%E5%8F%82%E8%80%83%EF%BC%89\">1.1 \u76f4\u63a5\u5b89\u88c5<\/h3>\n<p>\u672c\u6b21\u5b89\u88c5\u6ca1\u6709\u6d89\u53ca\u5230\u670d\u52a1\u5668\u76f4\u63a5\u5b89\u88c5&#xff0c;\u53ef\u53c2\u8003Kafka &#xff08;\u5feb\u901f&#xff09;\u5b89\u88c5\u90e8\u7f72_kafka\u5b89\u88c5-CSDN\u535a\u5ba2<\/p>\n<h3 id=\"1.2%20%E4%BD%BF%E7%94%A8%E9%95%9C%E5%83%8F%E6%96%B9%E5%BC%8F%E9%85%8D%E7%BD%AE%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8\">1.2 \u4f7f\u7528\u955c\u50cf\u65b9\u5f0f\u914d\u7f6e\u5230\u670d\u52a1\u5668<\/h3>\n<h4 id=\"1.%20%E5%87%86%E5%A4%87Kafka%E9%95%9C%E5%83%8F\">1. \u51c6\u5907Kafka\u955c\u50cf<\/h4>\n<\/p>\n<h4 id=\"(1)%20%E8%BF%9C%E7%A8%8B%E6%8B%89%E5%8F%96Kafka%E9%95%9C%E5%83%8F\">(1) \u8fdc\u7a0b\u62c9\u53d6Kafka\u955c\u50cf<\/h4>\n<p>\u5b98\u65b9Kafka\u955c\u50cf\u53ef\u4ee5\u4eceConfluent\u7684Docker\u955c\u50cf\u5e93\u83b7\u53d6\u3002\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<\/p>\n<p>docker pull confluentinc\/cp-kafka:latest<\/p>\n<p>docker pull confluentinc\/cp-zookeeper:latest <\/p>\n<p>\u5982\u679c\u52a0\u901f\u5668\u65e0\u6548&#xff0c;\u4e5f\u53ef\u4ee5\u901a\u8fc7\u79bb\u7ebf\u4e0b\u8f7d\u548c\u4e0a\u4f20\u7684\u65b9\u5f0f\u89e3\u51b3\u3002<\/p>\n<h4 id=\"(2)%20%E5%9C%A8%E6%9C%AC%E5%9C%B0%E4%B8%8B%E8%BD%BD%E9%95%9C%E5%83%8F%E5%B9%B6%E4%B8%8A%E4%BC%A0%E8%87%B3%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%90%AF%E5%8A%A8\">(2) \u5728\u672c\u5730\u4e0b\u8f7d\u955c\u50cf\u5e76\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\u542f\u52a8<\/h4>\n<p>1. \u5728\u7f51\u7edc\u7545\u901a\u7684\u672c\u5730\u673a\u5668\u4e0a\u62c9\u53d6Kafka\u955c\u50cf\u548czookeeper\u955c\u50cf&#xff1a;<\/p>\n<p>docker pull confluentinc\/cp-zookeeper:latest <\/p>\n<p>docker pull confluentinc\/cp-kafka:latest <\/p>\n<p>\u4fdd\u5b58\u955c\u50cf\u5230\u6587\u4ef6&#xff1a;<\/p>\n<p>docker save confluentinc\/cp-zookeeper:latest -o cp-zookeeper.tar <\/p>\n<p>docker save confluentinc\/cp-kafka:latest -o cp-kafka.tar <\/p>\n<p>2. \u4e0a\u4f20\u5230\u670d\u52a1\u5668<\/p>\n<p>\u901a\u8fc7scp\u6216\u5176\u4ed6\u5de5\u5177\u5c06\u955c\u50cf\u6587\u4ef6\u4e0a\u4f20\u5230\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>scp cp-kafka.tar user&#064;server_ip:\/path\/to\/destination <\/p>\n<p>3. \u5728\u670d\u52a1\u5668\u4e0a\u52a0\u8f7d\u955c\u50cf<\/p>\n<p>\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u52a0\u8f7d\u955c\u50cf&#xff1a;<\/p>\n<p>docker load -i \/path\/to\/destination\/cp-zookeeper.tar <\/p>\n<p>docker load -i \/path\/to\/destination\/cp-kafka.tar <\/p>\n<h3><\/h3>\n<h4 id=\"2.%20%E5%88%9B%E5%BB%BA%E9%85%8D%E7%BD%AE%E7%9B%AE%E5%BD%95\">2. \u521b\u5efa\u914d\u7f6e\u76ee\u5f55<\/h4>\n<p>\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u7528\u4e8e\u5b58\u653eKafka\u7684Docker Compose\u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p>mkdir kafka-docker cd kafka-docker <\/p>\n<hr \/>\n<h3 id=\"1.%203%20%E7%BC%96%E5%86%99Docker%20Compose%E6%96%87%E4%BB%B6\">1. 3 \u7f16\u5199Docker Compose\u6587\u4ef6<\/h3>\n<p>\u521b\u5efadocker-compose.yml\u6587\u4ef6&#xff0c;\u6587\u4ef6\u5185\u5bb9&#xff1a;<\/p>\n<p>version: &#039;3.7&#039;<br \/>\nservices:<br \/>\n  zookeeper:<br \/>\n    image: confluentinc\/cp-zookeeper:latest<br \/>\n    container_name: zookeeper<br \/>\n    environment:<br \/>\n      ZOOKEEPER_CLIENT_PORT: 2181<br \/>\n      ZOOKEEPER_TICK_TIME: 2000<br \/>\n    ports:<br \/>\n      &#8211; &#034;2181:2181&#034;<\/p>\n<p>  kafka:<br \/>\n    image: confluentinc\/cp-kafka:latest<br \/>\n    container_name: kafka<br \/>\n    ports:<br \/>\n      &#8211; &#034;9092:9092&#034;<br \/>\n    environment:<br \/>\n      KAFKA_BROKER_ID: 1<br \/>\n      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181<br \/>\n      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT:\/\/&lt;server_ip&gt;:9092<br \/>\n      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1<br \/>\n    depends_on:<br \/>\n      &#8211; zookeeper<\/p>\n<p>\u5c06&lt;server_ip&gt;\u66ff\u6362\u4e3a\u670d\u52a1\u5668\u7684\u5b9e\u9645IP\u5730\u5740\u3002<\/p>\n<h3 id=\"1.%204%20%E5%90%AF%E5%8A%A8Kafka%E6%9C%8D%E5%8A%A1\">1. 4 \u542f\u52a8Kafka\u670d\u52a1<\/h3>\n<p>\u5728kafka-docker\u76ee\u5f55\u4e0b\u8fd0\u884c&#xff1a;<\/p>\n<p>docker-compose up -d <\/p>\n<p>\u4e0a\u9762\u547d\u4ee4\u53ef\u80fd\u5728Linux\u67d0\u4e9b\u7248\u672c\u4e2d\u4e0d\u9002\u7528&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4&#xff1a;<\/p>\n<p>docker compose up -d <\/p>\n<p>(1) \u9a8c\u8bc1\u670d\u52a1\u72b6\u6001<\/p>\n<p>\u67e5\u770b\u8fd0\u884c\u4e2d\u7684\u5bb9\u5668&#xff1a;<\/p>\n<p>docker ps <\/p>\n<p>\u786e\u4fddzookeeper\u548ckafka\u5bb9\u5668\u90fd\u5df2\u542f\u52a8\u3002<\/p>\n<h4 id=\"(2)%20%E6%B5%8B%E8%AF%95Kafka%E6%9C%8D%E5%8A%A1\">(2) \u6d4b\u8bd5Kafka\u670d\u52a1<\/h4>\n<p>\u8fdb\u5165Kafka\u5bb9\u5668&#xff1a;<\/p>\n<p>docker exec -it kafka bash <\/p>\n<p>\u5728\u5bb9\u5668\u5185\u521b\u5efa\u4e00\u4e2a\u4e3b\u9898&#xff08;\u5982\u679c\u662f\u5bb9\u5668\u65b9\u5f0f\u90e8\u7f72&#xff0c;\u4e00\u822ckafka-topics.sh\u547d\u4ee4\u4f1a\u65e0\u6548&#xff0c;\u56e0\u4e3a\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f Kafka \u955c\u50cf&#xff08;\u4f8b\u5982\u901a\u8fc7 Docker \u8fd0\u884c Kafka&#xff09;&#xff0c;\u90a3\u4e48 Kafka \u7684\u547d\u4ee4\u884c\u5de5\u5177&#xff08;\u5982 kafka-topics.sh&#xff09;\u901a\u5e38\u4e0d\u4f1a\u76f4\u63a5\u66b4\u9732\u5728\u4e3b\u673a\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u3002\u4f46\u662f\u53ef\u4ee5\u5728 Docker \u5bb9\u5668\u4e2d\u6267\u884c\u547d\u4ee4\u5728 Docker \u73af\u5883\u4e2d\u4f7f\u7528 Kafka \u7684\u547d\u4ee4\u884c\u5de5\u5177\u6765\u67e5\u770b Topic \u548c\u5176\u4ed6\u64cd\u4f5c&#xff0c;\u8fd9\u91cc\u4e0d\u505a\u8d58\u8ff0&#xff09;&#xff1a;<\/p>\n<p>kafka-topics &#8211;create &#8211;topic test-topic &#8211;bootstrap-server localhost:9092 &#8211;partitions 1 &#8211;repl <\/p>\n<p>\u81f3\u6b64&#xff0c;\u670d\u52a1\u5668\u4e0a\u7684Kafka\u670d\u52a1\u5c31\u53ef\u4ee5\u901a\u8fc7\u955c\u50cf\u5bb9\u5668\u7684\u65b9\u5f0f\u5411\u5916\u63d0\u4f9b\u4e86&#xff0c;\u6b64\u65f6\u5916\u90e8\u53ef\u4ee5\u901a\u8fc7IP\u548cKafka\u7684\u7aef\u53e3\u53f7\u5411Kafka\u751f\u4ea7\u6d88\u606f\u548c\u6d88\u8d39\u6d88\u606f\u3002<\/p>\n<h2 id=\"2.%20%E5%9C%A8%E9%A1%B9%E7%9B%AE%E4%B8%AD%E8%BF%9B%E8%A1%8C%E8%B0%83%E7%94%A8\">2. \u5728\u9879\u76ee\u4e2d\u8fdb\u884c\u8c03\u7528<\/h2>\n<h3 id=\"2.1%C2%A0%E6%B6%88%E6%81%AF%E7%9A%84%E7%94%9F%E4%BA%A7%EF%BC%9A\">2.1\u00a0\u6d88\u606f\u7684\u751f\u4ea7&#xff1a;<\/h3>\n<p>\u4ee5C#\u8bed\u8a00\u4e3a\u4f8b&#xff1a;<\/p>\n<h4 id=\"%EF%BC%881%EF%BC%89%E9%A6%96%E5%85%88%E5%AE%89%E8%A3%85%20Confluent.Kafka%20%E5%BA%93%EF%BC%88NuGet%20%E5%8C%85%EF%BC%89\">&#xff08;1&#xff09;\u9996\u5148\u5b89\u88c5 Confluent.Kafka \u5e93&#xff08;NuGet \u5305&#xff09;<\/h4>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d&#xff0c;\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5&#xff1a;<\/p>\n<p>dotnet add package Confluent.Kafka <\/p>\n<p>\u6216\u8005\u4e5f\u53ef\u4ee5\u901a\u8fc7 Visual Studio \u7684 NuGet \u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5\u3002<\/p>\n<h4 id=\"%EF%BC%882%EF%BC%89%E5%90%91Kafka%E6%89%80%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%94%9F%E4%BA%A7%E6%B6%88%E6%81%AF%EF%BC%9A\">&#xff08;2&#xff09;\u5411Kafka\u6240\u5728\u670d\u52a1\u5668\u751f\u4ea7\u6d88\u606f&#xff1a;<\/h4>\n<p>[Description(&#034;Kafka\u6d4b\u8bd5&#034;)]<br \/>\n[HttpPost]<br \/>\npublic void ScanDataUseKafka()<br \/>\n{<br \/>\n    \/\/ Kafka \u670d\u52a1\u5668\u7684\u5730\u5740&#xff08;\u66ff\u6362\u4e3a\u60a8\u7684\u670d\u52a1\u5668 IP \u6216\u4e3b\u673a\u540d&#xff09;<br \/>\n    string bootstrapServers &#061; &#034;IP:port&#034;;<br \/>\n    string topic &#061; &#034;test-topic&#034;;<\/p>\n<p>    \/\/ \u914d\u7f6e Kafka Producer<br \/>\n    var config &#061; new ProducerConfig<br \/>\n    {<br \/>\n        BootstrapServers &#061; bootstrapServers<br \/>\n    };<\/p>\n<p>    \/\/ \u521b\u5efa Producer<br \/>\n    using (var producer &#061; new ProducerBuilder&lt;Null, string&gt;(config).Build())<br \/>\n    {<br \/>\n        try<br \/>\n        {<br \/>\n            string message &#061; &#034;Hello Kafka !&#034;;<br \/>\n            \/\/ \u53d1\u9001\u6d88\u606f<br \/>\n            var result &#061; producer.ProduceAsync(topic, new Message&lt;Null, string&gt; { Value &#061; message }).GetAwaiter().GetResult();<br \/>\n            Console.WriteLine($&#034;\u6d88\u606f\u53d1\u9001\u6210\u529f: {result.TopicPartitionOffset}&#034;);<br \/>\n            \/*}*\/<br \/>\n        }<br \/>\n        catch (ProduceException&lt;Null, string&gt; ex)<br \/>\n        {<br \/>\n            Console.WriteLine($&#034;\u6d88\u606f\u53d1\u9001\u5931\u8d25: {ex.Error.Reason}&#034;);<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<h3 id=\"2.2%20%E6%B6%88%E6%81%AF%E7%9A%84%E6%B6%88%E8%B4%B9%EF%BC%9A\">2.2 \u6d88\u606f\u7684\u6d88\u8d39&#xff1a;<\/h3>\n<p>[Description(&#034;Kafka\u6d88\u8d39\u6d4b\u8bd5&#034;)]<br \/>\n[HttpPost]<br \/>\npublic void KafkaConsumer()<br \/>\n{<br \/>\n    \/\/ Kafka \u914d\u7f6e<br \/>\n    var config &#061; new ConsumerConfig<br \/>\n    {<br \/>\n        BootstrapServers &#061; &#034;IP:port&#034;,  \/\/ Kafka Broker \u5730\u5740<br \/>\n        GroupId &#061; &#034;test-consumer-group&#034;,      \/\/ \u6d88\u8d39\u8005\u7ec4 ID<br \/>\n        AutoOffsetReset &#061; AutoOffsetReset.Earliest \/\/ \u8bbe\u7f6e\u6d88\u606f\u6d88\u8d39\u504f\u79fb\u91cf\u7684\u8d77\u59cb\u70b9&#xff0c;Earliest \u4ece\u6700\u65e9\u6d88\u606f\u5f00\u59cb\u6d88\u8d39&#xff0c;Latest \u4ece\u6700\u65b0\u7684\u6d88\u606f\u5f00\u59cb\u6d88\u8d39<br \/>\n    };<\/p>\n<p>    \/\/ \u521b\u5efa Kafka \u6d88\u8d39\u8005\u5b9e\u4f8b<br \/>\n    using (var consumer &#061; new ConsumerBuilder&lt;Ignore, string&gt;(config).Build())<br \/>\n    {<br \/>\n        \/\/ \u8ba2\u9605\u6307\u5b9a\u7684 Topic<br \/>\n        consumer.Subscribe(&#034;test-topic&#034;);  \/\/ \u8fd9\u91cc\u66ff\u6362\u4e3a\u4f60\u9700\u8981\u6d88\u8d39\u7684 Topic \u540d\u79f0<\/p>\n<p>        CancellationTokenSource cts &#061; new CancellationTokenSource();<br \/>\n        Console.CancelKeyPress &#043;&#061; (_, e) &#061;&gt;<br \/>\n        {<br \/>\n            e.Cancel &#061; true;<br \/>\n            cts.Cancel(); \/\/ \u5f53\u6309\u4e0b Ctrl&#043;C \u65f6\u505c\u6b62\u6d88\u8d39<br \/>\n        };<\/p>\n<p>        try<br \/>\n        {<br \/>\n            while (!cts.Token.IsCancellationRequested)<br \/>\n            {<br \/>\n                try<br \/>\n                {<br \/>\n                    \/\/ \u62c9\u53d6\u6d88\u606f<br \/>\n                    var consumeResult &#061; consumer.Consume(cts.Token);<\/p>\n<p>                    \/\/ \u8f93\u51fa\u6d88\u606f\u5185\u5bb9<br \/>\n                    Console.WriteLine($&#034;Received message: {consumeResult.Message.Value} from topic {consumeResult.Topic} partition {consumeResult.Partition} offset {consumeResult.Offset}&#034;);<br \/>\n                }<br \/>\n                catch (ConsumeException e)<br \/>\n                {<br \/>\n                    Console.WriteLine($&#034;Error occurred: {e.Error.Reason}&#034;);<br \/>\n                }<br \/>\n            }<br \/>\n        }<br \/>\n        catch (OperationCanceledException)<br \/>\n        {<br \/>\n            \/\/ \u6355\u83b7\u53d6\u6d88\u64cd\u4f5c\u5f02\u5e38<br \/>\n            Console.WriteLine(&#034;Consuming has been canceled.&#034;);<br \/>\n        }<br \/>\n        finally<br \/>\n        {<br \/>\n            \/\/ \u786e\u4fdd\u6d88\u8d39\u8005\u5173\u95ed<br \/>\n            consumer.Close();<br \/>\n        }<\/p>\n<p>    }<\/p>\n<p>} <\/p>\n<h2 id=\"3.%20%E8%87%AA%E5%AE%9A%E4%B9%89Kafka%E7%9B%91%E6%8E%A7\">3. \u81ea\u5b9a\u4e49Kafka\u76d1\u63a7<\/h2>\n<p> \u76ee\u524d\u5df2\u7ecf\u6709Kafka\u76d1\u63a7\u5de5\u5177Kafka Manager\u3001Kafka Tools\u7b49\u7b49&#xff0c;\u4f46\u4e5f\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u7684\u4f7f\u7528\u8981\u6c42\u548c\u4e1a\u52a1\u7279\u5f81\u5bf9Kafka\u6570\u636e\u7684\u751f\u4ea7\u548c\u6d88\u8d39\u8fdb\u884c\u76d1\u63a7&#xff0c;\u518d\u590d\u6742\u4e00\u70b9\u8fd8\u53ef\u4ee5\u81ea\u5df1\u5f00\u53d1\u72ec\u7acb\u7684Kafka\u76d1\u63a7\u7f51\u9875\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u901a\u8fc7C#\u4ee3\u7801\u76d1\u63a7KafkaTopic\u3001\u8282\u70b9\u3001\u5806\u79ef\u91cf\u3001\u504f\u79fb\u91cf\u7b49\u7684\u7b80\u5355\u5e94\u7528&#xff1a;<\/p>\n<p>[Description(&#034;Kafka\u6d88\u8d39\u76d1\u89c6&#034;)]<br \/>\n[HttpPost]<br \/>\npublic void KafkaConsumeMonitorss()<br \/>\n{<br \/>\n    \/\/ Kafka \u670d\u52a1\u5668\u7684\u5730\u5740<br \/>\n    string bootstrapServers &#061; &#034;IP:port&#034;;<\/p>\n<p>    \/\/ \u914d\u7f6e AdminClient&#xff08;\u7528\u4e8e\u67e5\u8be2\u5143\u6570\u636e&#xff09;<br \/>\n    var config &#061; new AdminClientConfig<br \/>\n    {<br \/>\n        BootstrapServers &#061; bootstrapServers<br \/>\n    };<\/p>\n<p>    \/\/ \u521b\u5efa AdminClient \u5b9e\u4f8b<br \/>\n    using (var adminClient &#061; new AdminClientBuilder(config).Build())<br \/>\n    {<br \/>\n        try<br \/>\n        {<br \/>\n            \/\/ \u83b7\u53d6 Kafka \u96c6\u7fa4\u7684\u5143\u6570\u636e&#xff08;\u6240\u6709\u4e3b\u9898\u548c\u5206\u533a\u4fe1\u606f&#xff09;<br \/>\n            var metadata &#061; adminClient.GetMetadata(TimeSpan.FromSeconds(10));<\/p>\n<p>            Console.WriteLine($&#034;Kafka \u96c6\u7fa4\u5305\u542b {metadata.Topics.Count} \u4e2a\u4e3b\u9898&#xff1a;&#034;);<\/p>\n<p>            \/\/ \u904d\u5386\u6240\u6709\u4e3b\u9898<br \/>\n            foreach (var topicMetadata in metadata.Topics)<br \/>\n            {<br \/>\n                string topic &#061; topicMetadata.Topic;<br \/>\n                Console.WriteLine($&#034;\\\\n\u4e3b\u9898: {topic}&#034;);<\/p>\n<p>                \/\/ \u904d\u5386\u4e3b\u9898\u7684\u6240\u6709\u5206\u533a<br \/>\n                foreach (var partitionMetadata in topicMetadata.Partitions)<br \/>\n                {<br \/>\n                    var partition &#061; partitionMetadata.PartitionId;<\/p>\n<p>                    \/\/ \u83b7\u53d6\u5206\u533a\u7684\u6700\u65b0\u504f\u79fb\u91cf&#xff08;log end offset&#xff09;<br \/>\n                    using (var consumer &#061; new ConsumerBuilder&lt;Ignore, string&gt;(new ConsumerConfig<br \/>\n                    {<br \/>\n                        BootstrapServers &#061; bootstrapServers,<br \/>\n                        GroupId &#061; &#034;test-consumer-group&#034;, \/\/ \u6d88\u8d39\u8005\u7ec4\u540d\u79f0<br \/>\n                        AutoOffsetReset &#061; AutoOffsetReset.Earliest<br \/>\n                    }).Build())<br \/>\n                    {<br \/>\n                        var highwaterMark &#061; consumer.QueryWatermarkOffsets(new TopicPartition(topic, partition), TimeSpan.FromSeconds(5));<br \/>\n                        var logEndOffset &#061; highwaterMark.High;<\/p>\n<p>                        \/\/ \u83b7\u53d6\u6d88\u8d39\u8005\u7684\u5f53\u524d\u504f\u79fb\u91cf&#xff08;consumer offset&#xff09;<br \/>\n                        var consumerOffsets &#061; consumer.Committed(new List&lt;TopicPartition&gt; { new TopicPartition(topic, partition) }, TimeSpan.FromSeconds(5));<br \/>\n                        var consumerOffset &#061; consumerOffsets[0]?.Offset ?? Offset.Unset.Value;<\/p>\n<p>                        \/\/ \u5982\u679c\u6ca1\u6709\u6d88\u8d39\u8fc7&#xff0c;\u8bbe\u7f6e consumerOffset \u4e3a 0<br \/>\n                        if (consumerOffset &lt; 0)<br \/>\n                        {<br \/>\n                            consumerOffset &#061; 0;<br \/>\n                        }<\/p>\n<p>                        \/\/ \u8ba1\u7b97\u5806\u79ef\u6570\u91cf<br \/>\n                        var backlog &#061; logEndOffset &#8211; consumerOffset;<\/p>\n<p>                        Console.WriteLine($&#034;  \u5206\u533a {partition}:&#034;);<br \/>\n                        Console.WriteLine($&#034;    Log End Offset: {logEndOffset}&#034;);<br \/>\n                        Console.WriteLine($&#034;    Consumer Offset: {consumerOffset}&#034;);<br \/>\n                        Console.WriteLine($&#034;    Message Backlog: {backlog}&#034;);<br \/>\n                    }<br \/>\n                }<br \/>\n            }<br \/>\n        }<br \/>\n        catch (Exception ex)<br \/>\n        {<br \/>\n            Console.WriteLine($&#034;\u53d1\u751f\u9519\u8bef: {ex.Message}&#034;);<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<p>\u5982\u679c\u9700\u8981\u76d1\u63a7Kafka\u5404\u8fc7\u7a0b\u4e2d\u7684\u66f4\u591a\u7684\u53c2\u6570\u548c\u6307\u6807&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4e0e\u4e0a\u9762\u7684\u76f8\u4f3c\u7684\u6216\u76f8\u8fd1\u7684\u7c7b\u6216\u8005\u65b9\u6cd5\u8fdb\u884c\u62d3\u5c55\u6765\u83b7\u53d6\u66f4\u591a\u7684\u53c2\u6570\u548c\u6307\u6807\u3002\u6b64\u5916\u5bf9\u4e8eC#\u800c\u8a00&#xff0c;C#\u4e2d\u7684Confluent.Kafka\u5e93&#xff08;Nuget\u5305&#xff09;\u4e5f\u4f1a\u6301\u7eed\u66f4\u65b0&#xff0c;\u540e\u9762\u4f1a\u6709\u66f4\u591a\u7684\u7279\u6027\u652f\u6301&#xff0c;\u4f7fC#\u5bf9\u63a5Kafka\u7684\u76d1\u63a7\u66f4\u52a0\u7ec6\u5316\u548c\u5b8c\u5584\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u672c\u6587\u5206\u4e3a\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5Kafka\u3001\u5728\u9879\u76ee\u4e2d\u8fdb\u884c\u8c03\u7528\u3001\u81ea\u5b9a\u4e49Kafka\u76d1\u63a7\u4e09\u90e8\u5206\u5bf9\u4e8eKafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7\u3002_kafka\u670d\u52a1\u5668<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,59,27,1114,58,1898,43],"topic":[],"class_list":["post-24481","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-centos","tag-docker","tag-kafka","tag-linux","tag-zookeeper","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/24481.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u672c\u6587\u5206\u4e3a\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5Kafka\u3001\u5728\u9879\u76ee\u4e2d\u8fdb\u884c\u8c03\u7528\u3001\u81ea\u5b9a\u4e49Kafka\u76d1\u63a7\u4e09\u90e8\u5206\u5bf9\u4e8eKafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7\u3002_kafka\u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/24481.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-19T02:12:12+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/24481.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/24481.html\",\"name\":\"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T02:12:12+00:00\",\"dateModified\":\"2025-04-19T02:12:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/24481.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/24481.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/24481.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/24481.html","og_locale":"zh_CN","og_type":"article","og_title":"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf8\u6b21\u3002\u672c\u6587\u5206\u4e3a\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5Kafka\u3001\u5728\u9879\u76ee\u4e2d\u8fdb\u884c\u8c03\u7528\u3001\u81ea\u5b9a\u4e49Kafka\u76d1\u63a7\u4e09\u90e8\u5206\u5bf9\u4e8eKafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7\u3002_kafka\u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/24481.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T02:12:12+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/24481.html","url":"https:\/\/www.wsisp.com\/helps\/24481.html","name":"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T02:12:12+00:00","dateModified":"2025-04-19T02:12:12+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/24481.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/24481.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/24481.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Kafka\u670d\u52a1\u5668\u7684\u7b80\u5355\u90e8\u7f72\u4ee5\u53ca\u6d88\u606f\u7684\u751f\u4ea7\u3001\u6d88\u8d39\u3001\u76d1\u63a7"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/24481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=24481"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/24481\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=24481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=24481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=24481"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=24481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}