Class KafkaTransportBinding
เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน
Namespace: Cephalon.Behaviors.Messaging.Bindings
Assembly: Cephalon.Behaviors.Messaging.dll
Kafka messaging transport binding (transport ID: “kafka”).
Consumes messages from a Kafka topic and dispatches them through the ABT behavior dispatcher.
Manually commits offsets after successful dispatch. Supports partition assignment/revocation logging.
public sealed class KafkaTransportBinding : IMessagingBehaviorBinding, IAsyncDisposableInheritance
Section titled “Inheritance”object ← KafkaTransportBinding
Implements
Section titled “Implements”IMessagingBehaviorBinding, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
Section titled “Constructors”KafkaTransportBinding(KafkaTransportOptions, ILogger<KafkaTransportBinding>, IServiceScopeFactory?)
Section titled “ KafkaTransportBinding(KafkaTransportOptions, ILogger<KafkaTransportBinding>, IServiceScopeFactory?)”Initializes a new instance of
public KafkaTransportBinding(KafkaTransportOptions options, ILogger<KafkaTransportBinding> logger, IServiceScopeFactory? scopeFactory = null)Parameters
Section titled “Parameters”options KafkaTransportOptions
The Kafka transport options.
logger ILogger<KafkaTransportBinding>
The logger for this binding.
scopeFactory IServiceScopeFactory?
Optional scope factory used to resolve scoped services such as
Properties
Section titled “Properties”TransportId
Section titled “ TransportId”Gets the canonical transport identifier (e.g. “rabbitmq”, “kafka”, “in-memory”).
public string TransportId { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”DisposeAsync()
Section titled “ DisposeAsync()”Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()Returns
Section titled “Returns”A task that represents the asynchronous dispose operation.
StartAsync(BehaviorTopologyDescriptor, BehaviorDispatcher, CancellationToken)
Section titled “ StartAsync(BehaviorTopologyDescriptor, BehaviorDispatcher, CancellationToken)”Starts consuming messages for the given behavior topology and dispatches them. Called once per descriptor per transport; implementations should be idempotent.
public Task StartAsync(BehaviorTopologyDescriptor descriptor, BehaviorDispatcher dispatcher, CancellationToken ct)Parameters
Section titled “Parameters”descriptor BehaviorTopologyDescriptor
The behavior topology descriptor.
dispatcher BehaviorDispatcher
The behavior dispatcher to invoke for each received message.
A token that signals when the host is shutting down.
Returns
Section titled “Returns”A task that completes when the binding is fully started.
StopAsync(CancellationToken)
Section titled “ StopAsync(CancellationToken)”Stops the binding and releases transport resources.
public Task StopAsync(CancellationToken ct)Parameters
Section titled “Parameters”A token that cancels the graceful-stop wait.
Returns
Section titled “Returns”A task that completes when the binding has fully stopped.