-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 5.4
Description
Not sure if it's a bug, but when I consume a message, I get the error "Warning: json_decode() expects parameter 1 to be string, array given", because https://github.com/symfony/redis-messenger/blob/5.4/Transport/RedisReceiver.php#L47 is getting $message['data'] instead $message['data']['message'].
This is the $message value at this point:
Array
(
[id] => 1634746225533-0
[data] => Array
(
[message] => {"body":"O:36:\\\"Symfony\\\\Component\\\\Messenger\\\\Envelope\\\":2:{s:44:\\\"\\0Symfony\\\\Component\\\\Messenger\\\\Envelope\\0stamps\\\";a:1:{s:46:\\\"Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\BusNameStamp\\\";a:1:{i:0;O:46:\\\"Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\BusNameStamp\\\":1:{s:55:\\\"\\0Symfony\\\\Component\\\\Messenger\\\\Stamp\\\\BusNameStamp\\0busName\\\";s:21:\\\"messenger.bus.default\\\";}}}s:45:\\\"\\0Symfony\\\\Component\\\\Messenger\\\\Envelope\\0message\\\";O:58:\\\"Ekt\\\\NotificationBundle\\\\Messenger\\\\Messages\\\\PushNotification\\\":0:{}}","headers":[]}
)
)
How to reproduce
Possible Solution
Using $message['data']['message'] solves the issue in my case.
Additional context