public final class ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder extends Object
ServiceBusReceiverClient
and ServiceBusReceiverAsyncClient
to consume
messages from a session aware Service Bus entity.Modifier and Type | Method and Description |
---|---|
ServiceBusReceiverAsyncClient |
buildAsyncClient()
Creates an asynchronous, session-aware Service Bus receiver responsible for reading
messages from a specific queue or topic. |
ServiceBusReceiverClient |
buildClient()
Creates a synchronous, session-aware Service Bus receiver responsible for reading
messages from a specific queue or topic. |
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder |
maxConcurrentSessions(int maxConcurrentSessions)
Enables session processing roll-over by processing at most
maxConcurrentSessions . |
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder |
prefetchCount(int prefetchCount)
Sets the prefetch count of the receiver.
|
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder |
queueName(String queueName)
Sets the name of the queue to create a receiver for.
|
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder |
receiveMode(ReceiveMode receiveMode)
Sets the receive mode for the receiver.
|
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder |
sessionId(String sessionId)
Sets the session id.
|
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder |
subscriptionName(String subscriptionName)
Sets the name of the subscription in the topic to listen to.
|
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder |
topicName(String topicName)
Sets the name of the topic.
|
public ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder maxConcurrentSessions(int maxConcurrentSessions)
maxConcurrentSessions
.maxConcurrentSessions
- Maximum number of concurrent sessions to process at any given time.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.IllegalArgumentException
- if maxConcurrentSessions
is less than 1.public ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder 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.ServiceBusSessionReceiverClientBuilder queueName(String queueName)
queueName
- Name of the queue.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.public ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder receiveMode(ReceiveMode receiveMode)
receiveMode
- Mode for receiving messages.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.public ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder sessionId(String sessionId)
sessionId
- session id.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.public ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder subscriptionName(String subscriptionName)
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder.topicName(String)
must also be set.
subscriptionName
- Name of the subscription.ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
object.A topic name should be set as well.
public ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder topicName(String topicName)
ServiceBusClientBuilder.ServiceBusSessionReceiverClientBuilder.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.