T - the type of Message to resolve the context for@FunctionalInterface public interface TargetContextResolver<T extends Message<?>>
Message should be
routed. This is used in multi-context situations, where certain Messages need to be routed to another "Bounded
Context" than the one the application itself is registered in.| Modifier and Type | Method and Description |
|---|---|
static TargetContextResolver<Message<?>> |
noOp()
Returns a no-op TargetContextResolver.
|
default TargetContextResolver<T> |
orElse(TargetContextResolver<? super T> other)
Returns a TargetContextResolver that uses
this instance to resolve a context for a given message and if
it returns null, returns the results of the other resolver instead. |
String |
resolveContext(T message)
Provides the context to which a message should be routed.
|
String resolveContext(T message)
message - the message to resolve the context fornull if the message does not specify
any contextdefault TargetContextResolver<T> orElse(TargetContextResolver<? super T> other)
this instance to resolve a context for a given message and if
it returns null, returns the results of the other resolver instead.other - the resolver that will provide a context if this doesn't return onethis, or the otherstatic TargetContextResolver<Message<?>> noOp()
null on any Message
provided.null on any Message
providedCopyright © 2010–2023. All rights reserved.