public final class ServiceBusClientBuilder.ServiceBusReceiverClientBuilder extends Object
ServiceBusReceiverClient
and ServiceBusReceiverAsyncClient
to consume
messages from Service Bus.Modifier and Type | Method and Description |
---|---|
ServiceBusReceiverAsyncClient |
buildAsyncClient()
Creates an asynchronous Service Bus receiver responsible for reading
messages from a specific queue or topic. |
ServiceBusReceiverClient |
buildClient()
Creates synchronous Service Bus receiver responsible for reading
messages
from a specific queue or topic. |
ServiceBusClientBuilder.ServiceBusReceiverClientBuilder |
prefetchCount(int prefetchCount)
Sets the prefetch count of the receiver.
|
ServiceBusClientBuilder.ServiceBusReceiverClientBuilder |
queueName(String queueName)
Sets the name of the queue to create a receiver for.
|
ServiceBusClientBuilder.ServiceBusReceiverClientBuilder |
receiveMode(ReceiveMode receiveMode)
Sets the receive mode for the receiver.
|
ServiceBusClientBuilder.ServiceBusReceiverClientBuilder |
subscriptionName(String subscriptionName)
Sets the name of the subscription in the topic to listen to.
|
ServiceBusClientBuilder.ServiceBusReceiverClientBuilder |
topicName(String topicName)
Sets the name of the topic.
|
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder prefetchCount(int prefetchCount)
PEEK_LOCK
and RECEIVE_AND_DELETE
modes the default value is 1.
Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when
and before the application asks for one using ServiceBusReceiverAsyncClient.receive()
. Setting a
non-zero value will prefetch that number of messages. Setting the value to zero turns prefetch off.prefetchCount
- The prefetch count.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder queueName(String queueName)
queueName
- Name of the queue.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder receiveMode(ReceiveMode receiveMode)
receiveMode
- Mode for receiving messages.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder subscriptionName(String subscriptionName)
ServiceBusClientBuilder.ServiceBusReceiverClientBuilder.topicName(String)
must also be set.
subscriptionName
- Name of the subscription.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.A topic name should be set as well.
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder topicName(String topicName)
ServiceBusClientBuilder.ServiceBusReceiverClientBuilder.subscriptionName(String)
must also be set.topicName
- Name of the topic.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.A subscription name should be set as well.
public ServiceBusReceiverAsyncClient buildAsyncClient()
messages
from a specific queue or topic.ServiceBusReceiverAsyncClient
that receives messages from a queue or topic.IllegalStateException
- if queueName
or topicName
are not set or, both of these fields are set. It is also thrown if the Service Bus connectionString
contains an EntityPath
that does not match one set in
queueName
or topicName
. Lastly, if a topicName
is set, but subscriptionName
is not.IllegalArgumentException
- Queue or topic name are not set via queueName()
or topicName()
, respectively.public ServiceBusReceiverClient buildClient()
messages
from a specific queue or topic.ServiceBusReceiverClient
that receives messages from a queue or topic.IllegalStateException
- if queueName
or topicName
are not set or, both of these fields are set. It is also thrown if the Service Bus connectionString
contains an EntityPath
that does not match one set in
queueName
or topicName
. Lastly, if a topicName
is set, but subscriptionName
is not.IllegalArgumentException
- Queue or topic name are not set via queueName()
or topicName()
, respectively.Copyright © 2020 Microsoft Corporation. All rights reserved.