public class AmqpSender extends Object implements WriteStream<AmqpMessage>
original non RX-ified interface using Vert.x codegen.| Modifier and Type | Field and Description |
|---|---|
static io.vertx.lang.rx.TypeArg<AmqpSender> |
__TYPE_ARG |
| Constructor and Description |
|---|
AmqpSender(AmqpSender delegate) |
AmqpSender(Object delegate) |
| Modifier and Type | Method and Description |
|---|---|
String |
address() |
void |
close(Handler<AsyncResult<Void>> handler)
Closes the sender.
|
AmqpConnection |
connection()
Gets the connection having created the sender.
|
WriteStream<AmqpMessage> |
drainHandler(Handler<Void> handler)
Set a drain handler on the stream.
|
void |
end()
Ends the stream.
|
void |
end(AmqpMessage data)
Same as
WriteStream.end() but writes some data to the stream before ending. |
void |
end(AmqpMessage data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
void |
end(Handler<AsyncResult<Void>> handler)
Same as
WriteStream.end() but with an handler called when the operation completes |
boolean |
equals(Object o) |
AmqpSender |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the write stream.
|
AmqpSender |
getDelegate() |
int |
hashCode() |
static AmqpSender |
newInstance(AmqpSender arg) |
long |
remainingCredits() |
Single<Void> |
rxClose()
Closes the sender.
|
Single<Void> |
rxEnd()
Same as
WriteStream.end() but with an handler called when the operation completes |
Single<Void> |
rxEnd(AmqpMessage data)
Same as but with an
handler called when the operation completes |
Single<Void> |
rxSendWithAck(AmqpMessage message)
Sends an AMQP message and waits for an acknowledgement.
|
Single<Void> |
rxWrite(AmqpMessage data) |
AmqpSender |
send(AmqpMessage message)
Sends an AMQP message.
|
AmqpSender |
sendWithAck(AmqpMessage message,
Handler<AsyncResult<Void>> acknowledgementHandler)
Sends an AMQP message and waits for an acknowledgement.
|
AmqpSender |
setWriteQueueMaxSize(int maxSize)
Set the maximum size of the write queue to
maxSize. |
String |
toString() |
io.vertx.rx.java.WriteStreamSubscriber<AmqpMessage> |
toSubscriber() |
AmqpSender |
write(AmqpMessage data)
Write some data to the stream.
|
AmqpSender |
write(AmqpMessage data,
Handler<AsyncResult<Void>> handler)
Same as but with an
handler called when the operation completes |
boolean |
writeQueueFull()
This will return
true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitnewInstance, newInstancenewInstancepublic static final io.vertx.lang.rx.TypeArg<AmqpSender> __TYPE_ARG
public AmqpSender(AmqpSender delegate)
public AmqpSender(Object delegate)
public AmqpSender getDelegate()
getDelegate in interface StreamBasegetDelegate in interface WriteStream<AmqpMessage>public io.vertx.rx.java.WriteStreamSubscriber<AmqpMessage> toSubscriber()
public void end()
Once the stream has ended, it cannot be used any more.
end in interface WriteStream<AmqpMessage>public void end(Handler<AsyncResult<Void>> handler)
WriteStream.end() but with an handler called when the operation completesend in interface WriteStream<AmqpMessage>handler - public Single<Void> rxEnd()
WriteStream.end() but with an handler called when the operation completespublic void end(AmqpMessage data)
WriteStream.end() but writes some data to the stream before ending.end in interface WriteStream<AmqpMessage>data - the data to writepublic void end(AmqpMessage data, Handler<AsyncResult<Void>> handler)
handler called when the operation completesend in interface WriteStream<AmqpMessage>data - handler - public Single<Void> rxEnd(AmqpMessage data)
handler called when the operation completesdata - public boolean writeQueueFull()
true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int)writeQueueFull in interface WriteStream<AmqpMessage>public WriteStream<AmqpMessage> drainHandler(Handler<Void> handler)
maxSize / 2.drainHandler in interface WriteStream<AmqpMessage>handler - the handlerpublic AmqpSender write(AmqpMessage data)
WriteStreamWriteStream.writeQueueFull() method before writing. This is done automatically if using a Pump.write in interface WriteStream<AmqpMessage>data - the data to writepublic AmqpSender write(AmqpMessage data, Handler<AsyncResult<Void>> handler)
WriteStreamhandler called when the operation completeswrite in interface WriteStream<AmqpMessage>public Single<Void> rxWrite(AmqpMessage data)
public AmqpSender exceptionHandler(Handler<Throwable> handler)
WriteStreamexceptionHandler in interface StreamBaseexceptionHandler in interface WriteStream<AmqpMessage>handler - the exception handlerpublic AmqpSender setWriteQueueMaxSize(int maxSize)
WriteStreammaxSize. You will still be able to write to the stream even
if there is more than maxSize items in the write queue. This is used as an indicator by classes such as
Pump to provide flow control.
The value is defined by the implementation of the stream, e.g in bytes for a
NetSocket, the number of Message for a
MessageProducer, etc...setWriteQueueMaxSize in interface WriteStream<AmqpMessage>maxSize - the max size of the write streampublic AmqpSender send(AmqpMessage message)
message - the message, must not be nullpublic AmqpSender sendWithAck(AmqpMessage message, Handler<AsyncResult<Void>> acknowledgementHandler)
message - the message, must not be nullacknowledgementHandler - the acknowledgement handler, must not be nullpublic Single<Void> rxSendWithAck(AmqpMessage message)
message - the message, must not be nullpublic void close(Handler<AsyncResult<Void>> handler)
handler - called when the sender has been closed, must not be nullpublic String address()
public AmqpConnection connection()
nullpublic long remainingCredits()
public static AmqpSender newInstance(AmqpSender arg)
Copyright © 2021 Eclipse. All rights reserved.