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() |
Completable |
rxClose()
Closes the sender.
|
Completable |
rxEnd()
Same as
WriteStream.end() but with an handler called when the operation completes |
Completable |
rxEnd(AmqpMessage data)
Same as but with an
handler called when the operation completes |
Completable |
rxSendWithAck(AmqpMessage message)
Sends an AMQP message and waits for an acknowledgement.
|
Completable |
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 . |
<any> |
toObserver() |
String |
toString() |
<any> |
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, wait
newInstance, newInstance
newInstance
public static final io.vertx.lang.rx.TypeArg<AmqpSender> __TYPE_ARG
public AmqpSender(AmqpSender delegate)
public AmqpSender(Object delegate)
public AmqpSender getDelegate()
getDelegate
in interface StreamBase
getDelegate
in interface WriteStream<AmqpMessage>
public <any> toObserver()
public <any> 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 Completable 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 Completable 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)
WriteStream
WriteStream.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)
WriteStream
handler
called when the operation completeswrite
in interface WriteStream<AmqpMessage>
public Completable rxWrite(AmqpMessage data)
public AmqpSender exceptionHandler(Handler<Throwable> handler)
WriteStream
exceptionHandler
in interface StreamBase
exceptionHandler
in interface WriteStream<AmqpMessage>
handler
- the exception handlerpublic AmqpSender setWriteQueueMaxSize(int maxSize)
WriteStream
maxSize
. 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 null
public AmqpSender sendWithAck(AmqpMessage message, Handler<AsyncResult<Void>> acknowledgementHandler)
message
- the message, must not be null
acknowledgementHandler
- the acknowledgement handler, must not be null
public Completable rxSendWithAck(AmqpMessage message)
message
- the message, must not be null
public void close(Handler<AsyncResult<Void>> handler)
handler
- called when the sender has been closed, must not be null
public Completable rxClose()
public String address()
public AmqpConnection connection()
null
public long remainingCredits()
public static AmqpSender newInstance(AmqpSender arg)
Copyright © 2023 Eclipse. All rights reserved.