Module processor

Source
Expand description

§Message Processor Implementations for TAP Node

This module provides message processing functionality for TAP Node. Message processors serve as middleware in the message handling pipeline, allowing for validation, transformation, and filtering of messages as they flow through the system.

§Message Processing Pipeline

The TAP Node uses a pipeline architecture for message processing, where messages pass through a series of processors in sequence. Each processor can:

  • Pass the message through unchanged
  • Transform the message in some way
  • Filter out (drop) messages based on certain criteria
  • Perform side effects (logging, metrics collection, etc.)

§Processor Types

The module provides several built-in processor implementations:

  • LoggingMessageProcessor: Logs information about messages passing through the system
  • ValidationMessageProcessor: Validates message structure and content
  • DefaultMessageProcessor: A simple pass-through processor with minimal functionality
  • CompositeMessageProcessor: Combines multiple processors into a processing chain

§Custom Processors

You can create custom processors by implementing the MessageProcessor trait. This allows for specialized processing such as:

  • Message transformation for protocol version compatibility
  • Content-based filtering and routing
  • Security scanning and anomaly detection
  • Metrics collection and performance monitoring

§Processing Modes

Each processor implements two key methods:

  • process_incoming(): For messages received by the node
  • process_outgoing(): For messages being sent from the node

This separation allows for different processing logic depending on message direction.

Structs§

DefaultMessageProcessor
Default message processor with core functionality
DefaultMessageProcessorImpl
Default message processor that logs and validates messages
LoggingMessageProcessor
A message processor that logs messages
ValidationMessageProcessor
A message processor that validates messages

Traits§

MessageProcessor
Trait for processing DIDComm messages in TAP nodes