Class RabbitMQConsumer
- All Implemented Interfaces:
MutinyDelegate,ReadStream<RabbitMQMessage>,StreamBase
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- See Also:
-
RabbitMQConsumer
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.ReadStream
ReadStream.ReadStreamImpl<T>Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase
StreamBase.StreamBaseImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRabbitMQConsumer(io.vertx.rabbitmq.RabbitMQConsumer delegate) Create a new instance ofRabbitMQConsumerdelegating to the given (non-null) instance ofRabbitMQConsumer.RabbitMQConsumer(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>cancel()Stop message consumption from a queue.voidStop message consumption from a queue.Stop message consumption from a queue.endHandler(Runnable endHandler) Set an end handler.booleanexceptionHandler(Consumer<Throwable> exceptionHandler) Set an exception handler on the read stream.fetch(long amount) Fetch the specifiedamountof elements.io.vertx.rabbitmq.RabbitMQConsumerGet the delegate instance.handler(Consumer<RabbitMQMessage> messageArrived) Set a message handler.inthashCode()booleanReturntrueif cancel() has been called.booleanisPaused()static RabbitMQConsumernewInstance(io.vertx.rabbitmq.RabbitMQConsumer delegate) Creates a new instance of theRabbitMQConsumer.pause()Pause the stream of incoming messages from queue.pipe()Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream.io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<RabbitMQMessage> dst) Pipe thisReadStreamto theWriteStream.voidPipe thisReadStreamto theWriteStream.Pipe thisReadStreamto theWriteStream.resume()Resume reading from a queue.setQueueName(String name) Set the name of the queue.io.smallrye.mutiny.Multi<RabbitMQMessage>toMulti()toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
RabbitMQConsumer
public RabbitMQConsumer(io.vertx.rabbitmq.RabbitMQConsumer delegate) Create a new instance ofRabbitMQConsumerdelegating to the given (non-null) instance ofRabbitMQConsumer. -
RabbitMQConsumer
-
-
Method Details
-
getDelegate
public io.vertx.rabbitmq.RabbitMQConsumer getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<RabbitMQMessage>- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate instance
-
cancel
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
RabbitMQConsumer#endHandler(Handler)Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
RabbitMQConsumer.cancel()
-
cancelAndAwait
public void cancelAndAwait()Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
RabbitMQConsumer#endHandler(Handler)Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
RabbitMQConsumer.cancel()
-
cancelAndForget
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
RabbitMQConsumer#endHandler(Handler)Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
RabbitMQConsumer.cancel()
-
pipeTo
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
pipeToin interfaceReadStream<RabbitMQMessage>- Parameters:
dst- the destination write stream- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.rabbitmq.RabbitMQConsumer#pipeTo(WriteStream)
-
pipeToAndAwait
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
dst- the destination write stream- See Also:
-
io.vertx.rabbitmq.RabbitMQConsumer#pipeTo(WriteStream)
-
pipeToAndForget
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
dst- the destination write stream- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.rabbitmq.RabbitMQConsumer#pipeTo(WriteStream)
-
exceptionHandler
Set an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<RabbitMQMessage>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
exceptionHandler- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
handler
Set a message handler. As message appear in a queue, the handler will be called with the message.- Specified by:
handlerin interfaceReadStream<RabbitMQMessage>- Returns:
- a reference to this, so the API can be used fluently
-
pause
Pause the stream of incoming messages from queue.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.- Specified by:
pausein interfaceReadStream<RabbitMQMessage>- Returns:
- a reference to this, so the API can be used fluently
-
resume
Resume reading from a queue. Flushes internal queue.- Specified by:
resumein interfaceReadStream<RabbitMQMessage>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
Set an end handler. Once the stream has canceled successfully, the handler will be called.- Specified by:
endHandlerin interfaceReadStream<RabbitMQMessage>- Returns:
- a reference to this, so the API can be used fluently
-
queueName
- Returns:
- the name of the queue
-
setQueueName
Set the name of the queue. This method is typically only required during a connectionEstablishedCallback when the queue name has changed.- Parameters:
name- the name of the queue- Returns:
- a reference to this, so the API can be used fluently
-
consumerTag
- Returns:
- a consumer tag
-
isCancelled
public boolean isCancelled()Returntrueif cancel() has been called.- Returns:
trueif cancel() has been called.
-
isPaused
public boolean isPaused()- Returns:
- is the stream paused?
-
fetch
Fetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<RabbitMQMessage>- Returns:
- a reference to this, so the API can be used fluently
-
pipe
Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream. The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<RabbitMQMessage>- Returns:
- a pipe
-
newInstance
Creates a new instance of theRabbitMQConsumer. -
hashCode
public int hashCode() -
equals
-
toString
-
toMulti
-
toBlockingIterable
-
toBlockingStream
-