Basic programming, .NET technology.

Azure Service Bus

 1. Overview

  • Message broker
  • Can decouple applications and services
  • Some common scenarios:
    • Messaging: Transfer business data
    • Decouple application: client and server don’t have to be online at the same time.
    • Topic and subscriptions: enable  1:n relationships between publisher and subscriber.
    • Message session: implement workflows that require message ordering or message deferral.
2. Queue
  • FIFO
  • Use case: point to point communication




3. Topic
  • Topic and subscription: subscription as a virtual queue of a topic. Each subscription receive a copy message


4. Receive Mode
  • Default is PeekLock mode
  • Receive mode: ReceiveAndDelete  and PeekLock
    • ReceiveAndDelete:
      • Service bus mark message as being consumed
      • The application can tolerate not processing a message if a failure occurs  
    • PeekLock
      • two-stage
      • it possible for the application cannot tolerate missing messages.
      • when Bus receives the request, it locks the message
      • after processing -> call CompleteAsync
      • some error occur -> call AbandonAsync
5. Security:

- Using Shared Access Signature
  • With Azure Portal -> use can define Share Access Policies for Namespaces, queues, topics, and their subscriptions
  • There are three policy rules:
    • Send
    • Listen
    • Manage
  • SAS can be applied on the namespace, entity (queue, topic), HTTP level, or  AMQP level
  • Use SAS Authorization
    • Connection string contains a rule name (SharedAccessKeyName) and rule key (SharedAccessKey) => when we pass it to any constructor or factory,  the SAS token provider is automatically created and populated.
  • Application usecase: => avoid use default Share Access Signature
    • Grant role/claims for the client as their responsibility


References:
Share:

0 nhận xét:

Đăng nhận xét

Featured Posts

Data type 3 - string type