I am more familiar with SNS/SQS and Lambda than with Kafka.
Lambda sleeps after some time when there are no requests. If a message is dropped to SQS it will trigger the lambda to "wake up". This way messaging + pay-per-use micro-service is achieved.
With Kafka, there are consumers & producers. The consumer is always listening, thus always up & running either a container in Kubernetes or other serverless platforms like Fargate, ECS, App Runner etc.
How to achieve the following scaling behavior with a Kafka consumer:
- If there are no requests, the micro-service should scale down to zero
- But if a message is dropped to Kafka during that period, it should wake it up.
Do i need a always running/up micro-service to listen to Kafka, or this there another way to achieve this.