Package io.vertx.rxjava.amqp
Class AmqpSender
- java.lang.Object
-
- io.vertx.rxjava.amqp.AmqpSender
-
- All Implemented Interfaces:
StreamBase,WriteStream<AmqpMessage>
public class AmqpSender extends Object implements WriteStream<AmqpMessage>
AMQP Sender interface used to send messages. 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<AmqpSender>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description AmqpSender(AmqpSender delegate)AmqpSender(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringaddress()voidclose()Closes the sender.voidclose(Handler<AsyncResult<Void>> handler)Closes the sender.AmqpConnectionconnection()Gets the connection having created the sender.WriteStream<AmqpMessage>drainHandler(Handler<Void> handler)Set a drain handler on the stream.voidend()Same asWriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but with anhandlercalled when the operation completesvoidend(Handler<AsyncResult<Void>> handler)Same asWriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but with anhandlercalled when the operation completesvoidend(AmqpMessage data)Same as but with anhandlercalled when the operation completesvoidend(AmqpMessage data, Handler<AsyncResult<Void>> handler)Same as but with anhandlercalled when the operation completesbooleanequals(Object o)AmqpSenderexceptionHandler(Handler<Throwable> handler)Set an exception handler on the write stream.AmqpSendergetDelegate()inthashCode()static AmqpSendernewInstance(AmqpSender arg)longremainingCredits()rx.Single<Void>rxClose()Closes the sender.rx.Single<Void>rxEnd()Same asWriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but with anhandlercalled when the operation completesrx.Single<Void>rxEnd(AmqpMessage data)Same as but with anhandlercalled when the operation completesrx.Single<Void>rxSendWithAck(AmqpMessage message)Sends an AMQP message and waits for an acknowledgement.rx.Single<Void>rxWrite(AmqpMessage data)Same as but with anhandlercalled when the operation completesAmqpSendersend(AmqpMessage message)Sends an AMQP message.AmqpSendersendWithAck(AmqpMessage message)Sends an AMQP message and waits for an acknowledgement.AmqpSendersendWithAck(AmqpMessage message, Handler<AsyncResult<Void>> acknowledgementHandler)Sends an AMQP message and waits for an acknowledgement.AmqpSendersetWriteQueueMaxSize(int maxSize)Set the maximum size of the write queue tomaxSize.StringtoString()WriteStreamSubscriber<AmqpMessage>toSubscriber()io.vertx.proton.ProtonSenderunwrap()voidwrite(AmqpMessage data)Same as but with anhandlercalled when the operation completesvoidwrite(AmqpMessage data, Handler<AsyncResult<Void>> handler)Same as but with anhandlercalled when the operation completesbooleanwriteQueueFull()This will returntrueif there are more bytes in the write queue than the value set usingsetWriteQueueMaxSize(int)
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<AmqpSender> __TYPE_ARG
-
-
Constructor Detail
-
AmqpSender
public AmqpSender(AmqpSender delegate)
-
AmqpSender
public AmqpSender(Object delegate)
-
-
Method Detail
-
getDelegate
public AmqpSender getDelegate()
- Specified by:
getDelegatein interfaceStreamBase- Specified by:
getDelegatein interfaceWriteStream<AmqpMessage>
-
toSubscriber
public WriteStreamSubscriber<AmqpMessage> toSubscriber()
-
write
public void write(AmqpMessage data, Handler<AsyncResult<Void>> handler)
Same as but with anhandlercalled when the operation completes- Specified by:
writein interfaceWriteStream<AmqpMessage>- Parameters:
data-handler-
-
write
public void write(AmqpMessage data)
Same as but with anhandlercalled when the operation completes- Specified by:
writein interfaceWriteStream<AmqpMessage>- Parameters:
data-
-
rxWrite
public rx.Single<Void> rxWrite(AmqpMessage data)
Same as but with anhandlercalled when the operation completes- Specified by:
rxWritein interfaceWriteStream<AmqpMessage>- Parameters:
data-- Returns:
-
end
public void end(Handler<AsyncResult<Void>> handler)
Same asWriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but with anhandlercalled when the operation completes- Specified by:
endin interfaceWriteStream<AmqpMessage>- Parameters:
handler-
-
end
public void end()
Same asWriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but with anhandlercalled when the operation completes- Specified by:
endin interfaceWriteStream<AmqpMessage>
-
rxEnd
public rx.Single<Void> rxEnd()
Same asWriteStream.end(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)but with anhandlercalled when the operation completes- Specified by:
rxEndin interfaceWriteStream<AmqpMessage>- Returns:
-
end
public void end(AmqpMessage data, Handler<AsyncResult<Void>> handler)
Same as but with anhandlercalled when the operation completes- Specified by:
endin interfaceWriteStream<AmqpMessage>- Parameters:
data-handler-
-
end
public void end(AmqpMessage data)
Same as but with anhandlercalled when the operation completes- Specified by:
endin interfaceWriteStream<AmqpMessage>- Parameters:
data-
-
rxEnd
public rx.Single<Void> rxEnd(AmqpMessage data)
Same as but with anhandlercalled when the operation completes- Specified by:
rxEndin interfaceWriteStream<AmqpMessage>- Parameters:
data-- Returns:
-
writeQueueFull
public boolean writeQueueFull()
This will returntrueif there are more bytes in the write queue than the value set usingsetWriteQueueMaxSize(int)- Specified by:
writeQueueFullin interfaceWriteStream<AmqpMessage>- Returns:
trueif write queue is full
-
drainHandler
public WriteStream<AmqpMessage> drainHandler(Handler<Void> handler)
Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. See for an example of this being used.The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to
maxSize / 2.- Specified by:
drainHandlerin interfaceWriteStream<AmqpMessage>- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
public AmqpSender exceptionHandler(Handler<Throwable> handler)
Description copied from interface:WriteStreamSet an exception handler on the write stream.- Specified by:
exceptionHandlerin interfaceStreamBase- Specified by:
exceptionHandlerin interfaceWriteStream<AmqpMessage>- Parameters:
handler- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
setWriteQueueMaxSize
public AmqpSender setWriteQueueMaxSize(int maxSize)
Description copied from interface:WriteStreamSet the maximum size of the write queue tomaxSize. You will still be able to write to the stream even if there is more thanmaxSizeitems in the write queue. This is used as an indicator by classes such asPipeto provide flow control. The value is defined by the implementation of the stream, e.g in bytes for aNetSocket, etc...- Specified by:
setWriteQueueMaxSizein interfaceWriteStream<AmqpMessage>- Parameters:
maxSize- the max size of the write stream- Returns:
- a reference to this, so the API can be used fluently
-
send
public AmqpSender send(AmqpMessage message)
Sends an AMQP message. The destination the configured sender address or the address configured in the message.- Parameters:
message- the message, must not benull- Returns:
- the current sender
-
sendWithAck
public AmqpSender sendWithAck(AmqpMessage message, Handler<AsyncResult<Void>> acknowledgementHandler)
Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.- Parameters:
message- the message, must not benullacknowledgementHandler- the acknowledgement handler, must not benull- Returns:
- the current sender
-
sendWithAck
public AmqpSender sendWithAck(AmqpMessage message)
Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.- Parameters:
message- the message, must not benull- Returns:
- the current sender
-
rxSendWithAck
public rx.Single<Void> rxSendWithAck(AmqpMessage message)
Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.- Parameters:
message- the message, must not benull- Returns:
- the current sender
-
close
public void close(Handler<AsyncResult<Void>> handler)
Closes the sender.- Parameters:
handler- called when the sender has been closed, must not benull
-
close
public void close()
Closes the sender.
-
rxClose
public rx.Single<Void> rxClose()
Closes the sender.- Returns:
-
address
public String address()
- Returns:
- the configured address.
-
connection
public AmqpConnection connection()
Gets the connection having created the sender. Cannot benull- Returns:
- the connection having created the sender.
-
remainingCredits
public long remainingCredits()
- Returns:
- the remaining credit, 0 is none.
-
unwrap
public io.vertx.proton.ProtonSender unwrap()
- Returns:
- the underlying ProtonSender.
-
newInstance
public static AmqpSender newInstance(AmqpSender arg)
-
-