question

ManikandanPanneerselvam-5574 avatar image
0 Votes"
ManikandanPanneerselvam-5574 asked PramodValavala-MSFT answered

My event driven architecture design is tightly coupled with long running business thread while subscribing the event. Is that ok ? Do we need to redesign it ?

My event driven architecture design is tightly coupled with long running business thread while subscribing the event. Is that ok ? Do we need to redesign it ?

While the subscriber subscribing the event, the event is waiting in the thread until the long running business thread is completing the activity. Because of that, our threads are busy and the queue is getting generated. Because of that , our Infra is supporting less scalability. is that possible to redesign the event framework with loose coupling ( Loose coupling of business threads ) ? Is that important ?

azure-event-hubsazure-event-grid
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered

@ManikandanPanneerselvam-5574 Assuming you are using Azure Event Grid, then a long running process would cause the event delivery to fail, causing it to retry delivery. Instead, you should return a 202 Accepted response right away and let the backend process do its thing.

Another option is to route events to a queue like Service Bus or Event Hubs and have another process that listens to the incoming messages and processes them as required.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.