public interface RabbitMQConsumer extends io.vertx.core.streams.ReadStream<RabbitMQMessage>
| Modifier and Type | Method and Description |
|---|---|
io.vertx.core.Future<Void> |
cancel()
Stop message consumption from a queue.
|
void |
cancel(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> cancelResult)
Stop message consumption from a queue.
|
String |
consumerTag() |
RabbitMQConsumer |
endHandler(io.vertx.core.Handler<Void> endHandler)
Set an end handler.
|
RabbitMQConsumer |
exceptionHandler(io.vertx.core.Handler<Throwable> exceptionHandler)
Set an exception handler on the read stream.
|
RabbitMQConsumer |
fetch(long amount)
Fetch the specified
amount of elements. |
RabbitMQConsumer |
handler(io.vertx.core.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.
|
RabbitMQConsumer exceptionHandler(io.vertx.core.Handler<Throwable> exceptionHandler)
exceptionHandler in interface io.vertx.core.streams.ReadStream<RabbitMQMessage>exceptionHandler in interface io.vertx.core.streams.StreamBaseexceptionHandler - the exception handlerRabbitMQConsumer handler(io.vertx.core.Handler<RabbitMQMessage> messageArrived)
handler in interface io.vertx.core.streams.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 io.vertx.core.streams.ReadStream<RabbitMQMessage>RabbitMQConsumer resume()
resume in interface io.vertx.core.streams.ReadStream<RabbitMQMessage>RabbitMQConsumer endHandler(io.vertx.core.Handler<Void> endHandler)
endHandler in interface io.vertx.core.streams.ReadStream<RabbitMQMessage>String queueName()
RabbitMQConsumer setQueueName(String name)
name - the name of the queueString consumerTag()
io.vertx.core.Future<Void> cancel()
The operation is asynchronous. When consumption is stopped, you can also be notified via endHandler(Handler)
void cancel(io.vertx.core.Handler<io.vertx.core.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 io.vertx.core.streams.ReadStream<RabbitMQMessage>Copyright © 2024 Eclipse. All rights reserved.