A logistics company runs a warehouse management system that processes package delivery messages from an Azure Service Bus queue. The processing application must meet the following requirements:
- Ensure that messages are only removed from the queue after they are successfully processed.
- If the application crashes or fails during processing, the message must automatically become visible to other instances of the receiver after the lock duration expires.
- Follow the principle of least privilege for security configuration.
Which two actions should you perform to implement this solution? (Select two.)
- Configure the ServiceBusReceiver to use PeekLock receive mode.Cevap
- Call the CompleteMessageAsync method after successful message processing.Cevap
- CConfigure the ServiceBusReceiver to use ReceiveAndDelete receive mode.
- DConfigure a Shared Access Signature (SAS) token with Manage authorization at the namespace level to authenticate the receiver client.
Cevap
Configure the receiver to use PeekLock receive mode, and call the CompleteMessageAsync method after successful message processing.
To satisfy the reliability requirement, the receiver must retrieve messages using the PeekLock receive mode, which locks the message temporarily instead of deleting it immediately. Once the message is successfully processed, the client must explicitly call CompleteMessageAsync to delete the message from the queue. This ensures that if the application crashes, the lock will expire and the message will reappear in the queue for processing.
Adım Adım Çözüm
Anahtar Kavram
Azure Service Bus Queue Message Processing Modes