Class OrderedMessage
java.lang.Object
dk.cloudcreate.essentials.shared.functional.tuple.Pair<Object,MessageMetaData>
dk.cloudcreate.essentials.components.foundation.messaging.queue.Message
dk.cloudcreate.essentials.components.foundation.messaging.queue.OrderedMessage
- All Implemented Interfaces:
dk.cloudcreate.essentials.shared.functional.tuple.Tuple<dk.cloudcreate.essentials.shared.functional.tuple.Pair<Object,,MessageMetaData>> Serializable
Represents a message that will be delivered in order.
This of course requires that message are queued in order and that the consumer is single threaded.
All messages sharing the same
An example of a message key is the id of the entity the message relates to
This of course requires that message are queued in order and that the consumer is single threaded.
All messages sharing the same
key, will be delivered according to their orderAn example of a message key is the id of the entity the message relates to
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringAll messages sharing the same key, will be delivered according to theirorder
An example of a message key is the id of the entity the message relates tofinal longFields inherited from class dk.cloudcreate.essentials.shared.functional.tuple.Pair
_1, _2 -
Constructor Summary
ConstructorsConstructorDescriptionOrderedMessage(Object payload, String key, long order) OrderedMessage(Object payload, String key, long order, MessageMetaData metaData) -
Method Summary
Modifier and TypeMethodDescriptiongetKey()All messages sharing the same key, will be delivered according to theirgetOrder()
An example of a message key is the id of the entity the message relates tolonggetOrder()Represent the order of a message relative to thegetKey().
All messages sharing the same key, will be delivered according to theirgetOrder()static OrderedMessageCreate a newMessageand an emptyMessageMetaDatastatic OrderedMessageof(Object payload, String key, long order, MessageMetaData metaData) Create a newMessagetoString()Methods inherited from class dk.cloudcreate.essentials.components.foundation.messaging.queue.Message
getMetaData, getPayload, of, ofMethods inherited from class dk.cloudcreate.essentials.shared.functional.tuple.Pair
_1, _2, arity, equals, hashCode, map, map, map1, map2, of, swap, toEntry, toList
-
Field Details
-
key
All messages sharing the same key, will be delivered according to theirorder
An example of a message key is the id of the entity the message relates to -
order
public final long order
-
-
Constructor Details
-
OrderedMessage
- Parameters:
payload- the message payloadkey- the message key. All messages sharing the same key, will be delivered according to theirgetOrder()order- the order of the message relative to thegetKey().
-
OrderedMessage
- Parameters:
payload- the message payloadkey- the message key. All messages sharing the same key, will be delivered according to theirgetOrder()order- the order of the message relative to thegetKey().metaData- theMessageMetaDataassociated with the message
-
-
Method Details
-
of
Create a newMessageand an emptyMessageMetaData- Parameters:
payload- the message payloadkey- the message key. All messages sharing the same key, will be delivered according to theirgetOrder()order- the order of the message relative to thegetKey().- Returns:
- the new
Message
-
of
Create a newMessage- Parameters:
payload- the message payloadkey- the message key. All messages sharing the same key, will be delivered according to theirgetOrder()order- the order of the message relative to thegetKey().metaData- theMessageMetaDataassociated with the message- Returns:
- the new
Message
-
getKey
All messages sharing the same key, will be delivered according to theirgetOrder()
An example of a message key is the id of the entity the message relates to- Returns:
- The message key
-
getOrder
public long getOrder()Represent the order of a message relative to thegetKey().
All messages sharing the same key, will be delivered according to theirgetOrder()- Returns:
- the order of a message relative to the
getKey()
-
toString
-