Package com.azure.messaging.servicebus
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.-
Method Summary
Modifier and TypeMethodDescriptionCreates an asynchronousclient
for transmittingServiceBusMessage
to a Service Bus queue or topic.Creates a synchronousclient
for transmittingServiceBusMessage
to 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.ServiceBusSenderClientBuilder
object.
-
topicName
Sets the name of the Service Bus topic to publish messages to.- Parameters:
topicName
- Name of the topic.- Returns:
- The modified
ServiceBusClientBuilder.ServiceBusSenderClientBuilder
object.
-
buildAsyncClient
Creates an asynchronousclient
for transmittingServiceBusMessage
to a Service Bus queue or topic.- Returns:
- A new
ServiceBusSenderAsyncClient
for transmitting to a Service queue or topic. - Throws:
IllegalStateException
- ifqueueName
ortopicName
are not set or, both of these fields are set. It is also thrown if the Service BusconnectionString
contains anEntityPath
that does not match one set inqueueName
ortopicName
.IllegalArgumentException
- if the entity type is not a queue or a topic.
-
buildClient
Creates a synchronousclient
for transmittingServiceBusMessage
to a Service Bus queue or topic.- Returns:
- A new
ServiceBusSenderAsyncClient
for transmitting to a Service queue or topic. - Throws:
IllegalStateException
- ifqueueName
ortopicName
are not set or, both of these fields are set. It is also thrown if the Service BusconnectionString
contains anEntityPath
that does not match one set inqueueName
ortopicName
IllegalArgumentException
- if the entity type is not a queue or a topic.
-