What should you do?
 
Notifications
Clear all

What should you do?

1 Posts
1 Users
0 Likes
133 Views
(@katterjohnoctavio)
Noble Member
Joined: 2 years ago
Posts: 721
Topic starter  

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?

  • A . await subscriptionClient.CloseAsync();
  • B . await subscriptionClient.AddRuleAsync(new RuleDescription(RuleDescription.DefaultRuleName, new TrueFilter()));
  • C . subscriptionClient.RegisterMessageHandler(ProcessMessagesAsync, messageHandlerOptions);
  • D . subscriptionClient = new SubscriptionClient(ServiceBusConnectionString, TopicName, SubscriptionName);

Show Answer Hide Answer

Suggested Answer: C

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);

References: https://www.c-sharpcorner.com/article/azure-service-bus-topic-and-subscription-pub-sub/

   
Quote

Latest Microsoft AZ-204 Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: