This bundle provide a MQTT transport for symfony messenger.
composer require kl3sk/mqtt-transport-bundle:@dev
MESSENGER_MQTT_TRANSPORT_DSN=mqtt://user:password@broker:1883
MQTT_CLIENT_ID=symfonyclient
MQTT_TOPICS='/topic1,/topic2'
Create your Message and Message handler Symfony documentation
services.yaml
services:
framework:
messenger:
# ... your definitions
transports:
mqtt:
dsn: '%env(MESSENGER_MQTT_TRANSPORT_DSN)%'
serializer: Kl3sk\MqttTransportBundle\Serializer\JsonMessageSerializer
routing:
# Route your messages to the transports
'Kl3sk\MqttTransportBundle\Message\ExampleMessage': mqtt
See in the Mqtt
folder
You can find a demo here
Thanks to Namoshek for his client and his help.