taskiq-aio-pika icon indicating copy to clipboard operation
taskiq-aio-pika copied to clipboard

not working delay for large number seconds(next hour, day, ...)

Open ArtemIsmagilov opened this issue 2 years ago • 7 comments

Hi. When i try add litte number seconds in param delay - it working, i await and get execute planing task. But if i try add large number seconds(next 1 day, next 1 week and etc.) then when the time expires, I do not receive the task execution :( In dramatiq, everything works. Ignoring even for 3 minutes

ArtemIsmagilov avatar Jan 16 '24 04:01 ArtemIsmagilov

Hi. Sorry for long reply. Instead of using delay which is implemented using hack over AMQP, for large delays please consider using schedulers. Currently we can offer Redis scheduler as a dynamic scheduler which you can populate in runtime.

https://github.com/taskiq-python/taskiq-redis/blob/09e835e4bfbd9e9a50ea4de440d23e6f2e4c5fd1/taskiq_redis/schedule_source.py#L12

s3rius avatar Jan 22 '24 15:01 s3rius

Ok, thank you

ArtemIsmagilov avatar Jan 22 '24 18:01 ArtemIsmagilov

Try use rabbitmq-delayed-message-exchange-plugin.

https://github.com/taskiq-python/taskiq-aio-pika?tab=readme-ov-file#retries-with-rabbitmq-delayed-message-exchange-plugin

vvanglro avatar Jan 30 '24 07:01 vvanglro

Hi. Sorry for long reply. Instead of using delay which is implemented using hack over AMQP, for large delays please consider using schedulers. Currently we can offer Redis scheduler as a dynamic scheduler which you can populate in runtime.

https://github.com/taskiq-python/taskiq-redis/blob/09e835e4bfbd9e9a50ea4de440d23e6f2e4c5fd1/taskiq_redis/schedule_source.py#L12

Hey, I really appreciate this library. I’m coming from Celery, and I really like the library’s design. Just one simple question: does it support RabbitMQ for scheduling natively, or will that be available in an upcoming update?

Kavan72 avatar May 07 '25 16:05 Kavan72

It does support it. You can use delay label for the task in order to send it delayed.

s3rius avatar May 18 '25 12:05 s3rius

It does support it. You can use delay label for the task in order to send it delayed.

Thanks for the reply. Just to clarify, I want to create a background task that runs at intervals, like a cron job.

Kavan72 avatar May 18 '25 12:05 Kavan72

In that case, I'd suggest you to use scheduler. It supports cron schedules.

s3rius avatar May 18 '25 13:05 s3rius

It looks like the original question has been answered. So I'll close this issue.

danfimov avatar Dec 02 '25 19:12 danfimov