[Messenger] fix empty amqp body returned as false

This commit is contained in:
Tobias Schultze 2019-09-05 18:44:17 +02:00
parent 828e5a4ae3
commit ee5cbe3658
1 changed files with 3 additions and 1 deletions

View File

@ -60,9 +60,11 @@ class AmqpReceiver implements ReceiverInterface, MessageCountAwareInterface
return;
}
$body = $amqpEnvelope->getBody();
try {
$envelope = $this->serializer->decode([
'body' => $amqpEnvelope->getBody(),
'body' => false === $body ? '' : $body, // workaround https://github.com/pdezwart/php-amqp/issues/351
'headers' => $amqpEnvelope->getHeaders(),
]);
} catch (MessageDecodingFailedException $exception) {