In Azure Service Bus, you can send a brokered message using QueueClient
and MessageFactory
. I would like to know why would you want to use one over the other.
相关问题
- running headless chrome in an microsoft azure web
- Docker task in Azure devops won't accept "$(pw
- Register MicroServices in Azure Active Directory (
- Removing VHD's from Azure Resource Manager aft
- Cannot use the Knowledge academic API
相关文章
- SQL Azure Reset autoincrement
- How to cast Azure DocumentDB Document class to my
- Can't get azure web role to run locally using
- Azure WebApp - Unable to auto-detect the runtime s
- How to change region for Azure WebSite
- Azure webjob vs cloud service
- Azure data transfer Identity Column Seed Jumped by
- Download Azure web app?
Azure Service Bus provides different way to send/receive messages.
QueueClient
to send and receive message to/from a queue.TopicClient
to send message to a topicSubscriptionClient
to receive message from a subscription.Using
MessageSender
andMessageReceiver
, you create sender and receiver that are entity type invariant:A
MessageSender
can send messages to both topic or queue:A
MessageReceiver
ca receive messages from both queue and subscription:Theses abstractions can give you more flexibility if you need to switch from a queue to a topic or vice versa because you just need to change the path of the service bus entity (This could be in your configuration file) so no code change needed. Using
QueueClient
,TopicClient
,SubscriptionClient
, you'll have to change your code if you want to move from a queue to a topic.So my advice is to always use a
MessageReceiver
/MessageSender
when you have to send/receive message from/to a an Azure ServiceBus queue topic/subscription.NOTE: This does not apply for Eventhub which has a different implementation.