prolic / HumusAmqp

PHP 7.4 AMQP library
https://humusamqp.readthedocs.io/
MIT License
76 stars 17 forks source link

JsonProducer should check for errors #46

Closed fritz-gerneth closed 7 years ago

fritz-gerneth commented 7 years ago

The JsonProducer currently directly passes the result of json_encode($message) to the exchange. In the case of an error during json_encode, it will return false, causing a type-exception as exchange->publish expects the value to be an string, not a boolean. Instead the JsonProducer should throw an exception if the message cannot be serialized.