exam questions

Exam AZ-204 All Questions

View all questions & answers for the AZ-204 exam

Exam AZ-204 topic 6 question 15 discussion

Actual exam question from Microsoft's AZ-204
Question #: 15
Topic #: 6
[All AZ-204 Questions]

A company is implementing a publish-subscribe (Pub/Sub) messaging component by using Azure Service Bus. You are developing the first subscription application.
In the Azure portal you see that messages are being sent to the subscription for each topic. You create and initialize a subscription client object by supplying the correct details, but the subscription application is still not consuming the messages.
You need to ensure that the subscription client processes all messages.
Which code segment should you use?

  • A. await subscriptionClient.AddRuleAsync(new RuleDescription(RuleDescription.DefaultRuleName, new TrueFilter()));
  • B. subscriptionClient = new SubscriptionClient(ServiceBusConnectionString, TopicName, SubscriptionName);
  • C. await subscriptionClient.CloseAsync();
  • D. subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions);
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
Ritesh073
Highly Voted 4 years, 8 months ago
Agreed on D Clientsubcriber object initialization is done, so B incorrect. Here Nothing to do with Rule and closeclient so A and C incorrect
upvoted 65 times
KingChuang
2 years, 4 months ago
On my exam 2022-12-26. Chose:D
upvoted 3 times
...
...
paru123456789
Highly Voted 4 years, 1 month ago
Answer: D
upvoted 7 times
...
overhill
Most Recent 5 months, 2 weeks ago
This is Legacy
upvoted 1 times
overhill
5 months, 2 weeks ago
This is Legacy API https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.queueclient.registermessagehandler?view=azure-dotnet-legacy
upvoted 1 times
...
...
Vichu_1607
7 months ago
Selected Answer: D
D. subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions); The RegisterMessageHandler method is used to start processing messages that have been sent to the Service Bus Topic. It takes two parameters: a function delegate that defines the processing of messages, and an options object that defines the settings for message processing. This is the method that actually starts the message pump and begins receiving and processing messages.
upvoted 1 times
...
Vmwarevirtual
1 year, 11 months ago
Appeared in my exam on 27 May 2023. I chose 'D'
upvoted 4 times
...
AlexeyG
2 years, 2 months ago
Got this in 16/02/2023
upvoted 2 times
...
OPT_001122
2 years, 5 months ago
Selected Answer: D
D is correct
upvoted 4 times
...
coffecold
2 years, 6 months ago
Old library : Microsoft.Azure.ServiceBus v5.2.0 I think nowadays (Azure.Messaging.ServiceBus v7.11.0) you simply would use : processor = client.CreateProcessor(queueName, new ServiceBusProcessorOptions()); processor.ProcessMessageAsync += MessageHandler; Still : the anwer is correct
upvoted 5 times
...
Perplex
2 years, 9 months ago
Selected Answer: D
D is correct
upvoted 4 times
...
meoukg
3 years, 1 month ago
Got it on 03/2022, I chose D. subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions);
upvoted 4 times
...
vulht
3 years, 2 months ago
Agreed on D when we use Microsoft.Azure.ServiceBus package. Furthermore, with the new version (Azure.Messaging.ServiceBus), we use a processor to receive/handle messages. https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-get-started-with-queues#add-the-code-to-receive-messages-from-the-queue
upvoted 3 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