Class AmqpSender
- java.lang.Object
-
- io.vertx.mutiny.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 Mutiny-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(io.vertx.amqp.AmqpSender delegate)AmqpSender(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringaddress()io.smallrye.mutiny.Uni<Void>close()Closes the sender.VoidcloseAndAwait()Blocking variant ofclose().voidcloseAndForget()Variant ofclose()that ignores the result of the operation.AmqpConnectionconnection()WriteStream<AmqpMessage>drainHandler(Runnable arg0)io.smallrye.mutiny.Uni<Void>end()Same asWriteStream.end()but with anhandlercalled when the operation completesio.smallrye.mutiny.Uni<Void>end(AmqpMessage data)Same as but with anhandlercalled when the operation completesVoidendAndAwait()Blocking variant ofWriteStream.end().VoidendAndAwait(AmqpMessage data)Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#end(T).voidendAndForget()Variant ofWriteStream.end()that ignores the result of the operation.voidendAndForget(AmqpMessage data)Variant ofio.vertx.mutiny.core.streams.WriteStream#end(T)that ignores the result of the operation.booleanequals(Object o)AmqpSenderexceptionHandler(Consumer<Throwable> handler)io.vertx.amqp.AmqpSendergetDelegate()inthashCode()static AmqpSendernewInstance(io.vertx.amqp.AmqpSender arg)longremainingCredits()AmqpSendersend(AmqpMessage message)io.smallrye.mutiny.Uni<Void>sendWithAck(AmqpMessage message)Sends an AMQP message and waits for an acknowledgement.VoidsendWithAckAndAwait(AmqpMessage message)Blocking variant ofsendWithAck(io.vertx.mutiny.amqp.AmqpMessage).AmqpSendersendWithAckAndForget(AmqpMessage message)Variant ofsendWithAck(io.vertx.mutiny.amqp.AmqpMessage)that ignores the result of the operation.AmqpSendersetWriteQueueMaxSize(int maxSize)StringtoString()WriteStreamSubscriber<AmqpMessage>toSubscriber()io.vertx.proton.ProtonSenderunwrap()io.smallrye.mutiny.Uni<Void>write(AmqpMessage arg0)Same as but with anhandlercalled when the operation completesVoidwriteAndAwait(AmqpMessage arg0)Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(T).voidwriteAndForget(AmqpMessage arg0)Variant ofio.vertx.mutiny.core.streams.WriteStream#write(T)that ignores the result of the operation.booleanwriteQueueFull()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<AmqpSender> __TYPE_ARG
-
-
Constructor Detail
-
AmqpSender
public AmqpSender(io.vertx.amqp.AmqpSender delegate)
-
AmqpSender
public AmqpSender(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.amqp.AmqpSender getDelegate()
- Specified by:
getDelegatein interfaceStreamBase- Specified by:
getDelegatein interfaceWriteStream<AmqpMessage>
-
toSubscriber
@CheckReturnValue public WriteStreamSubscriber<AmqpMessage> toSubscriber()
-
write
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> write(AmqpMessage arg0)
Description copied from interface:WriteStreamSame as but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
writein interfaceWriteStream<AmqpMessage>- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
public Void writeAndAwait(AmqpMessage arg0)
Description copied from interface:WriteStreamBlocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(T).This method waits 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 a RuntimeException).
- Specified by:
writeAndAwaitin interfaceWriteStream<AmqpMessage>- Returns:
- the Void instance produced by the operation.
-
writeAndForget
public void writeAndForget(AmqpMessage arg0)
Description copied from interface:WriteStreamVariant ofio.vertx.mutiny.core.streams.WriteStream#write(T)that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.streams.WriteStream#write(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.streams.WriteStream#write(T)but you don't need to compose it with other operations.- Specified by:
writeAndForgetin interfaceWriteStream<AmqpMessage>
-
end
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> end()
Description copied from interface:WriteStreamSame asWriteStream.end()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
endin interfaceWriteStream<AmqpMessage>- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
public Void endAndAwait()
Description copied from interface:WriteStreamBlocking variant ofWriteStream.end().This method waits 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 a RuntimeException).
- Specified by:
endAndAwaitin interfaceWriteStream<AmqpMessage>- Returns:
- the Void instance produced by the operation.
-
endAndForget
public void endAndForget()
Description copied from interface:WriteStreamVariant ofWriteStream.end()that ignores the result of the operation.This method subscribes on the result of
WriteStream.end(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWriteStream.end()but you don't need to compose it with other operations.- Specified by:
endAndForgetin interfaceWriteStream<AmqpMessage>
-
end
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> end(AmqpMessage data)
Description copied from interface:WriteStreamSame as but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
endin interfaceWriteStream<AmqpMessage>- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
public Void endAndAwait(AmqpMessage data)
Description copied from interface:WriteStreamBlocking variant ofio.vertx.mutiny.core.streams.WriteStream#end(T).This method waits 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 a RuntimeException).
- Specified by:
endAndAwaitin interfaceWriteStream<AmqpMessage>- Returns:
- the Void instance produced by the operation.
-
endAndForget
public void endAndForget(AmqpMessage data)
Description copied from interface:WriteStreamVariant ofio.vertx.mutiny.core.streams.WriteStream#end(T)that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.streams.WriteStream#end(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.streams.WriteStream#end(T)but you don't need to compose it with other operations.- Specified by:
endAndForgetin interfaceWriteStream<AmqpMessage>
-
writeQueueFull
public boolean writeQueueFull()
- Specified by:
writeQueueFullin interfaceWriteStream<AmqpMessage>- Returns:
trueif write queue is full
-
drainHandler
public WriteStream<AmqpMessage> drainHandler(Runnable arg0)
- Specified by:
drainHandlerin interfaceWriteStream<AmqpMessage>- Parameters:
arg0- the handler- Returns:
-
exceptionHandler
public AmqpSender exceptionHandler(Consumer<Throwable> handler)
- Specified by:
exceptionHandlerin interfaceStreamBase- Specified by:
exceptionHandlerin interfaceWriteStream<AmqpMessage>- Parameters:
handler- the exception handler- Returns:
-
setWriteQueueMaxSize
public AmqpSender setWriteQueueMaxSize(int maxSize)
- 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)
- Parameters:
message- the message, must not benull- Returns:
- the current sender
-
sendWithAck
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> 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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
message- the message, must not benull- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
sendWithAckAndAwait
public Void sendWithAckAndAwait(AmqpMessage message)
Blocking variant ofsendWithAck(io.vertx.mutiny.amqp.AmqpMessage).This method waits 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 a RuntimeException).
- Parameters:
message- the message, must not benull- Returns:
- the Void instance produced by the operation.
-
sendWithAckAndForget
public AmqpSender sendWithAckAndForget(AmqpMessage message)
Variant ofsendWithAck(io.vertx.mutiny.amqp.AmqpMessage)that ignores the result of the operation.This method subscribes on the result of
sendWithAck(io.vertx.mutiny.amqp.AmqpMessage), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendWithAck(io.vertx.mutiny.amqp.AmqpMessage)but you don't need to compose it with other operations.- Parameters:
message- the message, must not benull- Returns:
- the instance of AmqpSender to chain method calls.
-
close
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
Closes the sender.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
public Void closeAndAwait()
Blocking variant ofclose().This method waits 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 a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget()
-
address
public String address()
- Returns:
- the configured address.
-
connection
public AmqpConnection connection()
- 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(io.vertx.amqp.AmqpSender arg)
-
-