io.vertx.rxjava.core.eventbus

## Class Message<T>

- java.lang.Object
- - io.vertx.rxjava.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 will also have a `replyAddress()`. In that case the message can be replied to using that reply address, or, more simply by just 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.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Message(Message delegate)`

  - ### 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.
    `void` | `fail(int failureCode, String message)` Signal to the sender that processing of this message failed.
    `Object` | `getDelegate()`
    `MultiMap` | `headers()` Multi-map of message headers.
    `static <T> Message` | `newInstance(Message arg)`
    `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)` The same as `reply(R message)` but you can specify handler for the reply - i.e.
    `<R> Observable<Message<R>>` | `replyObservable(Object message, DeliveryOptions options)` The same as `reply(R message, DeliveryOptions)` but you can specify handler for the reply - i.e.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Message

          public Message(Message delegate)

  - ### Method Detail

    - #### getDelegate

          public Object 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.

    - #### 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 <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. to receive the reply to the reply.
      Parameters:
        `message` - the message to reply with.
        `replyHandler` - the reply handler for the reply.

    - #### replyObservable

          public <R> Observable<Message<R>> replyObservable(Object message)

      The same as `reply(R message)` but you can specify handler for the reply - i.e. to receive the reply to the reply.
      Parameters:
        `message` - the message to reply with.
      Returns:

    - #### reply

          public void reply(Object message,
                            DeliveryOptions options)

      Link `reply(java.lang.Object)` but allows you to specify delivery options for the reply.
      Parameters:
        `message` - the reply message
        `options` - the delivery options

    - #### reply

          public <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. to receive the reply to the reply.
      Parameters:
        `message` - the reply message
        `options` - the delivery options
        `replyHandler` - the reply handler for the reply.

    - #### replyObservable

          public <R> Observable<Message<R>> replyObservable(Object message,
                                                            DeliveryOptions options)

      The same as `reply(R message, DeliveryOptions)` but you can specify handler for the reply - i.e. to receive the reply to the reply.
      Parameters:
        `message` - the reply message
        `options` - the 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 newInstance(Message arg)

Copyright © 2016. All rights reserved.