bschmitt / laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages
MIT License
270 stars 86 forks source link

Error in Consuming Queue using 2.0.6 #66

Closed jaypee888 closed 5 years ago

jaypee888 commented 5 years ago

Hi, After we update to 2.0.6 the consumer returns an error.

ErrorException : mb_strlen() expects parameter 1 to be string, array given

at /var/www/html/gameservice/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPWriter.php:346 342| @throws \PhpAmqpLib\Exception\AMQPInvalidArgumentException 343| / 344| public function write_shortstr($s) 345| {

346| $len = mb_strlen($s, 'ASCII'); 347| if ($len > 255) { 348| throw new AMQPInvalidArgumentException('String too long'); 349| } 350|

Exception trace:

1 mb_strlen([], "ASCII") /var/www/html/gameservice/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPWriter.php:346

2 PhpAmqpLib\Wire\AMQPWriter::write_shortstr([]) /var/www/html/gameservice/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Helper/Protocol/Protocol091.php:438 image_2019_05_20T05_05_35_820Z

This only happened when we update to 2.0.6, but once we rollback to 2.0.3 there's no problem.

stevenklar commented 5 years ago

Hi. Can you try to pin the php-amqplib to an older version and identify if the issue is still there?

jaypee888 commented 5 years ago

We try to pin the older version and it works fine. The issue only happens when php-amqplib update to 2.0.6.

stevenklar commented 5 years ago

2.9.2 is the newest php-amqplib

jaypee888 commented 5 years ago

Sorry. I thought it was bschmitt/laravel-amqp. We pin php-amqplib to an older version 2.9.1 down to 2.7 but still we encounter an error. Only 2.0.3 is working.

stevenklar commented 5 years ago

Is any other version up to 2.0.6 working? Maybe the bug has been introdued with a change in our Context class. Can you please test 2.0.4 and 2.0.5 for me?

TheKeymaster commented 5 years ago

We are having the same issue. 2.0.5 seems to work, so the bug was probably introduced somewhere in 2.0.6.

stevenklar commented 5 years ago

Allright Thanks. I will have a look into the latest change and fix the issue soon.

stevenklar commented 5 years ago

Can you please check if 2.0.7 is working for you? @TheKeymaster @jaypee888

jaypee888 commented 5 years ago

Hi, 2.0.7 is working fine now. Thank you very much.