W
W
wawa2018-11-13 19:22:25
Message Queues
wawa, 2018-11-13 19:22:25

How to cancel tasks that are already in the queue?

Service A creates tasks for service B, which executes them and returns the result back to service A. It works on queues. At any time, service A may decide that some of the tasks already sent to B are rotten and do not need to be performed. But they are already in the queue mixed with actual tasks. How is it smarter/easier to make service B ignore such tasks and not waste resources on them? Surely there is some more or less generally accepted approach.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-11-13
@dimonchik2013

any task added to the queue has an ID

I
Ivan Shumov, 2018-11-13
@inoise

No way. Only messages that need to be processed should be in the queue. Not for that you from use. If it’s more convenient for you to do this, then add storage with locks, and if it is there, then the message should be ignored, and the label from the lock should be erased

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question