Cephalon.Behaviors.Messaging
เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน
Maturity:
M1· Ownership: application-managed · Family:behaviors· See audit, matrix.
Cephalon.Behaviors.Messaging is the messaging transport baseline for the Adaptive Behavior Topology (ABT).
What it owns
Section titled “What it owns”- InMemoryTransportBinding — zero-infra bounded
Channel<T>for tests and local dev - RabbitMqTransportBinding — AMQP/RabbitMQ transport with lazy connect, retry, and dead-letter routing
- KafkaTransportBinding — Confluent Kafka transport with consumer group, manual offset commit
- MessagingBehaviorBindingRegistry —
FrozenDictionaryO(1) registry for all 3 bindings - Hosting —
AddMessagingBehaviorBindings()extension onIBehaviorCollectionBuilder
Transport identifiers
Section titled “Transport identifiers”| Transport ID | Binding | Infrastructure |
|---|---|---|
in-memory | InMemoryTransportBinding | None (in-process Channel<T>) |
rabbitmq | RabbitMqTransportBinding | RabbitMQ / AMQP 0-9-1 |
kafka | KafkaTransportBinding | Apache Kafka / Confluent |
Registration
Section titled “Registration”services.AddCephalon(config, engine => engine .AddBehaviors(behaviors => behaviors .AddMessagingBehaviorBindings( rabbitMq: opts => opts.HostName = "rabbitmq.internal", kafka: opts => opts.BootstrapServers = "kafka:9092" ) ));EventStore handoff
Section titled “EventStore handoff”When IEventStore is registered, the Kafka and RabbitMQ bindings now create a per-message or
per-delivery DI scope and flow the scoped store into IBehaviorContext.EventStore. That keeps
durable execution and other replay-aware behavior patterns transport-neutral: the messaging pack
does not own replay logic itself, but it does preserve the shared event-store truth when a
messaging-triggered behavior needs it.
Status
Section titled “Status”Status: ✅ Shipped — commit 9183407 · 527/527 tests
Related components
Section titled “Related components”Cephalon.Behaviors— dispatcher, catalog, resolver (M1)Cephalon.Behaviors.Http— HTTP transport bindings (M2)Cephalon.Behaviors.Patterns— pattern execution strategies (M4, shipped)