Enum SkipBehavior
Defines the behavior when message processing is skipped due to filtering, conditions, or validation failures. Controls how the messaging system responds to scenarios where normal processing cannot or should not proceed.
public enum SkipBehavior
- Extension Methods
Fields
LogOnly = 1Skip processing but log the skip event for monitoring and debugging purposes. Provides visibility into skipped messages without affecting the processing result.
This option balances performance with observability by recording skip events in the application logs. The log entry typically includes message metadata, skip reason, and context information for troubleshooting.
Recommended for production environments where monitoring skipped messages is important for operational visibility and debugging.
Silent = 0Skip processing silently without any logging or feedback. The message is discarded and no trace of the skip operation is recorded.
This option provides the best performance as it avoids any logging overhead, but may make troubleshooting difficult in production environments where visibility into skipped messages is important.
Use this option when message skipping is expected behavior and doesn't require monitoring or debugging support.
ThrowOnDuplicate = 2Throw an exception when a duplicate message is detected. Enables the calling code to catch the DuplicateMessageException and take specific action.
This option provides the most control by surfacing duplicate detection as an exception, allowing calling code to implement custom retry logic, alternative processing paths, or user notifications.
Use this option when the application needs to respond differently to duplicate messages and silent skipping or logging alone is insufficient.
Remarks
Skip behaviors provide fine-grained control over messaging flow when messages cannot be processed through the normal pipeline. This enables applications to handle edge cases, implement circuit breakers, and provide appropriate feedback for monitoring and debugging purposes.
The choice of skip behavior affects both the runtime behavior and observability characteristics of the messaging system, making it important to select the appropriate option based on operational requirements and monitoring needs.