Class ServiceBusReceiverClient

java.lang.Object
com.azure.messaging.servicebus.ServiceBusReceiverClient
All Implemented Interfaces:
AutoCloseable

public final class ServiceBusReceiverClient extends Object implements AutoCloseable
A synchronous receiver responsible for receiving ServiceBusReceivedMessage from a specific queue or topic on Azure Service Bus.

Create an instance of receiver

 // The required parameters is connectionString, a way to authenticate with Service Bus using credentials.
 // The connectionString/queueName must be set by the application. The 'connectionString' format is shown below.
 // "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}"
 ServiceBusReceiverClient receiver = new ServiceBusClientBuilder()
     .connectionString(connectionString)
     .receiver()
     .queueName(queueName)
     .buildClient();

 // Use the receiver and finally close it.
 receiver.close();
 
See Also: