{"id":49166,"date":"2024-12-02T09:48:58","date_gmt":"2024-12-02T01:48:58","guid":{"rendered":"https:\/\/fwq.ai\/blog\/49166\/"},"modified":"2024-12-02T09:48:58","modified_gmt":"2024-12-02T01:48:58","slug":"hyperf-%e9%87%8d%e5%90%af%e6%97%b6-amqp-%e6%8a%a5%e9%94%99%ef%bc%9a%e5%a6%82%e4%bd%95%e6%8e%92%e6%9f%a5%e5%b9%b6%e8%a7%a3%e5%86%b3-broken-pipe-%e5%bc%82%e5%b8%b8%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/49166\/","title":{"rendered":"Hyperf \u91cd\u542f\u65f6 AMQP \u62a5\u9519\uff1a\u5982\u4f55\u6392\u67e5\u5e76\u89e3\u51b3 Broken Pipe \u5f02\u5e38\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>Hyperf \u91cd\u542f\u65f6 AMQP \u62a5\u9519\uff1a\u5982\u4f55\u6392\u67e5\u5e76\u89e3\u51b3 Broken Pipe \u5f02\u5e38\uff1f<\/h1>\n<p>\u5c0f\u4f19\u4f34\u4eec\u6709\u6ca1\u6709\u89c9\u5f97\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u5f88\u6709\u610f\u601d\uff1f\u6709\u610f\u601d\u5c31\u5bf9\u4e86\uff01\u4eca\u5929\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aHyperf \u91cd\u542f\u65f6 AMQP \u62a5\u9519\uff1a\u5982\u4f55\u6392\u67e5\u5e76\u89e3\u51b3 Broken Pipe \u5f02\u5e38\uff1f\u300b<\/span>\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\uff0c\u82e5\u662f\u5728\u5b66\u4e60\u4e2d\u5bf9\u5176\u4e2d\u90e8\u5206\u77e5\u8bc6\u70b9\u6709\u7591\u95ee\uff0c\u6216\u8bb8\u770b\u4e86\u672c\u6587\u5c31\u80fd\u5e2e\u5230\u4f60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241114\/1731552696673565b8def4f.jpg\" class=\"aligncenter\" title=\"Hyperf \u91cd\u542f\u65f6 AMQP \u62a5\u9519\uff1a\u5982\u4f55\u6392\u67e5\u5e76\u89e3\u51b3 Broken Pipe \u5f02\u5e38\uff1f\u63d2\u56fe\" alt=\"Hyperf \u91cd\u542f\u65f6 AMQP \u62a5\u9519\uff1a\u5982\u4f55\u6392\u67e5\u5e76\u89e3\u51b3 Broken Pipe \u5f02\u5e38\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>hyperf \u91cd\u542f\u65f6 amqp \u5f02\u5e38\u5904\u7406<\/strong><\/p>\n<p>\u5728\u91cd\u542f hyperf \u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230 amqp \u62a5\u51fa\u5f02\u5e38\u7684\u60c5\u51b5\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u4e24\u79cd\u91cd\u542f\u65b9\u5f0f\u9020\u6210\u7684\uff1a<\/p>\n<ul>\n<li>\u901a\u8fc7 systemctl \u811a\u672c<\/li>\n<li>\u901a\u8fc7 php bin\/hyperf server:watcher<\/li>\n<\/ul>\n<p>\u5f02\u5e38\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n<pre>[WARNING] Recv loop broken. The reason is PhpAmqpLib\\Exception\\AMQPConnectionClosedException: Broken pipe or closed connection in \/data\/web\/website\/hyperf-skeleton\/vendor\/php-amqplib\/php-amqplib\/PhpAmqpLib\/Connection\/AbstractConnection.php:571<\/pre>\n<p>\u8fd9\u662f\u56e0\u4e3a\u670d\u52a1\u5173\u95ed\u5bfc\u81f4 mq \u670d\u52a1\u7aef\u5173\u95ed\u4e86\u8fde\u63a5\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u9047\u5230\u8fd9\u4e2a\u5f02\u5e38\u540e\uff0c\u5982\u679c\u5f71\u54cd\u4e86\u670d\u52a1\u7684\u6b63\u5e38\u8fd0\u884c\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u63aa\u65bd\uff1a<\/p>\n<ul>\n<li>\u91cd\u65b0\u542f\u52a8 amqp \u670d\u52a1<\/li>\n<li>\u68c0\u67e5 hyperf \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 amqp \u8bbe\u7f6e\u662f\u5426\u6b63\u786e<\/li>\n<\/ul>\n<p>\u4f46\u662f\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u4e2a\u5f02\u5e38\u901a\u5e38\u662f warning\uff08\u8b66\u544a\uff09\u7ea7\u522b\u7684\uff0c\u800c\u975e fatal\/error\uff08\u5f02\u5e38\uff09\u3002\u8fd9\u610f\u5473\u7740\u5b83\u4e0d\u4f1a\u5f71\u54cd\u670d\u52a1\u7684\u6b63\u5e38\u8fd0\u884c\u3002\u56e0\u6b64\uff0c\u5982\u679c\u670d\u52a1\u672a\u53d7\u5230\u5f71\u54cd\uff0c\u53ef\u4ee5\u5ffd\u7565\u8fd9\u4e2a\u8b66\u544a\u3002<\/p>\n<p>\u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8e\u6587\u7ae0\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hyperf \u91cd\u542f\u65f6 AMQP \u62a5\u9519\uff1a\u5982\u4f55\u6392\u67e5\u5e76\u89e3\u51b3 Broken Pipe \u5f02\u5e38\uff1f \u5c0f\u4f19\u4f34\u4eec\u6709\u6ca1\u6709\u89c9\u5f97\u5b66\u4e60\u6587\u7ae0\u5f88\u6709\u610f\u601d\uff1f\u6709\u610f\u601d\u5c31\u5bf9\u4e86\uff01\u4eca\u5929\u5c31\u7ed9\u5927\u5bb6\u5e26\u6765\u300aHyperf \u91cd\u542f\u65f6 AMQP \u62a5\u9519\uff1a\u5982\u4f55\u6392\u67e5\u5e76\u89e3\u51b3 Broken Pipe \u5f02\u5e38\uff1f\u300b\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230\uff0c\u82e5\u662f\u5728\u5b66\u4e60\u4e2d\u5bf9\u5176\u4e2d\u90e8\u5206\u77e5\u8bc6\u70b9\u6709\u7591\u95ee\uff0c\u6216\u8bb8\u770b\u4e86\u672c\u6587\u5c31\u80fd\u5e2e\u5230\u4f60\uff01 hyperf \u91cd\u542f\u65f6 amqp \u5f02\u5e38\u5904\u7406 \u5728\u91cd\u542f hyperf \u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230 amqp \u62a5\u51fa\u5f02\u5e38\u7684\u60c5\u51b5\u3002\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u4e24\u79cd\u91cd\u542f\u65b9\u5f0f\u9020\u6210\u7684\uff1a \u901a\u8fc7 systemctl \u811a\u672c \u901a\u8fc7 php bin\/hyperf server:watcher \u5f02\u5e38\u4fe1\u606f\u5982\u4e0b\uff1a [WARNING] Recv loop broken. The reason is PhpAmqpLib\\Exception\\AMQPConnectionClosedException: Broken pipe or closed connection in \/data\/web\/website\/hyperf-skeleton\/vendor\/php-amqplib\/php-amqplib\/PhpAmqpLib\/Connection\/AbstractConnection.php:571 \u8fd9\u662f\u56e0\u4e3a\u670d\u52a1\u5173\u95ed\u5bfc\u81f4 mq \u670d\u52a1\u7aef\u5173\u95ed\u4e86\u8fde\u63a5\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u9047\u5230\u8fd9\u4e2a\u5f02\u5e38\u540e\uff0c\u5982\u679c\u5f71\u54cd\u4e86\u670d\u52a1\u7684\u6b63\u5e38\u8fd0\u884c\uff0c\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u63aa\u65bd\uff1a \u91cd\u65b0\u542f\u52a8 amqp \u670d\u52a1 \u68c0\u67e5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-49166","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=49166"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/49166\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=49166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=49166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=49166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}