ServiceBusClientBuilder.ServiceBusReceiverClientBuilder Class
- java.
lang. Object - com.
azure. messaging. servicebus. ServiceBusClientBuilder. ServiceBusReceiverClientBuilder
- com.
public final class ServiceBusClientBuilder.ServiceBusReceiverClientBuilder
Builder for creating ServiceBusReceiverClient and ServiceBusReceiverAsyncClient to consume messages from Service Bus.
Method Summary
Modifier and Type | Method and Description |
---|---|
Service |
buildAsyncClient()
Creates an asynchronous Service Bus receiver responsible for reading ServiceBusMessage from a specific queue or subscription. |
Service |
buildClient()
Creates synchronous Service Bus receiver responsible for reading ServiceBusMessage from a specific queue or subscription. |
Service |
disableAutoComplete()
Disables auto-complete and auto-abandon of received messages. |
Service |
maxAutoLockRenewDuration(Duration maxAutoLockRenewDuration)
Sets the amount of time to continue auto-renewing the lock. |
Service |
prefetchCount(int prefetchCount)
Sets the prefetch count of the receiver. |
Service |
queueName(String queueName)
Sets the name of the queue to create a receiver for. |
Service |
receiveMode(ServiceBusReceiveMode receiveMode)
Sets the receive mode for the receiver. |
Service |
subQueue(SubQueue subQueue)
Sets the type of the SubQueue to connect to. |
Service |
subscriptionName(String subscriptionName)
Sets the name of the subscription in the topic to listen to. |
Service |
topicName(String topicName)
Sets the name of the topic. |
Methods inherited from java.lang.Object
Method Details
buildAsyncClient
public ServiceBusReceiverAsyncClient buildAsyncClient()
Creates an asynchronous Service Bus receiver responsible for reading ServiceBusMessage from a specific queue or subscription.
Returns:
buildClient
public ServiceBusReceiverClient buildClient()
Creates synchronous Service Bus receiver responsible for reading ServiceBusMessage from a specific queue or subscription.
Returns:
disableAutoComplete
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder disableAutoComplete()
Disables auto-complete and auto-abandon of received messages. By default, a successfully processed message is complete(ServiceBusReceivedMessage message). If an error happens when the message is processed, it is abandon(ServiceBusReceivedMessage message).
Returns:
maxAutoLockRenewDuration
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder maxAutoLockRenewDuration(Duration maxAutoLockRenewDuration)
Sets the amount of time to continue auto-renewing the lock. Setting Duration#ZERO or null
disables auto-renewal. For RECEIVE_AND_DELETE mode, auto-renewal is disabled.
Parameters:
null
indicates that auto-renewal is disabled.
Returns:
prefetchCount
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder prefetchCount(int prefetchCount)
Sets the prefetch count of the receiver. For both 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 receiveMessages(). Setting a non-zero value will prefetch that number of messages. Setting the value to zero turns prefetch off.
Parameters:
Returns:
queueName
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder queueName(String queueName)
Sets the name of the queue to create a receiver for.
Parameters:
Returns:
receiveMode
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder receiveMode(ServiceBusReceiveMode receiveMode)
Sets the receive mode for the receiver.
Parameters:
Returns:
subQueue
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder subQueue(SubQueue subQueue)
Sets the type of the SubQueue to connect to.
Parameters:
Returns:
subscriptionName
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder subscriptionName(String subscriptionName)
Sets the name of the subscription in the topic to listen to. topicName(String topicName) must also be set.
Parameters:
Returns:
topicName
public ServiceBusClientBuilder.ServiceBusReceiverClientBuilder topicName(String topicName)
Sets the name of the topic. subscriptionName(String subscriptionName) must also be set.
Parameters:
Returns:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for