0

I want to submit a form with async method using messenger component and rabbitmq. After submitting this form, an email is sent to me. But when i implement rabbitmq it does not work. I have surely a problem with configuration. Maybe i have to add something in services.yml ? I dont want to use docker.

    transports:
        # https://symfony.com/doc/current/messenger.html#transport-configuration
        async : 
            dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
            options:
                auto_setup: false
                use_notify: true
                check_delayed_interval: 60000
        # failed: 'doctrine://default?queue_name=failed'
        # sync: 'sync://'

    routing:
        # Route your messages to the transports
        'App\Message\MailNotification': async

.env file with amqp because i want to use rabbitmq

MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages

Output give me this result when i submit form

Could not connect to the AMQP server. Please verify the provided DSN. ({"host":"localhost","port":5672,"vhost":"/","auto_setup":false,"use_notify":true,"check_delayed_interval":60000,"login":"guest","password":"********"}).

In addition, Rabbitmq UI appears on webprofiler DOWN, it does not turn to UP. I can't figure out. Help me please.

kevin13005
  • 1
  • 1
  • 3
  • 1) Is your php environment working by docker? 2) RabbitMq now working native? – Ivan Gantsev May 14 '21 at 18:21
  • no my php environment does not work with docker. i don 't use docker on my symfony project. for your second question, i really don't know , i have only follow symfony documentation AMQP Transport¶ The AMQP transport uses the AMQP PHP extension to send messages to queues like RabbitMQ. – kevin13005 May 14 '21 at 19:04
  • I think i don’t need to install rabbitmq on my computer to use it on symfony.... – kevin13005 May 14 '21 at 19:21
  • Yes, you do need to install it on your computer or in a different host. You can still use messenger on other backends, such as [doctrine](https://symfony.com/doc/current/messenger.html#doctrine-transport) if you prefer, that won't require additional dependencies. – msg May 14 '21 at 19:35

0 Answers0