io.vertx.rxjava3.core.eventbus

## Class Message<T>

- java.lang.Object
- - io.vertx.rxjava3.core.eventbus.Message<T>

-     public class Message<T>
      extends Object

  Represents a message that is received from the event bus in a handler.

  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 RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<Message>` | `__TYPE_ARG`
    `io.vertx.lang.rx.TypeArg<T>` | `__typeArg_0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Message(Message delegate)`
    `Message(Object delegate, io.vertx.lang.rx.TypeArg<T> typeArg_0)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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, io.vertx.lang.rx.TypeArg<T> __typeArg_T)`
    `void` | `reply(Object message)` Reply to this message.
    `void` | `reply(Object message, DeliveryOptions options)` Link but allows you to specify delivery options for the reply.
    `String` | `replyAddress()` The reply address.
    `<R> Single<Message<R>>` | `replyAndRequest(Object message)` Reply to this message, specifying a `replyHandler` for the reply - i.e.
    `<R> Single<Message<R>>` | `replyAndRequest(Object message, DeliveryOptions options)` Like but specifying `options` that can be used to configure the delivery.
    `<R> Single<Message<R>>` | `rxReplyAndRequest(Object message)` Reply to this message, specifying a `replyHandler` for the reply - i.e.
    `<R> Single<Message<R>>` | `rxReplyAndRequest(Object message, DeliveryOptions options)` Like but specifying `options` that can be used to configure the delivery.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<Message> __TYPE_ARG

    - #### __typeArg_0

          public final io.vertx.lang.rx.TypeArg<T> __typeArg_0

  - ### Constructor Detail

    - #### Message

          public Message(Message delegate)

    - #### Message

          public Message(Object delegate,
                         io.vertx.lang.rx.TypeArg<T> typeArg_0)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public Message getDelegate()

    - #### address

          public String address()

      The address the message was sent to
      Returns:

    - #### headers

          public MultiMap headers()

      Multi-map of message headers. Can be empty
      Returns:
        the headers

    - #### body

          public T body()

      The body of the message. Can be null.
      Returns:
        the body, or null.

    - #### replyAddress

          public String 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

          public void reply(Object message)

      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.

    - #### reply

          public void reply(Object message,
                            DeliveryOptions options)

      Link but allows you to specify delivery options for the reply.
      Parameters:
        `message` - the reply message
        `options` - the delivery options

    - #### replyAndRequest

          public <R> Single<Message<R>> replyAndRequest(Object message)

      Reply to this message, specifying a `replyHandler` for 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.

      Parameters:
        `message` - the message to reply with.
      Returns:

    - #### rxReplyAndRequest

          public <R> Single<Message<R>> rxReplyAndRequest(Object message)

      Reply to this message, specifying a `replyHandler` for 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.

      Parameters:
        `message` - the message to reply with.
      Returns:

    - #### replyAndRequest

          public <R> Single<Message<R>> replyAndRequest(Object message,
                                                        DeliveryOptions options)

      Like but specifying `options` that can be used to configure the delivery.
      Parameters:
        `message` - the message body, may be `null`
        `options` - delivery options
      Returns:

    - #### rxReplyAndRequest

          public <R> Single<Message<R>> rxReplyAndRequest(Object message,
                                                          DeliveryOptions options)

      Like but specifying `options` that can be used to configure the delivery.
      Parameters:
        `message` - the message body, may be `null`
        `options` - delivery options
      Returns:

    - #### fail

          public void fail(int failureCode,
                           String message)

      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 sender
        `message` - A message to pass back to the sender

    - #### newInstance

          public static <T> Message<T> newInstance(Message arg)

    - #### newInstance

          public static <T> Message<T> newInstance(Message arg,
                                                   io.vertx.lang.rx.TypeArg<T> __typeArg_T)

Copyright © 2022 Eclipse. All rights reserved.