Reputation: 439
I have one requirement to do file merging based on event driven architecture. I am having two blob containers and i need to merge files as soon as they are available in their respective containers. Correlation will happen based on file name.
That means suppose i have two containers, container A and container B. When file comes to container A then it should wait for the file to come in container B and then event should trigger which will get subscribed by ADF or logic app for further processing. Please suggest some way to achieve this.
Upvotes: 0
Views: 1012
Reputation: 8265
another option is creating a simple Distributed Event Aggregator, like is shown in the following screen snippet:
The concept is based on the Lease Blob where is stored the State of EventAggregator with all received event messages. The HttpTrigger function has a responsibility for handling and managing received event messages, create and update the State and handling a retry delivery for reliable updating a State. In this case, the dead-lettering is used as a Watchdog Timer.
Creating or Updating a Lease Blob will generate an event for subscriber and its logic can see the State of EventAggregator with an array of received event messages.
In the case when we are not using an eventing for Lease Blob (separate storage account), the finally event message with an EventAggregator State can be sent to the Storage queue by HttpTrigger function - EventAggregator.
Upvotes: 0
Reputation: 26057
Event Grid Microsoft.Storage.BlobCreated
event will be raised per container and will not wait for another container to raise an event.
One option I could think of is to handle your events using Durable Function
where you could use Correlation value as Durable Function instance ID to dentify an existing function or start a new one. If a function instance with a given ID is already running, you'd be able to either perform the merge or raise a new custom event and handle it separately.
Upvotes: 2