{"id":126485,"date":"2020-05-14T06:11:47","date_gmt":"2020-05-13T22:11:47","guid":{"rendered":"http:\/\/4563.org\/?p=126485"},"modified":"2020-05-14T06:11:47","modified_gmt":"2020-05-13T22:11:47","slug":"spring-%e7%9a%84%e6%8e%a5%e5%8f%a3%e5%92%8c%e6%95%b0%e6%8d%ae%e5%ba%93%e6%9f%a5%e8%af%a2%e6%9c%89%e4%bb%80%e4%b9%88%e6%96%b9%e6%b3%95%e5%8f%af%e4%bb%a5%e8%bf%9b%e8%a1%8c%e7%ad%89%e5%be%85%e4%bd%86","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=126485","title":{"rendered":"spring \u7684\u63a5\u53e3\u548c\u6570\u636e\u5e93\u67e5\u8be2\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u8fdb\u884c\u7b49\u5f85\u4f46\u4e0d\u963b\u585e\u7ebf\u7a0b"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  spring \u7684\u63a5\u53e3\u548c\u6570\u636e\u5e93\u67e5\u8be2\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u8fdb\u884c\u7b49\u5f85\u4f46\u4e0d\u963b\u585e\u7ebf\u7a0b               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rockyou12 <\/span>  <span><i><\/i> 11<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u73b0\u5728\u6709\u4e2a\u4e1a\u52a1\uff0cA \u670d\u52a1\u63d0\u4f9b\u63a5\u53e3\u6765\u5bf9 iot \u8bbe\u5907\u4e0a\u7684\u4fe1\u606f\u8fdb\u884c\u67e5\u8be2\u3002\u4f46\u5b9e\u9645\u7684\u67e5\u8be2\u6d41\u7a0b\u662f A \u8c03\u7528 B \u670d\u52a1\uff0cB \u670d\u52a1\u53bb\u7ed9 iot \u8bbe\u5907\u53d1\u6307\u4ee4\uff0c\u7136\u540e iot \u7684\u54cd\u5e94\u662f\u5f02\u6b65\u8fd4\u56de\u901a\u8fc7\u5176\u5b83\u670d\u52a1\u5199\u8fd1\u4e86\u6570\u636e\u5e93\u3002<\/p>\n<p>\u6240\u4ee5 A \u670d\u52a1\u8981\u5728\u8c03\u7528 B \u540e\uff0c\u53c8\u8fdb\u884c\u7b49\u5f85\u5e76\u67e5\u8be2\u6570\u636e\u5e93\u4e2d\u662f\u5426\u6709\u8fd9\u6761\u670d\u52a1\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u7531\u4e8e\u6682\u65f6\u4e0d\u77e5\u9053\u8bbe\u5907\u7684\u54cd\u5e94\u662f\u4f55\u65f6\u8fd4\u56de\u7684\u5e76\u5199\u5165\u5b8c\u6210\u7684\uff0c\u6240\u4ee5\u4e00\u5b9a\u8981\u7b49\u5f85\u751a\u81f3\u8fdb\u884c\u91cd\u8bd5\u3002<\/p>\n<p>\u6211\u770b\u4e86\u4e0b spring \u7684 controller \u53ef\u4ee5\u7528 CompletableFuture \u6765\u505a\u5f02\u6b65\u54cd\u5e94\uff0c\u8fd9\u6837\u4e0d\u4f1a\u963b\u585e servlet \u90a3\u91cc\u7684 io\uff0c\u4f46\u67e5\u8be2\u6570\u636e\u7684\u7b49\u5f85\u90a3\u91cc\uff08\u4e5f\u5c31\u662f future \u7684 callback \uff09\u9664\u4e86 Thread.sleep \u6211\u597d\u50cf\u60f3\u4e0d\u5230\u5f88\u597d\u7684\u7b49\u5f85\u65b9\u6cd5\u3002<\/p>\n<p>\u7528 redis \u7684 sub \u6216\u8005\u7c7b\u4f3c\u7684\u901a\u77e5\u673a\u5236\u5c31\u7b97\u4e86\uff0c\u5927\u5e45\u52a0\u5927\u4e86\u7cfb\u7edf\u590d\u6742\u5ea6\uff0c\u6682\u65f6\u4e0d\u8003\u8651\u7684<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2017706\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yyyfor <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             completableFuture \u7684 whenComplete \u65b9\u6cd5\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2017707\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vitoliu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             DefferedResult                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2017708\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vitoliu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             DeferredResult                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2017709\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : royan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8fd9\u5df2\u7ecf\u662f\u6807\u51c6\u7684\u5f02\u8f6c\u540c\uff08\u5f02\u6b65\u8f6c\u540c\u6b65\uff09\u65b9\u6848\u4e86\uff0c\u5373\u4f7f\u5f15\u5165\u6d88\u606f\u901a\u77e5\u673a\u5236\u4e5f\u8fd8\u8981\u8003\u8651\u88ab\u901a\u77e5\u540e\u5982\u4f55\u5524\u9192\u5f53\u524d\u8fd9\u4e2a\u4e1a\u52a1\u7ebf\u7a0b\uff08\u5176\u5b9e\u4e0d\u592a\u9760\u8c31\uff0c\u53c2\u8003\u5206\u5e03\u5f0f\u6d88\u606f\u901a\u77e5\uff0c\u88ab\u901a\u77e5\u7684\u90fd\u4e0d\u4e00\u5b9a\u662f\u5f53\u524d\u670d\u52a1\u8fdb\u7a0b\uff09\u3002<br \/>\u5982\u679c\u5bf9\u4e1a\u52a1\u63a5\u53e3\u6709\u63a7\u5236\u6743\uff0c\u4e0d\u5982\u8003\u8651\u5c06\u5f53\u524d\u4e1a\u52a1\u63a5\u53e3\u8c03\u6574\u4e3a\u4e24\u4e2a\u63a5\u53e3\uff0c\u4e00\u4e2a\u8d1f\u8d23\u63a5\u6536\u4e1a\u52a1\u6307\u4ee4\uff0c\u4e00\u4e2a\u8d1f\u8d23\u67e5\u8be2\u8fd9\u4e2a\u4e1a\u52a1\u6307\u4ee4\u7684\u6267\u884c\u7ed3\u679c\u3002<br \/>\u5373\u4f7f\u5bf9\u4e1a\u52a1\u63a5\u53e3\u6ca1\u6709\u63a7\u5236\u6743\uff0c\u4e5f\u5efa\u8bae\u589e\u52a0\u4e00\u4e2a\u8d1f\u8d23\u67e5\u8be2\u4e1a\u52a1\u6307\u4ee4\u6267\u884c\u7ed3\u679c\u7684\u63a5\u53e3\uff0c\u8c01\u80fd\u4fdd\u8bc1\u4f60\u90a3\u4e2a\u540c\u6b65\u7b49\u5f85\u4e0d\u5f02\u5e38\uff08\u6bd4\u5982\u8d85\u65f6\uff0c\u6bd4\u5982\u88ab kill \uff09\u5462\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2017710\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : rockyou12 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @vitoliu \u4f60\u8fd9\u548c Future \u662f\u4e00\u6837\u7684<br \/>@royan \u5176\u5b9e\u6211\u4e5f\u60f3\u8fc7\u7ed9\u8c03\u7528\u8005\u4e00\u4e2a 201\uff0c\u7136\u540e\u8ba9\u5bf9\u65b9\u81ea\u5df1\u53bb\u7b49\u5f85\u7136\u540e\u6389\u53e6\u5916\u4e00\u4e2a\u67e5\u8be2\u63a5\u53e3\uff0c\u4f46\u8fd9\u6837\u628a\u590d\u6742\u5ea6\u66b4\u9732\u51fa\u53bb\u4e86\uff0c\u6211\u4e0d\u592a\u559c\u6b22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2017711\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RichardYyf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u4e0d\u5c31\u662f\u6211\u6700\u8fd1\u521a\u505a\u7684\u4e00\u4e2a\u9700\u6c42\u5417\uff0c\u5f02\u6b65\u8f6c\u540c\u6b65\uff0c\u5982\u679c A \u8c03 B \u548c iot \u5f02\u6b65\u8fd4\u56de\u53ef\u4ee5\u900f\u4f20\u4e00\u4e2a\u552f\u4e00\u6027\u7684 ID \u7684\u8bdd\uff0c\u53ef\u4ee5\u53c2\u8003 Dubbo \u7684 DefaultFuture\uff0c\u6211\u662f\u7b80\u5316\u4e86 Dubbo \u90a3\u4e2a\u7c7b\u7684\u8bbe\u8ba1\uff0c\u8fd8\u6ca1\u65f6\u95f4\u603b\u7ed3\uff0c\u4e3b\u53ef\u4ee5\u770b\u4e0b https:\/\/juejin.im\/post\/5e5c4b6d51882549236f8233 \u8fd9\u7bc7\u6587\u7ae0                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2017712\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : royan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @rockyou12 \u7406\u89e3\u3002\u6211\u662f\u89c9\u5f97 \u529f\u80fd\u5b8c\u6574\u6027 &gt; \u7cfb\u7edf\u6027\u80fd &gt; \u8bbe\u8ba1\u4f18\u96c5\uff0c\u7c7b\u4f3c\u5fae\u4fe1\u7edf\u4e00\u652f\u4ed8\u4e5f\u662f\u5355\u72ec\u63d0\u4f9b\u4e00\u4e2a\u67e5\u8be2\u63a5\u53e3\u6765\u786e\u4fdd\u529f\u80fd\u7684\u6700\u7ec8\u5b8c\u6574\u6027\uff0c\u540c\u65f6\u907f\u514d\u4e86\u8bb8\u591a\u7cfb\u7edf\u6027\u80fd\u4e0a\u7684\u95ee\u9898\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>spring \u7684\u63a5\u53e3\u548c\u6570\u636e\u5e93\u67e5\u8be2\u6709&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\/126485"}],"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=126485"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/126485\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=126485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=126485"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=126485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}