/// <summary> /// Enable exactly-once or at_least_once semantics. /// </summary> /// <param name="processingGuarantee">Type of processing guarantee.</param> public void SetProcessingGuarantee(ProcessingGuarantee processingGuarantee) { string guarantee = processingGuarantee.ToKSqlValue(); QueryStreamParameters[KSqlDbConfigs.ProcessingGuarantee] = guarantee; QueryParameters[KSqlDbConfigs.ProcessingGuarantee] = guarantee; }
public static string ToKSqlValue(this ProcessingGuarantee processingGuarantee) { string guarantee = processingGuarantee switch { ProcessingGuarantee.AtLeastOnce => AtLeastOnce, ProcessingGuarantee.ExactlyOnce => ExactlyOnce, _ => throw new ArgumentOutOfRangeException(nameof(processingGuarantee), processingGuarantee, null) }; return(guarantee); } }