dongluanan7163 2018-02-27 17:56
浏览 314

收到0而不是预期的7个字节AMQPIOException - 用户是正确的,仅当队列为空时

I use "php-amqplib/rabbitmq-bundle": "^1.14",

console command

 /app/console rabbitmq:consumer  parse_ppmconsumer -m 100

error is

Message: "Error reading data. Received 0 instead of expected 7 bytes" ["error" => PhpAmqpLib\Exception\AMQPIOException { …},"command" => "rabbitmq:consumer parse_ppmconsumer -m 100","message" => "Error reading data. Received 0 instead of expected 7 bytes"] []

i found similar errors but they have error is permissions i check my:

sudo rabbitmqctl list_permissions -p /
[sudo] password for grek: 
Listing permissions in vhost "/" ...
guest   .*      .*      .*
root    .*      .*      .*

so its correct

situation is only when queue is empty , when i have some data i get

/app/console rabbitmq:consumer parse_ppmconsumer -m 100 00:00,1792631149292 00:00,048967838287354 00:00,037322998046875 00:00,062886953353882 00:00,009692907333374 00:00,02227783203125 00:00,028231859207153 00:00,033851146697998 00:00,0090358257293701 00:00,01706600189209 00:00,012717962265015 00:00,020620107650757 00:00,01526403427124 00:00,016094207763672 00:00,016033887863159 00:00,014401912689209

  • this is every message proccessing time.

at the end i get :

00:00,078952074050903
00:00,12211585044861
00:00,3163890838623
00:00,5457661151886
18:53:27 ERROR     [console] Error thrown while running command "rabbitmq:consumer parse_ppmconsumer -m 100". Message: "Error reading data. Received 0 instead of expected 62 bytes" ["error" => PhpAmqpLib\Exception\AMQPIOException { …},"command" => "rabbitmq:consumer parse_ppmconsumer -m 100","message" => "Error reading data. Received 0 instead of expected 62 bytes"] []


  [PhpAmqpLib\Exception\AMQPIOException]                       
  Error reading data. Received 0 instead of expected 62 bytes  

where is problem ?

  • 写回答

1条回答 默认 最新

  • duan36000 2018-05-27 12:39
    关注

    I have the same problem with socket connection to RabbitMQ message queue. AMQPSocketConnection does not support heartbeat as you can read here

    If you want to use sockets with preventing this error, disable "heartbeat" parameter in configuration file.

    Try this configuration for rabbit_mq bundle:

    old_sound_rabbit_mq:
        connections:
            default:
                host:     '%env(resolve:RABBITMQ_HOST)%'
                port:     '%env(resolve:RABBITMQ_PORT)%'
                user:     '%env(resolve:RABBITMQ_USER)%'
                password: '%env(resolve:RABBITMQ_PASSWORD)%'
                vhost:    '/'
                lazy:     false
                connection_timeout: 60
                read_write_timeout: 60
                # requires php-amqplib v2.4.1+ and PHP5.4+
                # keepalive: true
                # requires php-amqplib v2.4.1+
                # heartbeat: 30 - disable heartbeat support
                #requires php_sockets.dll
                use_socket: true # default false
    

    Make sure you have installed mbstring, bcmath and sockets php extensions(this is important step)

    评论

报告相同问题?

悬赏问题

  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失