Package org.citrusframework.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.
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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceMessageProcessor.Builder<T extends MessageProcessor,B extends MessageProcessor.Builder<T, B>> Fluent builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.LoggerLoggerstatic final StringMessage processor resource lookup pathstatic final TypeResolverType resolver to find custom message processors on classpath via resource path lookup -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends MessageProcessor,B extends MessageProcessor.Builder<T, B>>
Optional<MessageProcessor.Builder<T,B>> 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 Details
-
logger
static final org.slf4j.Logger loggerLogger -
RESOURCE_PATH
Message processor resource lookup path- See Also:
-
TYPE_RESOLVER
Type resolver to find custom message processors on classpath via resource path lookup
-
-
Method Details
-
lookup
static <T extends MessageProcessor,B extends MessageProcessor.Builder<T, Optional<MessageProcessor.Builder<T,B>> 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
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
Adapt to message transformer API.- Specified by:
transformin interfaceMessageTransformer- Parameters:
message- the message to process.context- the current test context.- Returns:
-