has many messages • Go consumer receives events from Queue • Events frequently is unpredictable Prerequisites • Calling OpenAI model takes time: 2- 5 minutes • There are maybe many messages →Handle the messages efficiently
goroutine to handle fetcher and handler Conclusion: ➔ Go consumer can process the message ➔ Can handle concurrently by multiple go consumer (multiple instances - scale by infra)
Complete ongoing tasks ◆ Release resources properly ◆ Clean up any necessary state ◆ … ➔ This case’s problems: ◆ Notify the exit signal. ◆ Handle the being processed messages.
invisibility is set to 5 minutes. ◆ If the app received message, process it 10 seconds, and restarted; the message will be kept for 4 minutes 50 seconds.