Skip to main content

Definition

Assembly: CloudNimble.SimpleMessageBus.Core.dll Namespace: CloudNimble.SimpleMessageBus.Core

Syntax

Summary

Defines a message that supports metadata for passing data between handlers in the processing pipeline.

Remarks

Metadata provides a way to attach additional context and data to messages without modifying the core message structure. This is particularly useful for cross-cutting concerns like tracking, auditing, user context, and handler-to-handler communication. The metadata survives serialization and can be accessed by any handler in the processing chain.

Examples

Properties

Metadata Abstract

Gets or sets the thread-safe metadata storage for passing data between handlers in the processing pipeline.

Syntax

Property Value

Type: System.Collections.Concurrent.ConcurrentDictionary<string, object> A ConcurrentDictionary`2 where keys are string identifiers and values are objects containing the metadata. The dictionary must be thread-safe as it may be accessed concurrently.

Examples

Remarks

This metadata dictionary is preserved during message serialization/deserialization and provides a mechanism for handlers to communicate with each other without coupling their interfaces. Common use cases include tracking user context, request IDs, processing timestamps, and handler-specific state. When using metadata, prefer well-known key names and document their usage to avoid conflicts between handlers. Values should be serializable types to ensure compatibility across different storage providers.