I have a message driven application that process message from a message queue, how do I know if that application is healthy?
The application itself is not an API server, it's merely a loop that process message from sqs.
I intent to run the application using fargate, but how can I detect if the application is healthy if it doesn't have an API that I can expose for docker to check it?
Thanks.
You could add a health check configuration that just does something like checking that the given process inside the container is running. Of course if the primary docker process exits, the container would stop and the ECS service would replace the container, so adding that health check may be unnecessary. You can subscribe to ECS messages for those task start/stop events via EventBridge if you wanted to be notified of the container exiting unexpectedly.
Ideally you would have some metrics from your message queue that would alert you if you have messages that are too old, or the queue has too many unread messages or something, which would indicate a problem with the service tasked with processing those messages. The details of that would depend on the exact message queue you are using.