簡體   English   中英

對等方重置 RabbitMq 連接

[英]RabbitMq connection reset by peer

我對 RabbitMQ 有污點錯誤。 我發送了一些關於產品拋出 RabbitMq 和 Php 的信息,但是出了點問題。 我可以在一分鍾后發送消息,我有異常 "errno=104 Connection reset by peer" 。 見下文:

2016-05-09 08:13:14 Daemon start
2016-05-09 08:13:17 Send to shop-id-1-price
2016-05-09 08:13:21 Send to shop-id-1-price
2016-05-09 08:13:24 Send to shop-id-1-price
2016-05-09 08:13:28 Send to shop-id-1-price
2016-05-09 08:13:32 Send to shop-id-1-price
2016-05-09 08:13:36 Send to shop-id-1-price
2016-05-09 08:13:39 Send to shop-id-1-price
2016-05-09 08:13:43 Send to shop-id-1-price
2016-05-09 08:13:47 Send to shop-id-1-price


  [ErrorException]                                                           
  fwrite(): send of 21 bytes failed with errno=104 Connection reset by peer  


rabbitmq:consumer [-m|--messages [MESSAGES]] [-r|--route [ROUTE]] [-l|--memory-limi
t [MEMORY-LIMIT]] [-d|--debug] [--] <name>

PHP Fatal error:  Uncaught ErrorException: fwrite(): send of 19 bytes failed with e
rrno=32 Broken pipe in /chroot/data/stage/home/html/vendor/videlalva
ro/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:271

rabbitmq 版本 - 3.6.1,php 版本 - 7.0.5,php-amqp 庫版本 - “videlalvaro/php-amqplib”:“~2.7

來自 rabbitmq 的日志:

=INFO REPORT==== 9-May-2016::03:36:53 ===
accepting AMQP connection <0.25777.24> (104.207.249.104:38001 -> 104.207.249.104:5672)

=ERROR REPORT==== 9-May-2016::03:37:23 ===
closing AMQP connection <0.25777.24> (104.207.249.104:38001 -> 104.207.249.104:5672):
{writer,send_failed,{error,timeout}}

@Gabriele 的鏈接對我有幫助,以下是問題的詳細信息: https ://stackoverflow.com/a/36114095/1476819

這兩個更改解決了我的問題:

  • 在調用basic_consume之前添加它。 它將prefetch_count設置為1而不是“無窮大”。
$channel->basic_qos(null, 1, null);
$channel->basic_consume(...);
  • 我不確定這是否也有必要,但我已從no_ack更改為ack 這里向下滾動到消息確認標題: https ://www.rabbitmq.com/tutorials/tutorial-two-php.html

我同時完成了這些更改,現在它可以與 docker 一起使用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM