我试图在我的Dockerized Symfony应用程序中使用Messenger和AMQP传输。当我在处理程序中调度消息时,我收到以下错误:
In AmqpReceiver.php line 62:
[Symfony\Component\Messenger\Exception\TransportException]
Could not connect to the AMQP server. Please verify the provided DSN.
messenger.yaml:
framework:
messenger:
transports:
async:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
routing:
# Route your messages to the transports
'App\Message\MyCustomRequest': async
docker-compose.yml:
rabbitmq:
image: rabbitmq:3.8-management
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5671:5672
- 15671:15672
.环境:
MESSENGER_TRANSPORT_DSN=amqp://guest:guest@rabbitmq:5672/%2f/messages
1条答案
按热度按时间cl25kdpy1#
将环境变量更改为
看起来很有效