Class ServiceBusClientBuilder.ServiceBusSenderClientBuilder
java.lang.Object
com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSenderClientBuilder
- Enclosing class:
ServiceBusClientBuilder
Builder for creating
ServiceBusSenderClient and ServiceBusSenderAsyncClient to publish messages
to Service Bus.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreates an asynchronousclientfor transmittingServiceBusMessageto a Service Bus queue or topic.Creates a synchronousclientfor transmittingServiceBusMessageto a Service Bus queue or topic.Sets the name of the Service Bus queue to publish messages to.Sets the name of the Service Bus topic to publish messages to.
-
Method Details
-
queueName
Sets the name of the Service Bus queue to publish messages to.- Parameters:
queueName- Name of the queue.- Returns:
- The modified
ServiceBusClientBuilder.ServiceBusSenderClientBuilderobject.
-
topicName
Sets the name of the Service Bus topic to publish messages to.- Parameters:
topicName- Name of the topic.- Returns:
- The modified
ServiceBusClientBuilder.ServiceBusSenderClientBuilderobject.
-
buildAsyncClient
Creates an asynchronousclientfor transmittingServiceBusMessageto a Service Bus queue or topic.- Returns:
- A new
ServiceBusSenderAsyncClientfor transmitting to a Service queue or topic. - Throws:
IllegalStateException- ifqueueNameortopicNameare not set or, both of these fields are set. It is also thrown if the Service BusconnectionStringcontains anEntityPaththat does not match one set inqueueNameortopicName.IllegalArgumentException- if the entity type is not a queue or a topic.
-
buildClient
Creates a synchronousclientfor transmittingServiceBusMessageto a Service Bus queue or topic.- Returns:
- A new
ServiceBusSenderAsyncClientfor transmitting to a Service queue or topic. - Throws:
IllegalStateException- ifqueueNameortopicNameare not set or, both of these fields are set. It is also thrown if the Service BusconnectionStringcontains anEntityPaththat does not match one set inqueueNameortopicNameIllegalArgumentException- if the entity type is not a queue or a topic.
-