问题
We're new to the Azure messaging service and Functions, we learned the basic concept of different message service like Storage Queue, Service Bus Queue, Service Bus Topic and Event Hubs we also read the fan-out pattern by microsoft but that works more like fan-out then fan-back, which means during the fan-out process, current function still hold up there until all resource fan-back.
A simple scenario would be, we are saving an object in azure function starter and after saved successfully into storage, we would like to send a common message to 3 different destination/consumers implemented/triggered with azure functions,
function 1 would be using for notification(signalR or email)
function 2 would be using for logging(Sql Server)
function 3 would be using for continuing business logic.
All of above azure functions will be working independently/isolated, and our azure function starter doesn't have to wait for any of these 3 functions, it should exit or terminate once the message sent out. Basically the concept would be one publisher with multiple consumer and can guarantee that message would be delivered to all 3 consumers.
Which of the messaging service would be recommend in Azure? I think we should pick one of those three messaging servce Storage Queue, Service Bus Topic and Event Hubs but there is limitation of Azure resource that we can refer...
回答1:
Simple - Azure Service Bus Topic.
We implement the same pattern at work. Once a message comes in we then send it out to the Topic which then gets picked up by different TopicListeners/Subscribers. Each subscriber then calls a third party service.
Here is documentation of the difference between Service Bus and Storage Queue. https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted
来源:https://stackoverflow.com/questions/57517496/which-messaging-service-to-work-with-azure-function-fan-out-pattern-without-fan