Class RabbitMQConsumer
java.lang.Object
io.vertx.reactivex.rabbitmq.RabbitMQConsumer
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate, ReadStream<RabbitMQMessage>, StreamBase
public class RabbitMQConsumer
extends Object
implements io.vertx.lang.rx.RxDelegate, ReadStream<RabbitMQMessage>
A stream of messages from a rabbitmq queue.
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRabbitMQConsumer(RabbitMQConsumer delegate) RabbitMQConsumer(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptioncancel()Stop message consumption from a queue.endHandler(Handler<Void> endHandler) Set an end handler.booleanexceptionHandler(Handler<Throwable> exceptionHandler) Set an exception handler on the read stream.fetch(long amount) Fetch the specifiedamountof elements.handler(Handler<RabbitMQMessage> messageArrived) Set a message handler.inthashCode()booleanReturntrueif cancel() has been called.booleanisPaused()static RabbitMQConsumerpause()Pause the stream of incoming messages from queue.pipe()Pause this stream and return a to transfer the elements of this stream to a destination .pipeTo(WriteStream<RabbitMQMessage> dst) Pipe thisReadStreamto theWriteStream.resume()Resume reading from a queue.rxCancel()Stop message consumption from a queue.Pipe thisReadStreamto theWriteStream.setQueueName(String name) Set the name of the queue.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
RabbitMQConsumer
-
RabbitMQConsumer
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceReadStream<RabbitMQMessage>- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate- Specified by:
getDelegatein interfaceStreamBase
-
toObservable
- Specified by:
toObservablein interfaceReadStream<RabbitMQMessage>
-
toFlowable
- Specified by:
toFlowablein interfaceReadStream<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
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
- Specified by:
pipeToin interfaceReadStream<RabbitMQMessage>- Parameters:
dst- the destination write stream- Returns:
- a future notified when the write stream will be ended with the outcome
-
rxPipeTo
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
- Specified by:
rxPipeToin interfaceReadStream<RabbitMQMessage>- Parameters:
dst- the destination write stream- Returns:
- a future notified when the write stream will be ended with the outcome
-
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>- Parameters:
messageArrived-- 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 , 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>- Parameters:
endHandler-- 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
-
cancel
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
endHandler(Handler)- Returns:
- a future through which you can find out the operation status.
-
rxCancel
Stop message consumption from a queue.The operation is asynchronous. When consumption is stopped, you can also be notified via
endHandler(Handler)- Returns:
- a future through which you can find out the operation status.
-
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>- Parameters:
amount-- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
-