Hi @Shruti
To address your concerns about making your Event Hub consumer more resilient, here are specific recommendations:
Handling unprocessed messages due to database failures:
- Since your application is idempotent, you can store unprocessed messages in a retry queue (e.g., an Azure Service Bus queue or Blob Storage).
- A background job (Azure Function or Logic App) can retry processing messages periodically.
Handling deserialization errors
- If an event cannot be deserialized, route it to a Dead Letter Queue (DLQ).
- You can create a separate Event Hub or Service Bus queue to store these failed events for debugging and reprocessing.
Using Service Bus between Event Hub and the Consumer (Event Hub → Service Bus → AKS Consumer)
- Yes, this is a valid approach. Service Bus has a built-in DLQ** and supports retries.
- However, adding Service Bus increases cost and complexity. If buffering is not required, consider logging failed messages instead.
Cost-friendly alternatives
- If your main concern is failed messages, a separate Event Hub DLQ or Blob Storage is more cost-effective than Service Bus.
- If failures are rare, you can log messages in Cosmos DB or Blob Storage and retry them later.
Suggestions:
- If event buffering is needed → Service Bus works well.
- If you just need a DLQ → A separate Event Hub or Blob Storage is more cost-effective.
- If failures are rare → Logging failed events for later analysis is the cheapest option.
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.