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)

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型