Record Class Message<T>
java.lang.Object
java.lang.Record
com.iantapply.relay.api.Message<T>
- Type Parameters:
T- payload type- Record Components:
id- unique message identifiertopic- topic through which the message was decodedpayload- decoded payloadorigin- identifier of the publishing nodedestination- destination selected by the publishercreatedAt- publishing timestampcorrelationId- related message identifier, ornullheaders- immutable application metadata
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecorrelationIdrecord component.Returns the value of thecreatedAtrecord component.Returns the value of thedestinationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.id()Returns the value of theidrecord component.origin()Returns the value of theoriginrecord component.payload()Returns the value of thepayloadrecord component.topic()Returns the value of thetopicrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Message
public Message(MessageId id, Topic<T> topic, T payload, String origin, Destination destination, Instant createdAt, MessageId correlationId, Map<String, String> headers) Creates a message and defensively copies its headers.- Parameters:
id- unique message identifiertopic- decoding topicpayload- decoded payloadorigin- publishing node identifierdestination- intended recipientscreatedAt- publishing timestampcorrelationId- related message identifier, ornullheaders- application metadata
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
-
topic
-
payload
-
origin
-
destination
Returns the value of thedestinationrecord component.- Returns:
- the value of the
destinationrecord component
-
createdAt
-
correlationId
Returns the value of thecorrelationIdrecord component.- Returns:
- the value of the
correlationIdrecord component
-
headers
-