Mosquitto-PHP
Mosquitto-PHP copied to clipboard
\Mosquitto\Message __wakeup missing data.
Hi guys. I'm using a worker that listen to broker. In order to reduce message block, I send received messages to a another worker, but I found a issue with the \Mosquitto\Message class. Seems to be a __wakeup issue, because in the worker that process messages, the properties of message object are null or empty values.
This dump of the object received in the onMessage closure Message {#57 ▼ +"mid": 0 +"topic": "topic/first" +"payload": "Message" +"qos": 0 +"retain": false }
and this is waked up message. Message {#67 ▼ +"mid": 0 +"topic": null +"payload": "" +"qos": 0 +"retain": false }
From what I tested, the serialize function works ok.
"O:17:"Mosquitto\Message":5:{s:3:"mid";i:0;s:5:"topic";s:11:"topic/first";s:7:"payload";s:7:"Message";s:3:"qos";i:0;s:6:"retain";b:0;}"
Ah, yep, that is definitely something I forgot to implement. I'll look into it.
On 2 Jan 2018, at 14:34, Bogdan TICA [email protected] wrote:
Hi guys. I'm using a worker that listen to broker. In order to reduce message block, I send received messages to a another worker, but I found a issue with the \Mosquitto\Message class. Seems to be a __wakeup issue, because in the worker that process messages, the properties of message object are null or empty values.
This dump of the object received in the onMessage closure Message {#57 ▼ +"mid": 0 +"topic": "topic/first" +"payload": "Message" +"qos": 0 +"retain": false }
and this is waked up message. Message {#67 ▼ +"mid": 0 +"topic": null +"payload": "" +"qos": 0 +"retain": false }
From what I tested, the serialize function works ok.
"O:17:"Mosquitto\Message":5:{s:3:"mid";i:0;s:5:"topic";s:11:"topic/first";s:7:"payload";s:7:"Message";s:3:"qos";i:0;s:6:"retain";b:0;}" — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.