We are building a microservice in java. Responsibility of the microservice is to send emails by processing the incoming requests. To not impact the performance, we wanted to send the emails asynchronously. So we will queue the messages to a queue (in another microservice). We will have to support hundreds of tenants and have tens […]
- Tags And how to model the design for my problem on a high level using Akka - Specially around how on each pod, and how to poll messages on each queue present in queue service and how to process the messages?, I can allocate tenants and queues, that seems to solve similar problems - a) Sharing the workload across all available pods in cluster - Akka Cluster module b) rebalancing the, the design should be scalable as the number of tenants and queues grow. Existing solution: We are going to deploy in k8s. So we have multip, We are building a microservice in java. Responsibility of the microservice is to send emails by processing the incoming requests. To not impa, we end up spinning polling and processing threads This solution is obviously not scalable as we cannot keep on creating new threads for each, We have a background job that runs periodically every 10 seconds on every pod to detect new queues. For every queue, we spin up 2 threads - a) polling thread - that is responsible for polling messages from queue-service and put it in a local queue b) Process, we wanted to send the emails asynchronously. So we will queue the messages to a queue (in another microservice). We will have to support hund