Messenger component provides a message bus with the ability to send messages and then handle them immediately in your Symfony application or send them through transports (e.g. queues) to be handled later.
Questions tagged [symfony-messenger]
121 questions
20
votes
1 answer
Unit test Symfony Messenger
I've been messing around with implementing AMQP using Symfony Messenger in my latest project. While the code works to my great joy i am unable to write unit tests for methods which dispatches messages.
All my tests involving code that dispatch…

PBX_g33k
- 851
- 1
- 6
- 12
13
votes
4 answers
Symfony messenger workers do not stop when running under supervisor
I am facing an odd behavior of the Symfony Messenger component. I set it up according to the documentation and I am issuing a messenger:stop-workers signal on each deploy as instructed here. However, a bug occurred in our system which I traced back…

Martin Melka
- 7,177
- 16
- 79
- 138
9
votes
1 answer
Symfony messenger get retry count in handler
I have implemented symfony messenger https://symfony.com/doc/current/messenger.html.
I want to get retry count in handler class which implements MessageHandlerInterface
Messenger consumer command throws an error and retries it 5 times according to…

Jigar Pancholi
- 1,209
- 1
- 8
- 25
7
votes
1 answer
Library error: a socket error occurred in Symfony Messenger
In my Symfony project, there is a queue message handler, and I have an error that randomly appears during the execution:
[2022-10-12T07:31:40.060119+00:00] console.CRITICAL: Error thrown while running command "messenger:consume async --limit=10".…

Davide Pastore
- 8,678
- 10
- 39
- 53
7
votes
1 answer
Symfony messenger queues with binding key - retry strategy
I'm implementing messenger in company which I work for. I found problem with routing key.
I want to to send one message to two queues. Two other apps will process this queues. Everything works well, but I found problem when handler throws an…

wtk13
- 387
- 1
- 6
- 15
7
votes
1 answer
Use Messenger to read queued message not sent with Messenger
I'm trying to read a queued message (in RabbitMQ) that wasn't send with Symfony Messenger. It seems that Messenger adds some headers, like
headers:
type: App\Message\Transaction
but when reading external messages, this header does not…

Kevin Pires
- 115
- 1
- 6
7
votes
0 answers
How to consume messages from Cloud Pub/Sub with the Messenger component of Symfony and Enqueue adapter?
Tools I'm using:
Symfony 4.1.6
Symfony Messenger component 4.1.6
Enqueue adapter 0.1.2
Enqueue Google Cloud Pub/Sub Transport 0.8.37
My config files:
#service.yaml
framework:
messenger:
transports:
default:…

Erik Saunier
- 8,670
- 1
- 20
- 15
5
votes
2 answers
Symfony 4 worker using doctrine not working properly : SQLSTATE[HY000] [2002] Connection timed out
I'm using a worker with the Symfony 4 messenger component.
This worker is
receiving a message (from rabbitMQ)
launch ffmpeg
do a treatment on a video
and save something in a database.
To configure this worker on Symfony I've done this (middleware…

Greco Jonathan
- 2,517
- 2
- 29
- 54
4
votes
1 answer
AMQPException Library error: table too large for buffer
I am using the messenger component in a Symfony application to process messages from rabbitmq.
When I send a 2-3mb message and an error occurs in my handler, the middleware that tries to send the message back to rabbit raises an exception of…

sX-
- 49
- 3
4
votes
2 answers
How to share the application cache between multiple Symfony instances (shared cache pool)?
My symfony application has multiple instances that are running in seperate docker containers.
And I have configured my app.cache to use redis:
framework:
cache:
app: cache.adapter.redis
I have the same prefix_seed:
framework:
…

alvery
- 1,863
- 2
- 15
- 35
4
votes
1 answer
Best way to use voters/permissions on Symfony messenger async message handler?
I am developing an application that have a Symfony Messenger component installed to handle async messages. The handler of message need to check some permissions for some particulars users, like if one determinate user should receive an email with…

terox
- 156
- 2
- 9
4
votes
3 answers
How to turn off logging for symfony messenger component
I have a Symfony website that's something inbetween an actual implementation and staging (it's used by a special client of mine). The logging is kept ON on that server because that helps when things go wrong from time to time (and they often go…

knezmilos
- 517
- 1
- 8
- 19
4
votes
0 answers
Using Symfony Messenger without framework
I'm trying to use Symfony Messenger in a project which does not use whole Symfony Framework.
I achieved creating a message, routing it to my handler and getting the result back with following code:

cnkt
- 2,943
- 5
- 30
- 43
4
votes
3 answers
How to delete a redis stream after success processing
I use redis as transport in messenger, I thought that after processing a flow the deletion was automatic but alas not. I do not know how to delete a repeat stream when the processing has been carried out with success.
I use symfony 4.4.latest and…

FOKO THierry
- 241
- 3
- 12
4
votes
0 answers
How can i configure enqueue/enqueue-bundle/enqueue/amqp-ext to create queue and exchange
Im working with symfony 4.3, I have a problem with enqueue/enqueue-bundle and enqueue/amqp-ext implementation.
I always work with php-amqplib/rabbitmq-bundle, I use config file to create queue, exchange and binding ...
old_sound_rabbit_mq:
…

AiD
- 977
- 3
- 15
- 41