Interface IKafkaCloudEventAdapter
Kafka adapter for CloudEvents supporting both structured and binary modes.
public interface IKafkaCloudEventAdapter : ICloudEventEncoder<Message<string, string>>
- Inherited Members
- Extension Methods
Remarks
Implements CloudEvents specification for Apache Kafka with DoD-compliant envelope property preservation. Supports structured mode (JSON payload) and binary mode (message headers).
Methods
DetectModeAsync(ConsumeResult<string, string>, CancellationToken)
Determines whether the supplied consume result represents a valid CloudEvent transport message.
ValueTask<CloudEventMode?> DetectModeAsync(ConsumeResult<string, string> consumeResult, CancellationToken cancellationToken)
Parameters
consumeResultConsumeResult<string, string>The Kafka consume result to inspect.
cancellationTokenCancellationTokenCancellation token.
Returns
- ValueTask<CloudEventMode?>
The detected CloudEvent mode, or
nullwhen not applicable.
FromKafkaAsync(ConsumeResult<string, string>, CancellationToken)
Converts a Kafka ConsumeResult<TKey, TValue> into a CloudEvent using the configured mapper.
Task<CloudEvent> FromKafkaAsync(ConsumeResult<string, string> consumeResult, CancellationToken cancellationToken)
Parameters
consumeResultConsumeResult<string, string>The Kafka consume result containing the transport message.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<CloudEvent>
The reconstructed CloudEvent instance.