Class Message<T>
- All Implemented Interfaces:
MutinyDelegate
Messages have a body(), which can be null, and also headers(), which can be empty.
If the message was sent specifying a reply handler, it can be replied to using reply(java.lang.Object).
If you want to notify the sender that processing failed, then fail(int, java.lang.String) can be called.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tim Fox
- See Also:
-
Message
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()The address the message was sent tobody()The body of the message.booleanvoidSignal to the sender that processing of this message failed.io.vertx.core.eventbus.Message<T>Get the delegate instance.inthashCode()io.vertx.core.MultiMapheaders()Multi-map of message headers.booleanisSend()Signals if this message represents a send or publish event.static <T> Message<T>newInstance(io.vertx.core.eventbus.Message<T> delegate) Creates a new instance of theMessage.static <T> Message<T>newInstance(io.vertx.core.eventbus.Message<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theMessage.voidReply to this message.voidLinkreply(Object)but allows you to specify delivery options for the reply.The reply address.<R> io.smallrye.mutiny.Uni<Message<R>>replyAndRequest(Object message) Reply to this message, specifying areplyHandlerfor the reply - i.e.<R> io.smallrye.mutiny.Uni<Message<R>>replyAndRequest(Object message, io.vertx.core.eventbus.DeliveryOptions options) LikereplyAndRequest(Object)but specifyingoptionsthat can be used to configure the delivery.<R> Message<R>replyAndRequestAndAwait(Object message) Reply to this message, specifying areplyHandlerfor the reply - i.e.<R> Message<R>replyAndRequestAndAwait(Object message, io.vertx.core.eventbus.DeliveryOptions options) LikereplyAndRequest(Object)but specifyingoptionsthat can be used to configure the delivery.replyAndRequestAndForget(Object message) Reply to this message, specifying areplyHandlerfor the reply - i.e.replyAndRequestAndForget(Object message, io.vertx.core.eventbus.DeliveryOptions options) LikereplyAndRequest(Object)but specifyingoptionsthat can be used to configure the delivery.toString()
-
Field Details
-
__TYPE_ARG
-
__typeArg_0
-
-
Constructor Details
-
Message
Create a new instance ofMessagedelegating to the given (non-null) instance ofMessage. -
Message
-
Message
-
-
Method Details
-
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- Returns:
- the delegate instance
-
replyAndRequest
Reply to this message, specifying areplyHandlerfor the reply - i.e. to receive the reply to the reply.If the message was sent specifying a reply handler, that handler will be called when it has received a reply. If the message wasn't sent specifying a receipt handler this method does nothing.
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 to reply with. Can benull.- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
Message.replyAndRequest(Object)
-
replyAndRequestAndAwait
Reply to this message, specifying areplyHandlerfor the reply - i.e. to receive the reply to the reply.If the message was sent specifying a reply handler, that handler will be called when it has received a reply. If the message wasn't sent specifying a receipt handler this method does nothing.
Unlike the bare Vert.x variant, this method returns a
Message<R>. 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 to reply with.- Returns:
- The operation result
- See Also:
-
Message.replyAndRequest(Object)
-
replyAndRequestAndForget
Reply to this message, specifying areplyHandlerfor the reply - i.e. to receive the reply to the reply.If the message was sent specifying a reply handler, that handler will be called when it has received a reply. If the message wasn't sent specifying a receipt handler this method does nothing.
Unlike the bare Vert.x variant, this method ignores the
Message<R>result or any failure.- Parameters:
message- the message to reply with.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
Message.replyAndRequest(Object)
-
replyAndRequest
@CheckReturnValue public <R> io.smallrye.mutiny.Uni<Message<R>> replyAndRequest(Object message, io.vertx.core.eventbus.DeliveryOptions options) LikereplyAndRequest(Object)but specifyingoptionsthat can be used to configure the delivery.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 body, may benulloptions- delivery options- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
Message.replyAndRequest(Object, DeliveryOptions)
-
replyAndRequestAndAwait
public <R> Message<R> replyAndRequestAndAwait(Object message, io.vertx.core.eventbus.DeliveryOptions options) LikereplyAndRequest(Object)but specifyingoptionsthat can be used to configure the delivery.Unlike the bare Vert.x variant, this method returns a
Message<R>. 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 body, may benulloptions- delivery options- Returns:
- The operation result
- See Also:
-
Message.replyAndRequest(Object, DeliveryOptions)
-
replyAndRequestAndForget
public <R> Message<T> replyAndRequestAndForget(Object message, io.vertx.core.eventbus.DeliveryOptions options) LikereplyAndRequest(Object)but specifyingoptionsthat can be used to configure the delivery.Unlike the bare Vert.x variant, this method ignores the
Message<R>result or any failure.- Parameters:
message- the message body, may benulloptions- delivery options- Returns:
- The current instance to chain operations if needed.
- See Also:
-
Message.replyAndRequest(Object, DeliveryOptions)
-
address
The address the message was sent to -
headers
public io.vertx.core.MultiMap headers()Multi-map of message headers. Can be empty- Returns:
- the headers
-
body
The body of the message. Can be null.- Returns:
- the body, or null.
-
replyAddress
The reply address. Can be null.- Returns:
- the reply address, or null, if message was sent without a reply handler.
-
isSend
public boolean isSend()Signals if this message represents a send or publish event.- Returns:
- true if this is a send.
-
reply
Reply to this message.If the message was sent specifying a reply handler, that handler will be called when it has received a reply. If the message wasn't sent specifying a receipt handler this method does nothing.
- Parameters:
message- the message to reply with. Can benull.
-
reply
Linkreply(Object)but allows you to specify delivery options for the reply.- Parameters:
message- the reply message. Can benull.options- the delivery options
-
fail
Signal to the sender that processing of this message failed.If the message was sent specifying a result handler the handler will be called with a failure corresponding to the failure code and message specified here.
- Parameters:
failureCode- A failure code to pass back to the sendermessage- A message to pass back to the sender
-
newInstance
Creates a new instance of theMessage. -
newInstance
public static <T> Message<T> newInstance(io.vertx.core.eventbus.Message<T> delegate, TypeArg<T> typeArg_0) Creates a new instance of theMessage. -
hashCode
public int hashCode() -
equals
-
toString
-