Developing Solutions for Microsoft Azure: Implementing .NET Object to Receive Messages

Implementing .NET Object to Receive Messages

Question

You develop Azure solutions.

A .NET application needs to receive a message each time an Azure virtual machine finishes processing data.

The messages must NOT persist after being processed by the receiving application.

You need to implement the .NET object that will receive the messages.

Which object should you use?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

A queue allows processing of a message by a single consumer.

Need a CloudQueueClient to access the Azure VM.

Incorrect Answers: B, C: In contrast to queues, topics and subscriptions provide a one-to-many form of communication in a publish and subscribe pattern.

It's useful for scaling to large numbers of recipients.

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions

To receive a message each time an Azure virtual machine finishes processing data, we need a message queuing mechanism. We also need to ensure that the messages do not persist after being processed by the receiving application. There are various Azure messaging services available to implement such a solution, but we need to choose the correct one that fits our requirements.

The options provided in the answer are: A. QueueClient B. SubscriptionClient C. TopicClient D. CloudQueueClient

Option A: QueueClient - is a client for Azure Service Bus queues that can send and receive messages. Queues can be used to implement the point-to-point message communication pattern. Messages in queues persist until they are explicitly deleted or have expired. This option doesn't fit our requirement of not persisting the messages.

Option B: SubscriptionClient - is a client for Azure Service Bus subscriptions that can receive messages from a topic. Topics can be used to implement the publish-subscribe message communication pattern. Similar to queues, messages in subscriptions persist until they are explicitly deleted or have expired. This option doesn't fit our requirement of not persisting the messages.

Option C: TopicClient - is a client for Azure Service Bus topics that can send messages to a topic. Topics can be used to implement the publish-subscribe message communication pattern. This option doesn't fit our requirement of receiving messages from a virtual machine.

Option D: CloudQueueClient - is a client for Azure Queue storage that can send and receive messages from a queue. Queue storage can be used to implement the point-to-point message communication pattern. Messages in queues can be configured to not persist after being dequeued. This option fits our requirement of not persisting the messages after being processed by the receiving application.

Therefore, the correct option to use in this scenario is D. CloudQueueClient.