Class Message<E>

java.lang.Object
java.util.EventObject
com.hazelcast.topic.Message<E>
Type Parameters:
E - message type
All Implemented Interfaces:
Serializable

public class Message<E> extends EventObject
Message for ITopic.
See Also:
  • Field Details

    • messageObject

      protected E messageObject
  • Constructor Details

    • Message

      public Message(String topicName, E messageObject, long publishTime, Member publishingMember)
  • Method Details

    • getMessageObject

      public E getMessageObject()
      Returns the published message
      Returns:
      the published message object
    • getPublishTime

      public long getPublishTime()
      Return the time when the message is published
      Returns:
      the time when the message is published in milliseconds since 1970.01.01.
    • getPublishingMember

      public Member getPublishingMember()
      Returns the member that published the message.

      It can be that the member is null if:

      1. the message was send by a client and not a member
      2. the member that send the message, left the cluster before the message was processed.
      Returns:
      the member that published the message