Class AmqpSender
- All Implemented Interfaces:
MutinyDelegate,StreamBase,WriteStream<AmqpMessage>
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- See Also:
-
AmqpSender
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase
StreamBase.StreamBaseImplNested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.WriteStream
WriteStream.WriteStreamImpl<T> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAmqpSender(io.vertx.amqp.AmqpSender delegate) Create a new instance ofAmqpSenderdelegating to the given (non-null) instance ofAmqpSender.AmqpSender(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionaddress()io.smallrye.mutiny.Uni<Void>close()Closes the sender.voidCloses the sender.Closes the sender.Gets the connection having created the sender.drainHandler(Runnable handler) Set a drain handler on the stream.io.smallrye.mutiny.Uni<Void>end()Ends the stream.io.smallrye.mutiny.Uni<Void>end(AmqpMessage data) Same asend()but writes some data to the stream before ending.voidEnds the stream.voidendAndAwait(AmqpMessage data) Same asend()but writes some data to the stream before ending.Ends the stream.endAndForget(AmqpMessage data) Same asend()but writes some data to the stream before ending.booleanexceptionHandler(Consumer<Throwable> handler) Set an exception handler on the write stream.io.vertx.amqp.AmqpSenderGet the delegate instance.inthashCode()static AmqpSendernewInstance(io.vertx.amqp.AmqpSender delegate) Creates a new instance of theAmqpSender.longsend(AmqpMessage message) Sends an AMQP message.io.smallrye.mutiny.Uni<Void>sendWithAck(AmqpMessage message) Sends an AMQP message and waits for an acknowledgement.voidsendWithAckAndAwait(AmqpMessage message) Sends an AMQP message and waits for an acknowledgement.sendWithAckAndForget(AmqpMessage message) Sends an AMQP message and waits for an acknowledgement.setWriteQueueMaxSize(int maxSize) Set the maximum size of the write queue tomaxSize.toString()Converts the current write stream to a subscriber.io.vertx.proton.ProtonSenderunwrap()io.smallrye.mutiny.Uni<Void>write(AmqpMessage data) Write some data to the stream.voidwriteAndAwait(AmqpMessage data) Write some data to the stream.writeAndForget(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
public AmqpSender(io.vertx.amqp.AmqpSender delegate) Create a new instance ofAmqpSenderdelegating to the given (non-null) instance ofAmqpSender. -
AmqpSender
-
-
Method Details
-
getDelegate
public io.vertx.amqp.AmqpSender getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceStreamBase- Specified by:
getDelegatein interfaceWriteStream<AmqpMessage>- Returns:
- the delegate instance
-
sendWithAck
Sends an AMQP message and waits for an acknowledgement. It returns a uni 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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
message- the message, must not benull- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.amqp.AmqpSender#sendWithAck(AmqpMessage)
-
sendWithAckAndAwait
Sends an AMQP message and waits for an acknowledgement. It returns a underlying uni 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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
message- the message, must not benull- See Also:
-
io.vertx.amqp.AmqpSender#sendWithAck(AmqpMessage)
-
sendWithAckAndForget
Sends an AMQP message and waits for an acknowledgement. It returns a underlying uni 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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
message- the message, must not benull- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.amqp.AmqpSender#sendWithAck(AmqpMessage)
-
close
Closes the sender.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
AmqpSender.close()
-
closeAndAwait
public void closeAndAwait()Closes the sender.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
AmqpSender.close()
-
closeAndForget
Closes the sender.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
AmqpSender.close()
-
end
Same asend()but writes some data to the stream before ending.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
endin interfaceWriteStream<AmqpMessage>- Parameters:
data- the data to write- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
WriteStream.end(T)
-
endAndAwait
Same asend()but writes some data to the stream before ending.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
data- the data to write- See Also:
-
WriteStream.end(T)
-
endAndForget
Same asend()but writes some data to the stream before ending.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
data- the data to write- Returns:
- The current instance to chain operations if needed.
- See Also:
-
WriteStream.end(T)
-
end
Ends the stream.Once the stream has ended, it cannot be used any more.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
endin interfaceWriteStream<AmqpMessage>- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
WriteStream.end()
-
endAndAwait
public void endAndAwait()Ends the stream.Once the stream has ended, it cannot be used any more.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
WriteStream.end()
-
endAndForget
Ends the stream.Once the stream has ended, it cannot be used any more.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
WriteStream.end()
-
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
writeQueueFull()method before writing. This is done automatically if using aPipe.When the
datais moved from the queue to the actual medium, the returnedFuturewill be completed with the write result, e.g the uni 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.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
writein interfaceWriteStream<AmqpMessage>- Parameters:
data- the data to write- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
WriteStream.write(T)
-
writeAndAwait
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
writeQueueFull()method before writing. This is done automatically if using aPipe.When the
datais moved from the queue to the actual medium, the returnedFuturewill be completed with the write result, e.g the underlying uni 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.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
data- the data to write- See Also:
-
WriteStream.write(T)
-
writeAndForget
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
writeQueueFull()method before writing. This is done automatically if using aPipe.When the
datais moved from the queue to the actual medium, the returnedFuturewill be completed with the write result, e.g the underlying uni 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.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
data- the data to write- Returns:
- The current instance to chain operations if needed.
- See Also:
-
WriteStream.write(T)
-
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. Can benull.- 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
-
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.
-
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. SeePipefor 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
-
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
-
newInstance
Creates a new instance of theAmqpSender. -
hashCode
public int hashCode() -
equals
-
toString
-
toSubscriber
Converts the current write stream to a subscriber.
-