{"id":259705,"date":"2022-12-26T09:00:47","date_gmt":"2022-12-26T01:00:47","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=259705"},"modified":"2023-03-27T10:31:29","modified_gmt":"2023-03-27T02:31:29","slug":"kotlin-ktor-2023","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/kotlin-ktor-2023.html","title":{"rendered":"Kotlin \u5f02\u6b65\u6846\u67b6 Ktor 2023 \u8def\u7ebf\u56fe\u516c\u5e03"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nKtor \u662f\u4e00\u4e2a\u5f02\u6b65\u6846\u67b6\uff0c\u7528\u4e8e\u521b\u5efa\u5fae\u670d\u52a1\u3001Web \u5e94\u7528\u7b49\u3002\u4ece\u5934\u5230\u5c3e\u90fd\u662f\u7528 Kotlin \u7f16\u5199\u7684\u3002Ktor \u56e2\u961f\u8fd1\u65e5\u786e\u5b9a\u4e86 2023 \u5e74 Ktor \u7684\u8def\u7ebf\u56fe\uff0c\u5e76\u5c06\u4e13\u6ce8\u4e8e 3.0.0 \u7248\u672c\u7684\u53d1\u5e03\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/a><\/p>\n

Ktor \u662f\u4e00\u4e2a\u5f02\u6b65\u6846\u67b6\uff0c\u7528\u4e8e\u521b\u5efa\u5fae\u670d\u52a1\u3001Web \u5e94\u7528\u7b49\u3002\u4ece\u5934\u5230\u5c3e\u90fd\u662f\u7528 Kotlin \u7f16\u5199\u7684\u3002Ktor \u56e2\u961f\u8fd1\u65e5\u786e\u5b9a\u4e86 2023 \u5e74 Ktor \u7684\u8def\u7ebf\u56fe\uff0c\u5e76\u5c06\u4e13\u6ce8\u4e8e 3.0.0 \u7248\u672c\u7684\u53d1\u5e03\u3002\u867d\u7136\u4e00\u4e2a\u4e3b\u8981\u7248\u672c\u901a\u5e38\u901a\u5e38\u4f1a\u5e26\u6765\u91cd\u5927\u7684\u53d8\u5316\uff0c\u4f46 Ktor 3.0.0 \u5927\u591a\u6570\u53d8\u5316\u662f\u5173\u4e8e API \u548c\u5305\uff0c\u7279\u522b\u662f\uff1a<\/p>\n

    \n
  1. \u5c06\u53d1\u5e03\u4e00\u76f4\u5728\u7814\u7a76\u7684\u65b0\u7684\u7b80\u5316\u8def\u7531 API\u3002<\/li>\n
  2. \u8981\u5207\u6362\u5230 Tomcat 11\u3001Jetty 11\uff0c\u5e76\u5347\u7ea7 Apache Client \u4ee5\u652f\u6301\u7248\u672c 5\u3002<\/li>\n
  3. \u6b63\u5728\u5c06 IO \u529f\u80fd\u63d0\u53d6\u5230\u4e00\u4e2a\u5355\u72ec\u7684\u5e93\u4e2d\u3002\u8fd9\u662f\u4e00\u9879\u957f\u671f\u7684\u4efb\u52a1\uff0c\u6211\u4eec\u4e00\u76f4\u5728\u9010\u6b65\u8fdb\u884c\uff0c\u76ee\u6807\u662f\u5728 2023 \u5e74\u6700\u7ec8\u5b8c\u6210\u3002<\/li>\n<\/ol>\n
    \u957f\u671f\u5b58\u5728\u7684\u95ee\u9898 <\/strong><\/span><\/div>\n

    \u8c08\u5230\u957f\u671f\u5b58\u5728\u7684\u95ee\u9898\uff0cKtor \u4ece 2022 \u5e74\u7684 150 \u4e2a issue\uff0c\u4e0b\u964d\u5230 17 \u4e2a\u3002Ktor \u56e2\u961f\u5c06\u7ee7\u7eed\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u76f4\u5230\u6240\u6709\u7684 issue \u8fbe\u5230\u96f6\u3002\u6b64\u5916\uff0cKtor \u8fd8\u8bbe\u6cd5\u505a\u4e86\u4e00\u4e9b\u5185\u52a1\u7ba1\u7406\uff0c\u5c06 Flaky Tests \u7684\u6570\u91cf\u51cf\u5c11\u5230\u4e09\u4e2a\u3002Ktor \u56e2\u961f\u7684\u76ee\u6807\u662f\u5728\u4eca\u5e74\u89e3\u51b3\u8fd9\u4e9b\u6700\u540e\u5269\u4e0b\u7684\u95ee\u9898\u3002<\/p>\n

    \u542f\u52a8\u4e0e\u5f15\u5bfc <\/strong><\/span><\/div>\n

    Ktor \u7684\u76ee\u6807\u4e4b\u4e00\u4ecd\u7136\u662f\u7b80\u5316\u6a21\u677f\u4ee3\u7801\uff0c\u5e76\u4f7f\u5e94\u7528\u7a0b\u5e8f\u4ee5\u8f83\u5c11\u7684\u5de5\u4f5c\u91cf\u542f\u52a8\u548c\u8fd0\u884c\u3002\u5728\u8fd9\u65b9\u9762\uff0cKtor \u56e2\u961f\u5728 2022 \u5e74\u53d6\u5f97\u4e86\u4e00\u4e9b\u8fdb\u5c55\uff0c\u5305\u62ec\u4e0d\u4ec5\u662f\u670d\u52a1\u5668\uff0c\u800c\u4e14\u8fd8\u6709\u5ba2\u6237\u7aef\u5e94\u7528\u7a0b\u5e8f\u7684\u66f4\u5bb9\u6613\u542f\u52a8\u3002\u660e\u5e74\uff0c\u6211\u4eec\u5e0c\u671b\u7ee7\u7eed\u6cbf\u7740\u8fd9\u6761\u9053\u8def\u8d70\u4e0b\u53bb\uff0c\u5e76\u4e13\u6ce8\u4e8e\u4ee5\u4e0b\u9886\u57df\u3002<\/p>\n

      \n
    1. \u8f7b\u677e\u542f\u52a8\u548c\u8fd0\u884c\u7528\u4e8e\u6570\u636e\u8bbf\u95ee\u7684\u6846\u67b6\u548c\u5e93\u3002\u7279\u522b\u662f\u6211\u4eec\u5c06\u81f4\u529b\u4e8e\u7b80\u5316 Exposed\u3001JDBC \u548c MongoDB \u7684\u5de5\u4f5c\u3002<\/li>\n
    2. \u4e3a\u6307\u6807\u3001\u9065\u6d4b\u3001retrofit \u548c Zipkin \u7b49\u5f00\u53d1\u65b0\u63d2\u4ef6\u3002<\/li>\n
    3. \u7b80\u5316\u5bf9\u6388\u6743\u548c\u8ba4\u8bc1\u7684\u652f\u6301\u3002\u4e3a\u6570\u636e\u5e93\u8ba4\u8bc1\u548c\u4f1a\u8bdd\u7ba1\u7406\uff0c\u4ee5\u53ca\u57fa\u4e8e\u89d2\u8272\u7684\u6388\u6743\u63d0\u4f9b\u7aef\u5230\u7aef\u7684\u652f\u6301\u3002<\/li>\n<\/ol>\n
      \u5de5\u5177\u5316 <\/strong><\/span><\/div>\n

      \u5728\u5de5\u5177\u652f\u6301\u65b9\u9762\uff0cKtor \u5c06\u63d0\u4f9b\u5927\u91cf\u7684\u65b0\u529f\u80fd\uff0c\u5305\u62ec\u5bf9 CLI \u5ba2\u6237\u7aef\u548c IDE \u652f\u6301\u7684\u66f4\u65b0\u3002\u7279\u522b\u662f\uff1a<\/p>\n

        \n
      1. \u8def\u7531\u652f\u6301\uff0c\u5305\u62ec\u91cd\u6784\uff0c\u5982\u63d0\u53d6\u8def\u7531\u3001\u751f\u6210\u8def\u7531\uff0c\u4ee5\u53ca\u6539\u8fdb\u7684\u5bfc\u822a\u548c\u8def\u7531\u67e5\u8be2\u3002<\/li>\n
      2. \u6539\u8fdb hook \u548c Ktor \u4ee3\u7801\u7684\u5176\u4ed6\u533a\u57df\u7684\u8865\u5168\u3002<\/li>\n
      3. \u652f\u6301\u8c03\u8bd5\u5fae\u670d\u52a1\uff0c\u63d0\u4f9b\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u8bf7\u6c42\u4e4b\u95f4\u7684\u900f\u660e\u5806\u6808\u8ddf\u8e2a\u3002<\/li>\n<\/ol>\n
        \u5176\u4ed6 <\/strong><\/span><\/div>\n

        \u9664\u4e86\u91cd\u70b9\u9886\u57df\u548c\u6bcf\u4e2a\u9886\u57df\u7684\u4e00\u4e9b\u5173\u952e\u529f\u80fd\u5916\uff0cKtor \u8fd8\u8ba1\u5212\u5728\u66f4\u591a\u7684\u529f\u80fd\u4e0a\u4f5c\u51fa\u6539\u8fdb\u3002\u66f4\u591a Ktor \u7684\u6700\u65b0\u4fe1\u606f\u90fd\u53ef\u4ee5\u67e5\u770b\u95ee\u9898\u8ddf\u8e2a\u5668<\/p>\n","protected":false},"excerpt":{"rendered":"

        Ktor \u662f\u4e00\u4e2a\u5f02\u6b65\u6846\u67b6\uff0c\u7528\u4e8e\u521b\u5efa\u5fae\u670d\u52a1\u3001Web \u5e94\u7528\u7b49\u3002\u4ece\u5934\u5230\u5c3e\u90fd\u662f\u7528 Kotlin \u7f16\u5199\u7684\u3002Ktor \u56e2\u961f […]<\/p>\n","protected":false},"author":643,"featured_media":259707,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-259705","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/259705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=259705"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/259705\/revisions"}],"predecessor-version":[{"id":262415,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/259705\/revisions\/262415"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/259707"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=259705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=259705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=259705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}