Package com.consol.citrus.message
Interface MessageProcessor
-
- All Superinterfaces:
MessageTransformer
- All Known Subinterfaces:
DataDictionary<T>,ValidationProcessor,VariableExtractor
- All Known Implementing Classes:
AbstractMessageProcessor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MessageProcessor extends MessageTransformer
Processor performs operations on the given message. The processor is able to change message content such as payload and headers.- Author:
- Christoph Deppisch
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMessageProcessor.Builder<T extends MessageProcessor,B extends MessageProcessor.Builder<T,B>>Fluent builder
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerLOGLoggerstatic StringRESOURCE_PATHMessage processor resource lookup pathstatic TypeResolverTYPE_RESOLVERType resolver to find custom message processors on classpath via resource path lookup
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <T extends MessageProcessor,B extends MessageProcessor.Builder<T,B>>
Optional<MessageProcessor.Builder<T,B>>lookup(String processor)Resolves processor from resource path lookup with given processor resource name.voidprocess(Message message, TestContext context)Process message with given test context.default Messagetransform(Message message, TestContext context)Adapt to message transformer API.
-
-
-
Field Detail
-
LOG
static final org.slf4j.Logger LOG
Logger
-
RESOURCE_PATH
static final String RESOURCE_PATH
Message processor resource lookup path- See Also:
- Constant Field Values
-
TYPE_RESOLVER
static final TypeResolver TYPE_RESOLVER
Type resolver to find custom message processors on classpath via resource path lookup
-
-
Method Detail
-
lookup
static <T extends MessageProcessor,B extends MessageProcessor.Builder<T,B>> Optional<MessageProcessor.Builder<T,B>> lookup(String processor)
Resolves processor from resource path lookup with given processor resource name. Scans classpath for processor meta information with given name and returns instance of processor. Returns optional instead of throwing exception when no processor could be found.- Parameters:
processor-- Returns:
-
process
void process(Message message, TestContext context)
Process message with given test context. Processors can change the message payload and headers.- Parameters:
message- the message to process.context- the current test context.
-
transform
default Message transform(Message message, TestContext context)
Adapt to message transformer API.- Specified by:
transformin interfaceMessageTransformer- Parameters:
message- the message to process.context- the current test context.- Returns:
-
-