public class Message<T> extends Object
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.
original non RX-ified interface using Vert.x codegen.| Modifier and Type | Field and Description |
|---|---|
static <any> |
__TYPE_ARG |
<any> |
__typeArg_0 |
| Constructor and Description |
|---|
Message(Message delegate) |
Message(Message delegate,
<any> typeArg_0) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
The address the message was sent to
|
T |
body()
The body of the message.
|
boolean |
equals(Object o) |
void |
fail(int failureCode,
String message)
Signal to the sender that processing of this message failed.
|
Message |
getDelegate() |
int |
hashCode() |
MultiMap |
headers()
Multi-map of message headers.
|
boolean |
isSend()
Signals if this message represents a send or publish event.
|
static <T> Message<T> |
newInstance(Message arg) |
static <T> Message<T> |
newInstance(Message arg,
<any> __typeArg_T) |
void |
reply(Object message)
Reply to this message.
|
void |
reply(Object message,
DeliveryOptions options)
Link
reply(java.lang.Object) but allows you to specify delivery options for the reply. |
<R> void |
reply(Object message,
DeliveryOptions options,
Handler<AsyncResult<Message<R>>> replyHandler)
The same as
reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e. |
<R> void |
reply(Object message,
Handler<AsyncResult<Message<R>>> replyHandler)
The same as
reply(R message) but you can specify handler for the reply - i.e. |
String |
replyAddress()
The reply address.
|
<R> Observable<Message<R>> |
replyObservable(Object message)
Deprecated.
use
rxReply(java.lang.Object) instead |
<R> Observable<Message<R>> |
replyObservable(Object message,
DeliveryOptions options)
Deprecated.
use
rxReply(java.lang.Object) instead |
<R> Single<Message<R>> |
rxReply(Object message)
The same as
reply(R message) but you can specify handler for the reply - i.e. |
<R> Single<Message<R>> |
rxReply(Object message,
DeliveryOptions options)
The same as
reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e. |
String |
toString() |
public static final <any> __TYPE_ARG
public final <any> __typeArg_0
public Message(Message delegate)
public Message(Message delegate, <any> typeArg_0)
public Message getDelegate()
public String address()
public MultiMap headers()
public T body()
public String replyAddress()
public boolean isSend()
public void reply(Object 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.
message - the message to reply with.public <R> void reply(Object message, Handler<AsyncResult<Message<R>>> replyHandler)
reply(R message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.message - the message to reply with.replyHandler - the reply handler for the reply.@Deprecated public <R> Observable<Message<R>> replyObservable(Object message)
rxReply(java.lang.Object) insteadreply(R message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.message - the message to reply with.public <R> Single<Message<R>> rxReply(Object message)
reply(R message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.message - the message to reply with.public void reply(Object message, DeliveryOptions options)
reply(java.lang.Object) but allows you to specify delivery options for the reply.message - the reply messageoptions - the delivery optionspublic <R> void reply(Object message, DeliveryOptions options, Handler<AsyncResult<Message<R>>> replyHandler)
reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e.
to receive the reply to the reply.message - the reply messageoptions - the delivery optionsreplyHandler - the reply handler for the reply.@Deprecated public <R> Observable<Message<R>> replyObservable(Object message, DeliveryOptions options)
rxReply(java.lang.Object) insteadreply(R message, DeliveryOptions) but you can specify handler for the reply - i.e.
to receive the reply to the reply.message - the reply messageoptions - the delivery optionspublic <R> Single<Message<R>> rxReply(Object message, DeliveryOptions options)
reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e.
to receive the reply to the reply.message - the reply messageoptions - the delivery optionspublic void fail(int failureCode,
String message)
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.
failureCode - A failure code to pass back to the sendermessage - A message to pass back to the senderCopyright © 2018 Eclipse. All rights reserved.