Package com.rabbitmq.client.amqp
Interface ConsumerBuilder
public interface ConsumerBuilder
API to configure and create a
Consumer
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Filter options for support of AMQP filter expressions.static interface
Filter options for support of AMQP filter expressions.static enum
Offset specification to start consuming from.static interface
Options for a consumer consuming from a stream.static interface
Callback to modify a consumer subscription before the link creation. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the consumer.initialCredits
(int initialCredits) The initial number credits to grant to the AMQP receiver.listeners
(Resource.StateListener... listeners) AddResource.StateListener
s to the consumer.messageHandler
(Consumer.MessageHandler handler) The callback for inbound messages.priority
(int priority) The consumer priority.The queue to consume from.stream()
Options for a consumer consuming from a stream.subscriptionListener
(ConsumerBuilder.SubscriptionListener subscriptionListener) Set a listener to customize the subscription before the consumer is created (or recovered).
-
Method Details
-
queue
The queue to consume from.- Parameters:
queue
- queue- Returns:
- this builder instance
-
messageHandler
The callback for inbound messages.- Parameters:
handler
- callback- Returns:
- this builder instance
-
initialCredits
The initial number credits to grant to the AMQP receiver.The default is 100.
- Parameters:
initialCredits
- number of initial credits- Returns:
- this buidler instance
-
priority
The consumer priority.- Parameters:
priority
- consumer priority- Returns:
- this builder instance
- See Also:
-
listeners
AddResource.StateListener
s to the consumer.- Parameters:
listeners
- listeners- Returns:
- this builder instance
-
stream
ConsumerBuilder.StreamOptions stream()Options for a consumer consuming from a stream.- Returns:
- stream options
- See Also:
-
subscriptionListener
Set a listener to customize the subscription before the consumer is created (or recovered).This callback is available for stream consumers.
- Parameters:
subscriptionListener
- subscription listener- Returns:
- this builder instance
- See Also:
-
build
Consumer build()Build the consumer.- Returns:
- the configured consumer instance
-