{"id":246390,"date":"2020-12-19T04:08:48","date_gmt":"2020-12-18T20:08:48","guid":{"rendered":"http:\/\/4563.org\/?p=246390"},"modified":"2020-12-19T04:08:48","modified_gmt":"2020-12-18T20:08:48","slug":"java-kafka-%e5%ae%a2%e6%88%b7%e7%ab%af%e6%b1%82%e5%8a%a9%e5%b8%96","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=246390","title":{"rendered":"Java Kafka \u5ba2\u6237\u7aef\u6c42\u52a9\u5e16"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Java Kafka \u5ba2\u6237\u7aef\u6c42\u52a9\u5e16               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lancelee01 <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u770b\u5230\u597d\u591a\u6587\u7ae0\uff0c\u91cc\u90fd\u6709\u4f4e\u7ea7 API\uff0cSimpleConsumer\uff0c\u5305\u62ec\u5b98\u7f51\uff0c\u4f46\u662f kafka-client.jar \uff08\u7248\u672c 0.10.0.0 \uff09\u91cc\u7ffb\u4e86\u4e2a\u904d\u4e5f\u6ca1\u627e\u5230\uff0c\u5e0c\u671b\u6709\u5927\u4f6c\u80fd\u591f\u89e3\u60d1\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u662f scala \u4ee3\u7801\u95ee\u9898\uff0c\u300a Kafka \u6e90\u7801\u89e3\u6790\u4e0e\u5b9e\u6218\u300b\u4e00\u4e66\u4e2d kafka.javaapi.producer.Producer \u662f\u5bf9 kafka.producer.Producer \u7684\u5305\u88c5\uff0c\u800c\u540e\u8005\u662f scala \u5199\u7684\u3002\u4f46\u662f\u540c\u6837\u6ca1\u6709\u627e\u5230\uff0c\u4e00\u822c scala \u5199\u7684\u4ee3\u7801\u5728 jar \u5305\u91cc\u5b57\u8282\u7801\u6587\u4ef6\u540d\u662f\u4ee5$\u7ed3\u5c3e\uff0c\u6574\u4e2a client \u7684 jar \u5305\u91cc\u6ca1\u6709$\u7ed3\u5c3e\u7684\u5b57\u8282\u7801\u6587\u4ef6\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4801848\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dai875939260 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             SimpleConsumer \u4e0d\u662f\u5728 client \u5305\u91cc\u5427\uff0c\u5e94\u8be5\u662f\u5728 server \u91cc\u7684\uff0c\u4e0d\u8fc7\u65b0\u7248\u672c\u597d\u50cf\u4e5f\u662f\u88ab\u5220\u9664\u4e86 https:\/\/github.com\/apache\/kafka\/pull\/5230\/files?file-filters%5B%5D=.scala#diff-7d28cdf667cc207b964e7139f75740ce7a0e847e552ad8abf05646caf1cacfe2                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4801849\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dai875939260 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             2.0 \u624d\u5f00\u59cb\u5220\u9664\u7684\uff0c1.1 \u8fd8\u662f\u6709\u7684 https:\/\/github.com\/apache\/kafka\/blob\/1.1\/core\/src\/main\/scala\/kafka\/consumer\/SimpleConsumer.scala                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4801850\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : lancelee01 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @dai875939260 \u627e\u5230\u4e86\uff0c\u8c22\u8c22\u5927\u4f6c\uff0c\u539f\u6765\u4e0d\u662f kafka-client \u554a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Java Kafka \u5ba2\u6237\u7aef\u6c42\u52a9\u5e16&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/246390"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=246390"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/246390\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=246390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=246390"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=246390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}