nerdexam
Microsoft

AZ-204 · Question #90

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…

The correct answer is C. subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions). Using topic client, call RegisterMessageHandler which is used to receive messages continuously from the entity. It registers a message handler and begins a new thread to receive messages. This handler is waited on every time a new message is received by the receiver…

Submitted by lukas.cz· Mar 30, 2026Connect to and consume Azure services and third-party services

Question

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 complete the source code of the subscription client What should you do?

Options

  • Aawait subscriptionClient.CloseAsync();
  • Bawait subscriptionClient.AddRuleAsync(new RuleDescription (RuleDescription.DefaultRuleName,
  • CsubscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions);
  • DsubscriptionClient = new SubscriptionClient(ServiceBusConnectionString, TopicName,

How the community answered

(34 responses)
  • A
    9% (3)
  • B
    3% (1)
  • C
    74% (25)
  • D
    15% (5)

Explanation

Using topic client, call RegisterMessageHandler which is used to receive messages continuously from the entity. It registers a message handler and begins a new thread to receive messages. This handler is waited on every time a new message is received by the receiver. subscriptionClient.RegisterMessageHandler(ReceiveMessagesAsync, messageHandlerOptions);

Topics

#Service Bus#pub/sub#subscription client#message handler

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice