Interface Messages
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
The message chain builder allows chaining message and configure metadata propagation. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic Messages.MessageChainBuilder
Chains the given message with some other messages.static <T> Message<T>
Merges multiple messages into a single one.Merges multiple messages into a single one.static Metadata
-
Method Details
-
chain
Chains the given message with some other messages. It coordinates the acknowledgement. When all the other messages are acknowledged successfully, the passed message is acknowledged. If one of the other messages is acknowledged negatively, the passed message is also nacked (with the same reason). Subsequent ack/nack will be ignored.- Parameters:
message
- the message- Returns:
- the chain builder that let you decide how the metadata are passed, and the set of messages.
-
merge
Merges multiple messages into a single one. This is an implementation of a merge pattern: n messages combined into 1.Whe resulting message payload is computed using the combinator function. When the returned message is acked/nacked, the passes messages are acked/nacked accordingly.
Metadata are also merged. The metadata of all the messages are copied into the resulting message. If, for a given class, the metadata is already present in the result message, it's either ignored, or merged if the class implements
MergeableMetadata
.- Type Parameters:
T
- the payload type of the produced message- Parameters:
list
- the list of message, must not be empty, must not be nullcombinator
- the combinator method, must not be null- Returns:
- the resulting message
-
merge
Merges multiple messages into a single one.Whe resulting message payload is computed using the combinator function. When the returned message is acked/nacked, the passes messages are acked/nacked accordingly.
Metadata are also merged. The metadata of all the messages are copied into the resulting message. If, for a given class, the metadata is already present in the result message, it's either ignored, or merged if the class implements
MergeableMetadata
.- Type Parameters:
T
- the payload type of the passed messages- Parameters:
list
- the list of message, must not be empty, must not be null- Returns:
- the resulting message
-
merge
-