Interface Consumer
- All Superinterfaces:
AutoCloseable, Resource
API to consume messages from a RabbitMQ queue.
Instances are configured and created with a ConsumerBuilder.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceContext to accumulate message contexts and settle them at once.static interfaceContext for message processing.static interfaceContract to process a message.Nested classes/interfaces inherited from interface Resource
Resource.State, Resource.StateListener -
Method Summary
-
Method Details
-
pause
void pause()Pause the consumer to stop receiving messages.Messages already in flight when this method is called may still be delivered after it returns.
- Throws:
AmqpException- if the consumer is not open
-
unsettledMessageCount
long unsettledMessageCount()Return the number of unsettled messages.- Returns:
- unsettled message count
-
unpause
void unpause()Request to receive messages again.- Throws:
AmqpException- if the consumer is not open
-
close
-