Health-check on enqueue consumer

311 Views Asked by At

How can i make a health-check for liveness and readiness probe for a php-enqueue consumer?

The consumer is a long running process and is started with:

php ./bin/console enqueue:consume --setup-broker

Usually when the process goes down it gets restarted by k8s or any other supervisor. But there are cases when the consumer seems to be stuck but the process is not closed.

The problem with the queue is that it is async.
I can send a message to the queue but how can i check the message is consumed properly?
Is there any mechanism for this?

My idea currently is having the consumer send a event again to another queue when a health-check event is consumed. This other queue is consumed by the health-check command and if correctly consumed the health-check returns true.
Does this make sense?

0

There are 0 best solutions below