Interface Message<S,T>


public interface Message<S,T>
General message abstraction for any type of Event / Message published by MongoDB server to the client. This might be Change Stream Events, or Documents published by a tailable cursor. The original message received is preserved in the raw parameter. Additional information about the origin of the Message is contained in Message.MessageProperties.
For convenience the getBody() of the message gets lazily converted into the target domain type if necessary using the mapping infrastructure.
Since:
2.1
Author:
Christoph Strobl, Mark Paluch, Myroslav Kosinskyi
See Also:
  • Method Details

    • getRaw

      @Nullable S getRaw()
      The raw message source as emitted by the origin.
      Returns:
      can be null.
    • getBody

      @Nullable T getBody()
      The converted message body if available.
      Returns:
      can be null.
    • getBodyBeforeChange

      @Nullable default T getBodyBeforeChange()
      The converted message body before change if available.
      Returns:
      can be null.
      Since:
      4.0
    • getProperties

      Message.MessageProperties getProperties()
      Message.MessageProperties containing information about the Message origin and other metadata.
      Returns:
      never null.