public interface RabbitMQConsumer extends ReadStream<RabbitMQMessage>
Modifier and Type | Method and Description |
---|---|
Future<Void> |
cancel()
Stop message consumption from a queue.
|
void |
cancel(Handler<AsyncResult<Void>> cancelResult)
Stop message consumption from a queue.
|
String |
consumerTag() |
RabbitMQConsumer |
endHandler(Handler<Void> endHandler)
Set an end handler.
|
RabbitMQConsumer |
exceptionHandler(Handler<Throwable> exceptionHandler)
Set an exception handler on the read stream.
|
RabbitMQConsumer |
fetch(long amount)
Fetch the specified
amount of elements. |
RabbitMQConsumer |
handler(Handler<RabbitMQMessage> messageArrived)
Set a message handler.
|
boolean |
isCancelled()
Return
true if cancel() has been called. |
boolean |
isPaused() |
RabbitMQConsumer |
pause()
Pause the stream of incoming messages from queue.
|
String |
queueName() |
RabbitMQConsumer |
resume()
Resume reading from a queue.
|
RabbitMQConsumer |
setQueueName(String name)
Set the name of the queue.
|
pipe, pipeTo, pipeTo
RabbitMQConsumer exceptionHandler(Handler<Throwable> exceptionHandler)
exceptionHandler
in interface ReadStream<RabbitMQMessage>
exceptionHandler
in interface StreamBase
exceptionHandler
- the exception handlerRabbitMQConsumer handler(Handler<RabbitMQMessage> messageArrived)
handler
in interface ReadStream<RabbitMQMessage>
RabbitMQConsumer pause()
The messages will continue to arrive, but they will be stored in a internal queue.
If the queue size would exceed the limit provided by RabbitMQConsumer#size(int)
, then incoming messages will be discarded.
pause
in interface ReadStream<RabbitMQMessage>
RabbitMQConsumer resume()
resume
in interface ReadStream<RabbitMQMessage>
RabbitMQConsumer endHandler(Handler<Void> endHandler)
endHandler
in interface ReadStream<RabbitMQMessage>
String queueName()
RabbitMQConsumer setQueueName(String name)
name
- the name of the queueString consumerTag()
Future<Void> cancel()
The operation is asynchronous. When consumption is stopped, you can also be notified via endHandler(Handler)
void cancel(Handler<AsyncResult<Void>> cancelResult)
The operation is asynchronous. When consumption is stopped, you can also be notified via endHandler(Handler)
cancelResult
- contains information about operation status: success/fail.boolean isCancelled()
true
if cancel() has been called.true
if cancel() has been called.boolean isPaused()
RabbitMQConsumer fetch(long amount)
amount
of elements. If the ReadStream
has been paused, reading will
recommence with the specified amount
of items, otherwise the specified amount
will
be added to the current stream demand.fetch
in interface ReadStream<RabbitMQMessage>
Copyright © 2023 Eclipse. All rights reserved.