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
  • Field Details

    • logger

      static final org.slf4j.Logger logger
      Logger
    • RESOURCE_PATH

      static final String RESOURCE_PATH
      Message processor resource lookup path
      See Also:
    • TYPE_RESOLVER

      static final TypeResolver 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, 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:
      transform in interface MessageTransformer
      Parameters:
      message - the message to process.
      context - the current test context.
      Returns: