exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 7 question 14 discussion

Actual exam question from Microsoft's PL-400
Question #: 14
Topic #: 7
[All PL-400 Questions]

You are creating a Power Automate flow.
You create an Azure Service Bus listener app that receives requests from a third-party application.
When the flow calls the message queue, it must delete the message as soon as it is read.
You need to ensure that the queue is cleared properly.
Which method or class should you use?

  • A. ReceiveMode
  • B. BrokeredMessage
  • C. EventHubReceiver
  • D. EventHubSender
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
ReceiveMode enumerates the values for the receive mode. The default is PeekLock.
Fields:
PeekLock: Specifies the PeekLock receive mode. This is the default value for ReceiveMode.
ReceiveAndDelete: Specifies the ReceiveAndDelete receive mode.
Note: You can specify two different modes in which Service Bus receives messages.
✑ Receive and delete. In this mode, when Service Bus receives the request from the consumer, it marks the message as being consumed and returns it to the consumer application.
✑ Peek lock.
Reference:
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.receivemode

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Violoncello
Highly Voted 1 year, 1 month ago
Answer A makes sense as explained. Generally, a QUEUE (of any type) has 3 functions: 1) Enqueue (to collect a message); 2) Peek (to look at but not remove message from the queue); and 3) Dequeue (or Serve) (to remove a message from the queue). Having a Mode with options to "PEEK" or "DEQUEUE/SERVE" or something similar should help figure this out.
upvoted 7 times
...
Juan0414
Most Recent 1 month, 3 weeks ago
Selected Answer: A
https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#receive-modes
upvoted 1 times
...
1285cc6
2 months, 2 weeks ago
Selected Answer: A
ULTRA CORRECTOMUNGA
upvoted 1 times
...
Frank208
5 months, 3 weeks ago
ChatGPT confirms that Answer A is correct: If the request is to delete the message as soon as it is read, regardless of whether it is processed successfully or not, then you should use the ReceiveMode property of the QueueClient or SubscriptionClient class to specify the behavior of the message receiver. The ReceiveMode property can be set to either PeekLock or ReceiveAndDelete. If PeekLock mode is used, the message will be locked for processing when it is read, and the lock will be released when the message is completed, abandoned, or the lock expires. If ReceiveAndDelete mode is used, the message will be deleted from the queue as soon as it is read, regardless of whether it is processed successfully or not. Therefore, to ensure that the message queue is cleared properly when a message is read, you should use the ReceiveAndDelete mode of the QueueClient or SubscriptionClient class, rather than the BrokeredMessage class as I previously mentioned. The correct answer is not B. BrokeredMessage, but A. ReceiveMode.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago