Azure EventGrid publishing and storing the same into table storage

chagantivamsi87

New member
Joined
Dec 24, 2021
Messages
3
Programming Experience
10+
Publishing of EventGridEvent and storing the same in the Azure Storage table should be part of one operation method(**tightly coupled**) or segregated further(Loosely coupled)
which one is the right scenario ?
Apricated if you could share some sample scenario or code snippets.

Note: Our requirement is we should store the event data before it is **publishing** to EventGrid. In case of any issues we should able to **Rollback** it from the table storage.

*Sample code snippet*
Approach -1
C#:
CleanArchitecture -> Infrastructurelayer -->MessageBroker 

publishEvent(EventData)
{ 
--- Store events in DB
---- Publish event
if(publish failed )
{
Rollback from DB
}
}
OR
Approach -2
C#:
CleanArchitecture -> CommandHandler

CommnadHandler(EventData)
{
InfraStrcuture.Storage.EventStoreInsert
InfraStrcuture.MessageBroker.Publish
if Publish failed
{
InfraStrcuture.Storage.EventStoreRollback
}
}
The approach should be more generic way so that other Projects can consume it.
 
Last edited by a moderator:
Please post code in code blocks. I tried to do that but it looks like you also have a mix of HTML in there.
 

Latest posts

Back
Top Bottom