You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Symfony] sendCommand / sendEvent for delayed message have different behaviour #523
Hi,
we are trying to use RabbitMqDlxDelayStrategy with the rabbitmq_amqp transport in a symfony project. Our config looks like that:
enqueue:
transport:
default:
alias: rabbitmq_amqp
rabbitmq_amqp:
driver: bunny
host: '%env(RABBITMQ_HOST)%'
user: '%env(RABBITMQ_USER)%'
pass: '%env(RABBITMQ_PASSWORD)%'
delay_strategy: dlx
client:
prefix: company
app_name: webhook
router_queue: router # Used id queue name (${prefix}.{app_name}.{router_queue})
router_topic: router # Used id exchange name (${prefix}.{router_topic})
With sendEvent, the delayed message is pushed in enqueue.company.webhook.job_execute.120000.delayed for 120s, and then delivered to the company.webhook.job_execute queue.
With sendCommand, the delayed message is pushed in enqueue.company.webhook.router.120000.delayed for 120s. After the 120s it is sent to enqueue.company.webhook.job_execute.120000.delayed for 120s, and then delivered to the company.webhook.job_execute queue.
In both cases, we use the autowired ProducerInterface to sendEvent/sendCommand.
We are waiting for the same behaviour with Event or Command (The actual Event behaviour)
@amenophis the message is being delayed twice right? I think that a router should reset any priority, delaying, and expiration while sending the message to its final destination.
rabbitmq does not support message delaying out of the box. We have to two options: a workaround based on dead letter queue and time to live features and the plugin.
You are using a kind of "work around" which needs a queue to be created
Activity
makasim commentedon Sep 7, 2018
@amenophis the message is being delayed twice right? I think that a router should reset any priority, delaying, and expiration while sending the message to its final destination.
amenophis commentedon Sep 7, 2018
@makasim Yes, the message is delayed first for 120s in the
router.delayedqueue, and then a second time for 120s in thejob_execute.delayedqueue.This behaviour appear only while sending command, not event.
amenophis commentedon Sep 7, 2018
I don't understand why the
router.delayedqueue is created, what's it's purpose ?makasim commentedon Sep 7, 2018
rabbitmq does not support message delaying out of the box. We have to two options: a workaround based on dead letter queue and time to live features and the plugin.
You are using a kind of "work around" which needs a queue to be created
amenophis commentedon Sep 7, 2018
I understand how the delayed feature work, but i don't understand why 2 queues are needed with Command and just 1 queue with Event
makasim commentedon Sep 7, 2018
Could you post a code where you register an event and command processors?
I guess it should the other way around.
amenophis commentedon Sep 7, 2018
@makasim You can see code below.
This is the Processors
And this is the runner used in the Processors
amenophis commentedon Sep 11, 2018
@makasim any updates on this issue ?
[client] Rework AmqpDriver
[client] Rework AmqpDriver
amenophis commentedon Oct 1, 2018
Thanks @makasim. When do you plan the next release ?
makasim commentedon Oct 11, 2018
I was almost ready to release a stable version (3-5 days left). Now I am involved in a project development. Not sure when it happens.
[client] Rework AmqpDriver