Class RabbitMQConsumer
- java.lang.Object
-
- io.vertx.reactivex.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 theoriginalnon RX-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(RabbitMQConsumer delegate)RabbitMQConsumer(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Stop message consumption from a queue.voidcancel(Handler<AsyncResult<Void>> cancelResult)Stop message consumption from a queue.StringconsumerTag()RabbitMQConsumerendHandler(Handler<Void> endHandler)Set an end handler.booleanequals(Object o)RabbitMQConsumerexceptionHandler(Handler<Throwable> exceptionHandler)Set an exception handler on the read stream.RabbitMQConsumerfetch(long amount)Fetch the specifiedamountof elements.RabbitMQConsumergetDelegate()RabbitMQConsumerhandler(Handler<RabbitMQMessage> messageArrived)Set a message handler.inthashCode()booleanisCancelled()Returntrueif cancel() has been called.booleanisPaused()static RabbitMQConsumernewInstance(RabbitMQConsumer arg)RabbitMQConsumerpause()Pause the stream of incoming messages from queue.Pipe<RabbitMQMessage>pipe()Pause this stream and return a to transfer the elements of this stream to a destination .voidpipeTo(WriteStream<RabbitMQMessage> dst)Pipe thisReadStreamto theWriteStream.voidpipeTo(WriteStream<RabbitMQMessage> dst, Handler<AsyncResult<Void>> handler)Pipe thisReadStreamto theWriteStream.StringqueueName()RabbitMQConsumerresume()Resume reading from a queue.io.reactivex.CompletablerxCancel()Stop message consumption from a queue.io.reactivex.CompletablerxPipeTo(WriteStream<RabbitMQMessage> dst)Pipe thisReadStreamto theWriteStream.RabbitMQConsumersetQueueName(String name)Set the name of the queue.io.reactivex.Flowable<RabbitMQMessage>toFlowable()io.reactivex.Observable<RabbitMQMessage>toObservable()StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<RabbitMQConsumer> __TYPE_ARG
-
-
Constructor Detail
-
RabbitMQConsumer
public RabbitMQConsumer(RabbitMQConsumer delegate)
-
RabbitMQConsumer
public RabbitMQConsumer(Object delegate)
-
-
Method Detail
-
getDelegate
public RabbitMQConsumer getDelegate()
- Specified by:
getDelegatein interfaceReadStream<RabbitMQMessage>- Specified by:
getDelegatein interfaceStreamBase
-
toObservable
public io.reactivex.Observable<RabbitMQMessage> toObservable()
- Specified by:
toObservablein interfaceReadStream<RabbitMQMessage>
-
toFlowable
public io.reactivex.Flowable<RabbitMQMessage> toFlowable()
- Specified by:
toFlowablein interfaceReadStream<RabbitMQMessage>
-
pipe
public Pipe<RabbitMQMessage> pipe()
Pause this stream and return a to transfer the elements of this stream to a destination . The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<RabbitMQMessage>- Returns:
- a pipe
-
pipeTo
public void pipeTo(WriteStream<RabbitMQMessage> dst, Handler<AsyncResult<Void>> handler)
Pipe thisReadStreamto 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
handlerwill be called with the result.- Specified by:
pipeToin interfaceReadStream<RabbitMQMessage>- Parameters:
dst- the destination write streamhandler-
-
pipeTo
public void pipeTo(WriteStream<RabbitMQMessage> dst)
Pipe thisReadStreamto 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
handlerwill be called with the result.- Specified by:
pipeToin interfaceReadStream<RabbitMQMessage>- Parameters:
dst- the destination write stream
-
rxPipeTo
public io.reactivex.Completable rxPipeTo(WriteStream<RabbitMQMessage> dst)
Pipe thisReadStreamto 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
handlerwill be called with the result.- Specified by:
rxPipeToin interfaceReadStream<RabbitMQMessage>- Parameters:
dst- the destination write stream- Returns:
-
exceptionHandler
public RabbitMQConsumer exceptionHandler(Handler<Throwable> 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
public RabbitMQConsumer handler(Handler<RabbitMQMessage> messageArrived)
Set a message handler. As message appear in a queue, the handler will be called with the message.- Specified by:
handlerin interfaceReadStream<RabbitMQMessage>- Parameters:
messageArrived-- Returns:
- a reference to this, so the API can be used fluently
-
pause
public RabbitMQConsumer 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 , then incoming messages will be discarded.
- Specified by:
pausein interfaceReadStream<RabbitMQMessage>- Returns:
- a reference to this, so the API can be used fluently
-
resume
public RabbitMQConsumer 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
public RabbitMQConsumer endHandler(Handler<Void> endHandler)
Set an end handler. Once the stream has canceled successfully, the handler will be called.- Specified by:
endHandlerin interfaceReadStream<RabbitMQMessage>- Parameters:
endHandler-- Returns:
- a reference to this, so the API can be used fluently
-
queueName
public String queueName()
- Returns:
- the name of the queue
-
setQueueName
public RabbitMQConsumer setQueueName(String name)
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
public String consumerTag()
- Returns:
- a consumer tag
-
cancel
public void cancel(Handler<AsyncResult<Void>> cancelResult)
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
endHandler(io.vertx.core.Handler<java.lang.Void>)- Parameters:
cancelResult- contains information about operation status: success/fail.
-
cancel
public void cancel()
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
endHandler(io.vertx.core.Handler<java.lang.Void>)
-
rxCancel
public io.reactivex.Completable rxCancel()
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
endHandler(io.vertx.core.Handler<java.lang.Void>)- Returns:
-
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
public RabbitMQConsumer fetch(long amount)
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>- Parameters:
amount-- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
public static RabbitMQConsumer newInstance(RabbitMQConsumer arg)
-
-