Dynamic Message Deserialization
Overview
DataType Channel Pattern (Default)
DataType Channel Example
// DataType Channel - One type per subscription
var subscription = new KafkaSubscription<TaskCreated>(
new SubscriptionName("paramore.example.tasks"),
channelName: new ChannelName("task.created"),
routingKey: new RoutingKey("task.created"),
groupId: "task-processor",
timeOut: TimeSpan.FromMilliseconds(100)
);Dynamic Message Deserialization
When to Use Dynamic Deserialization
How It Works
Using CloudEvents Type for Routing
CloudEvents Type Routing Example
Setting CloudEvents Type on Publication
Custom Routing Strategies
Routing by Custom Header
Routing by Message Body Content
Handler Routing
Standard 1-to-1 Handler Mapping
Integration with Agreement Dispatcher
Performance Considerations
Runtime Type Resolution
Configuration Examples
Kafka with CloudEvents Routing
RabbitMQ with CloudEvents Routing
AWS SQS with CloudEvents Routing
Best Practices
1. Use CloudEvents Type for Routing
2. Provide Comprehensive Type Mappings
3. Use Meaningful CloudEvents Types
4. Consider DataType Channel First
5. Cache Performance-Critical Paths
6. Document Type Mappings
Comparison: DataType Channel vs Dynamic Deserialization
Aspect
DataType Channel
Dynamic Deserialization
Error Handling
Further Reading
Sample Code
Last updated
Was this helpful?
