Class RabbitMQConsumer
- java.lang.Object
-
- io.vertx.mutiny.rabbitmq.RabbitMQConsumer
-
- All Implemented Interfaces:
ReadStream<RabbitMQMessage>
,StreamBase
public class RabbitMQConsumer extends Object implements ReadStream<RabbitMQMessage>
A stream of messages from a rabbitmq queue. NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<RabbitMQConsumer>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description RabbitMQConsumer(io.vertx.rabbitmq.RabbitMQConsumer delegate)
RabbitMQConsumer(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>
cancel()
Stop message consumption from a queue.Void
cancelAndAwait()
Blocking variant ofcancel()
.void
cancelAndForget()
Variant ofcancel()
that ignores the result of the operation.String
consumerTag()
RabbitMQConsumer
endHandler(Runnable endHandler)
boolean
equals(Object o)
RabbitMQConsumer
exceptionHandler(Consumer<Throwable> exceptionHandler)
RabbitMQConsumer
fetch(long amount)
io.vertx.rabbitmq.RabbitMQConsumer
getDelegate()
RabbitMQConsumer
handler(Consumer<RabbitMQMessage> messageArrived)
int
hashCode()
boolean
isCancelled()
boolean
isPaused()
static RabbitMQConsumer
newInstance(io.vertx.rabbitmq.RabbitMQConsumer arg)
RabbitMQConsumer
pause()
Pipe<RabbitMQMessage>
pipe()
io.smallrye.mutiny.Uni<Void>
pipeTo(WriteStream<RabbitMQMessage> dst)
Pipe thisReadStream
to theWriteStream
.Void
pipeToAndAwait(WriteStream<RabbitMQMessage> dst)
Blocking variant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream
.) void
pipeToAndForget(WriteStream<RabbitMQMessage> dst)
Variant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream
that ignores the result of the operation.) String
queueName()
RabbitMQConsumer
resume()
RabbitMQConsumer
setQueueName(String name)
Iterable<RabbitMQMessage>
toBlockingIterable()
Stream<RabbitMQMessage>
toBlockingStream()
io.smallrye.mutiny.Multi<RabbitMQMessage>
toMulti()
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<RabbitMQConsumer> __TYPE_ARG
-
-
Constructor Detail
-
RabbitMQConsumer
public RabbitMQConsumer(io.vertx.rabbitmq.RabbitMQConsumer delegate)
-
RabbitMQConsumer
public RabbitMQConsumer(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.rabbitmq.RabbitMQConsumer getDelegate()
- Specified by:
getDelegate
in interfaceReadStream<RabbitMQMessage>
- Specified by:
getDelegate
in interfaceStreamBase
-
pipe
public Pipe<RabbitMQMessage> pipe()
- Specified by:
pipe
in interfaceReadStream<RabbitMQMessage>
- Returns:
- a pipe
-
pipeTo
public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<RabbitMQMessage> dst)
Description copied from interface:ReadStream
Pipe thisReadStream
to theWriteStream
.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the
handler
will be called with the result.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
pipeTo
in interfaceReadStream<RabbitMQMessage>
- Parameters:
dst
- the destination write stream- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
pipeToAndAwait
public Void pipeToAndAwait(WriteStream<RabbitMQMessage> dst)
Description copied from interface:ReadStream
Blocking variant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream
.) This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
pipeToAndAwait
in interfaceReadStream<RabbitMQMessage>
- Parameters:
dst
- the destination write stream- Returns:
- the Void instance produced by the operation.
-
pipeToAndForget
public void pipeToAndForget(WriteStream<RabbitMQMessage> dst)
Description copied from interface:ReadStream
Variant ofio.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream
that ignores the result of the operation.) This method subscribes on the result of
io.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from) io.vertx.mutiny.core.streams.ReadStream#pipeTo(io.vertx.mutiny.core.streams.WriteStream
but you don't need to compose it with other operations.) - Specified by:
pipeToAndForget
in interfaceReadStream<RabbitMQMessage>
- Parameters:
dst
- the destination write stream
-
exceptionHandler
public RabbitMQConsumer exceptionHandler(Consumer<Throwable> exceptionHandler)
- Specified by:
exceptionHandler
in interfaceReadStream<RabbitMQMessage>
- Specified by:
exceptionHandler
in interfaceStreamBase
- Parameters:
exceptionHandler
- the exception handler- Returns:
-
handler
public RabbitMQConsumer handler(Consumer<RabbitMQMessage> messageArrived)
- Specified by:
handler
in interfaceReadStream<RabbitMQMessage>
- Parameters:
messageArrived
-- Returns:
-
pause
public RabbitMQConsumer pause()
- Specified by:
pause
in interfaceReadStream<RabbitMQMessage>
- Returns:
- a reference to this, so the API can be used fluently
-
resume
public RabbitMQConsumer resume()
- Specified by:
resume
in interfaceReadStream<RabbitMQMessage>
- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
public RabbitMQConsumer endHandler(Runnable endHandler)
- Specified by:
endHandler
in interfaceReadStream<RabbitMQMessage>
- Parameters:
endHandler
-- Returns:
-
queueName
public String queueName()
- Returns:
- the name of the queue
-
setQueueName
public RabbitMQConsumer setQueueName(String name)
- Parameters:
name
- the name of the queue- Returns:
- a reference to this, so the API can be used fluently
-
consumerTag
public String consumerTag()
- Returns:
- a consumer tag
-
cancel
public io.smallrye.mutiny.Uni<Void> cancel()
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
endHandler(java.lang.Runnable)
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
cancelAndAwait
public Void cancelAndAwait()
Blocking variant ofcancel()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
cancelAndForget
public void cancelAndForget()
-
isCancelled
public boolean isCancelled()
- Returns:
true
if cancel() has been called.
-
isPaused
public boolean isPaused()
- Returns:
- is the stream paused?
-
fetch
public RabbitMQConsumer fetch(long amount)
- Specified by:
fetch
in interfaceReadStream<RabbitMQMessage>
- Parameters:
amount
-- Returns:
- a reference to this, so the API can be used fluently
-
toMulti
public io.smallrye.mutiny.Multi<RabbitMQMessage> toMulti()
- Specified by:
toMulti
in interfaceReadStream<RabbitMQMessage>
-
toBlockingIterable
public Iterable<RabbitMQMessage> toBlockingIterable()
-
toBlockingStream
public Stream<RabbitMQMessage> toBlockingStream()
-
newInstance
public static RabbitMQConsumer newInstance(io.vertx.rabbitmq.RabbitMQConsumer arg)
-
-