Class AmqpSender
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate, StreamBase, WriteStream<AmqpMessage>
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()close()Closes the sender.Gets the connection having created the sender.drainHandler(Handler<Void> handler) Set a drain handler on the stream.end()Ends the stream.end(AmqpMessage data) Same asWriteStream.end()but writes some data to the stream before ending.booleanexceptionHandler(Handler<Throwable> handler) Set an exception handler on the write stream.inthashCode()static AmqpSendernewInstance(AmqpSender arg) longrxClose()Closes the sender.rxEnd()Ends the stream.rxEnd(AmqpMessage data) Same asWriteStream.end()but writes some data to the stream before ending.rxSendWithAck(AmqpMessage message) Sends an AMQP message and waits for an acknowledgement.rxWrite(AmqpMessage data) Write some data to the stream.send(AmqpMessage message) Sends an AMQP message.sendWithAck(AmqpMessage message) Sends an AMQP message and waits for an acknowledgement.setWriteQueueMaxSize(int maxSize) Set the maximum size of the write queue tomaxSize.toString()io.vertx.proton.ProtonSenderunwrap()write(AmqpMessage data) Write some data to the stream.booleanThis will returntrueif there are more bytes in the write queue than the value set usingsetWriteQueueMaxSize(int)
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
AmqpSender
-
AmqpSender
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate- Specified by:
getDelegatein interfaceStreamBase- Specified by:
getDelegatein interfaceWriteStream<AmqpMessage>
-
toObserver
- Specified by:
toObserverin interfaceWriteStream<AmqpMessage>
-
toSubscriber
- Specified by:
toSubscriberin interfaceWriteStream<AmqpMessage>
-
write
Write some data to the stream.The data is usually put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the
WriteStream.writeQueueFull()method before writing. This is done automatically if using a .When the
datais moved from the queue to the actual medium, the returned will be completed with the write result, e.g the future is succeeded when a server HTTP response buffer is written to the socket and failed if the remote client has closed the socket while the data was still pending for write.- Specified by:
writein interfaceWriteStream<AmqpMessage>- Parameters:
data- the data to write- Returns:
- a future completed with the write result
-
rxWrite
Write some data to the stream.The data is usually put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the
WriteStream.writeQueueFull()method before writing. This is done automatically if using a .When the
datais moved from the queue to the actual medium, the returned will be completed with the write result, e.g the future is succeeded when a server HTTP response buffer is written to the socket and failed if the remote client has closed the socket while the data was still pending for write.- Specified by:
rxWritein interfaceWriteStream<AmqpMessage>- Parameters:
data- the data to write- Returns:
- a future completed with the write result
-
end
Ends the stream.Once the stream has ended, it cannot be used any more.
- Specified by:
endin interfaceWriteStream<AmqpMessage>- Returns:
- a future completed with the result
-
rxEnd
Ends the stream.Once the stream has ended, it cannot be used any more.
- Specified by:
rxEndin interfaceWriteStream<AmqpMessage>- Returns:
- a future completed with the result
-
end
Same asWriteStream.end()but writes some data to the stream before ending.- Specified by:
endin interfaceWriteStream<AmqpMessage>- Parameters:
data- the data to write- Returns:
- a future completed with the result
-
rxEnd
Same asWriteStream.end()but writes some data to the stream before ending.- Specified by:
rxEndin interfaceWriteStream<AmqpMessage>- Parameters:
data- the data to write- Returns:
- a future completed with the result
-
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
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
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
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
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
Sends an AMQP message and waits for an acknowledgement. It returns a future 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:
- a future notified with the acknowledgement
-
rxSendWithAck
Sends an AMQP message and waits for an acknowledgement. It returns a future 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:
- a future notified with the acknowledgement
-
close
-
rxClose
Closes the sender.- Returns:
- a future notified when the sender has been closed
-
address
- Returns:
- the configured address.
-
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
-