< Summary - CoreWCF Coverage — PR #1766

Line coverage
26%
Covered lines: 67
Uncovered lines: 187
Coverable lines: 254
Total lines: 1061
Line coverage: 26.3%
Branch coverage
36%
Covered branches: 16
Total branches: 44
Branch coverage: 36.3%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
File 2: .ctor()100%11100%
File 2: .ctor(...)100%11100%
File 2: Clone()100%11100%
File 2: GetProperty(...)75%4480%
File 2: BuildQueueTransportPump(...)100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka/src/CoreWCF/Channels/KafkaTransportBindingElement.Config.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using Confluent.Kafka;
 6
 7namespace CoreWCF.Channels;
 8
 9public partial class KafkaTransportBindingElement
 10{
 11    /// <summary>
 12    /// <inheritdoc cref="ConsumerConfig.EnableAutoOffsetStore"/>
 13    /// </summary>
 14    public bool? EnableAutoOffsetStore
 15    {
 016        get => Config.EnableAutoOffsetStore;
 017        set => Config.EnableAutoOffsetStore = value;
 18    }
 19
 20    /// <summary>
 21    /// <inheritdoc cref="ConsumerConfig.EnableAutoCommit"/>
 22    /// </summary>
 23    public bool? EnableAutoCommit
 24    {
 025        get => Config.EnableAutoCommit;
 326        set =>Config.EnableAutoCommit = value;
 27    }
 28
 29    /// <summary>
 30    /// <inheritdoc cref="ConsumerConfig.AutoOffsetReset"/>
 31    /// </summary>
 32    /// <exception cref="ArgumentOutOfRangeException"></exception>
 33    public AutoOffsetReset? AutoOffsetReset
 34    {
 035        get => Config.AutoOffsetReset;
 36        set
 37        {
 4338            if (value.HasValue && !AutoOffsetResetHelper.IsDefined(value.Value))
 39            {
 040                throw new ArgumentOutOfRangeException(nameof(value));
 41            }
 42
 4343            Config.AutoOffsetReset = value;
 4344        }
 45    }
 46
 47    /// <summary>
 48    /// <inheritdoc cref="ConsumerConfig.IsolationLevel"/>
 49    /// </summary>
 50    /// <exception cref="ArgumentOutOfRangeException"></exception>
 51    public IsolationLevel? IsolationLevel
 52    {
 053        get => Config.IsolationLevel;
 54        set
 55        {
 056            if (value.HasValue && !IsolationLevelHelper.IsDefined(value.Value))
 57            {
 058                throw new ArgumentOutOfRangeException(nameof(value));
 59            }
 60
 061            Config.IsolationLevel = value;
 062        }
 63    }
 64
 65    /// <summary>
 66    /// <inheritdoc cref="ClientConfig.MessageMaxBytes"/>
 67    /// </summary>
 68    public int? MessageMaxBytes
 69    {
 070        get => Config.MessageMaxBytes;
 071        set => Config.MessageMaxBytes = value;
 72    }
 73
 74    /// <summary>
 75    /// <inheritdoc cref="ClientConfig.ReceiveMessageMaxBytes"/>
 76    /// </summary>
 77    public int? ReceiveMessageMaxBytes
 78    {
 079        get => Config.ReceiveMessageMaxBytes;
 080        set => Config.ReceiveMessageMaxBytes = value;
 81    }
 82
 83    /// <summary>
 84    /// <inheritdoc cref="ClientConfig.SocketConnectionSetupTimeoutMs"/>
 85    /// </summary>
 86    public int? SocketConnectionSetupTimeoutMs
 87    {
 088        get => Config.SocketConnectionSetupTimeoutMs;
 089        set => Config.SocketConnectionSetupTimeoutMs = value;
 90    }
 91
 92    /// <summary>
 93    /// <inheritdoc cref="ClientConfig.ConnectionsMaxIdleMs"/>
 94    /// </summary>
 95    public int? ConnectionsMaxIdleMs
 96    {
 097        get => Config.ConnectionsMaxIdleMs;
 098        set => Config.ConnectionsMaxIdleMs = value;
 99    }
 100
 101    /// <summary>
 102    /// <inheritdoc cref="ClientConfig.ReconnectBackoffMs"/>
 103    /// </summary>
 104    public int? ReconnectBackoffMs
 105    {
 0106        get => Config.ReconnectBackoffMs;
 0107        set => Config.ReconnectBackoffMs = value;
 108    }
 109
 110    /// <summary>
 111    /// <inheritdoc cref="ClientConfig.ReconnectBackoffMaxMs"/>
 112    /// </summary>
 113    public int? ReconnectBackoffMaxMs
 114    {
 0115        get => Config.ReconnectBackoffMaxMs;
 0116        set => Config.ReconnectBackoffMaxMs = value;
 117    }
 118
 119    /// <summary>
 120    /// <inheritdoc cref="ClientConfig.StatisticsIntervalMs"/>
 121    /// </summary>
 122    public int? StatisticsIntervalMs
 123    {
 0124        get => Config.StatisticsIntervalMs;
 0125        set => Config.StatisticsIntervalMs = value;
 126    }
 127
 128    /// <summary>
 129    /// <inheritdoc cref="ClientConfig.ApiVersionRequest"/>
 130    /// </summary>
 131    public bool? ApiVersionRequest
 132    {
 0133        get => Config.ApiVersionRequest;
 0134        set => Config.ApiVersionRequest = value;
 135    }
 136
 137    /// <summary>
 138    /// <inheritdoc cref="ClientConfig.ApiVersionFallbackMs"/>
 139    /// </summary>
 140    public int? ApiVersionFallbackMs
 141    {
 0142        get => Config.ApiVersionFallbackMs;
 0143        set => Config.ApiVersionFallbackMs = value;
 144    }
 145
 146    /// <summary>
 147    /// <inheritdoc cref="ClientConfig.BrokerVersionFallback"/>
 148    /// </summary>
 149    public string BrokerVersionFallback
 150    {
 0151        get => Config.BrokerVersionFallback;
 0152        set => Config.BrokerVersionFallback = value;
 153    }
 154
 155    /// <summary>
 156    /// <inheritdoc cref="ConsumerConfig.GroupId"/>
 157    /// </summary>
 158    public string GroupId
 159    {
 0160        get => Config.GroupId;
 43161        set => Config.GroupId = value;
 162    }
 163
 164    /// <summary>
 165    /// <inheritdoc cref="ConsumerConfig.GroupInstanceId"/>
 166    /// </summary>
 167    public string GroupInstanceId
 168    {
 0169        get => Config.GroupInstanceId ;
 0170        set => Config.GroupInstanceId = value;
 171    }
 172
 173    /// <summary>
 174    /// <inheritdoc cref="ConsumerConfig.PartitionAssignmentStrategy"/>
 175    /// </summary>
 176    /// <exception cref="ArgumentOutOfRangeException"></exception>
 177    public PartitionAssignmentStrategy? PartitionAssignmentStrategy
 178    {
 0179        get => Config.PartitionAssignmentStrategy;
 180        set
 181        {
 0182            if (value.HasValue && !PartitionAssignmentStrategyHelper.IsDefined(value.Value))
 183            {
 0184                throw new ArgumentOutOfRangeException(nameof(value));
 185            }
 186
 0187            Config.PartitionAssignmentStrategy = value;
 0188        }
 189    }
 190
 191    /// <summary>
 192    /// <inheritdoc cref="ConsumerConfig.SessionTimeoutMs"/>
 193    /// </summary>
 194    public int? SessionTimeoutMs
 195    {
 0196        get => Config.SessionTimeoutMs;
 2197        set => Config.SessionTimeoutMs = value;
 198    }
 199
 200    /// <summary>
 201    /// <inheritdoc cref="ConsumerConfig.MaxPollIntervalMs"/>
 202    /// </summary>
 203    public int? MaxPollIntervalMs
 204    {
 0205        get => Config.MaxPollIntervalMs;
 0206        set => Config.MaxPollIntervalMs = value;
 207    }
 208
 209    /// <summary>
 210    /// <inheritdoc cref="ConsumerConfig.AutoCommitIntervalMs"/>
 211    /// </summary>
 212    public int? AutoCommitIntervalMs
 213    {
 0214        get => Config.AutoCommitIntervalMs;
 0215        set => Config.AutoCommitIntervalMs = value;
 216    }
 217
 218    /// <summary>
 219    /// <inheritdoc cref="ConsumerConfig.QueuedMinMessages"/>
 220    /// </summary>
 221    public int? QueuedMinMessages
 222    {
 0223        get => Config.QueuedMinMessages;
 0224        set => Config.QueuedMinMessages = value;
 225    }
 226
 227    /// <summary>
 228    /// <inheritdoc cref="ConsumerConfig.QueuedMaxMessagesKbytes"/>
 229    /// </summary>
 230    public int? QueuedMaxMessagesKbytes
 231    {
 0232        get => Config.QueuedMaxMessagesKbytes;
 0233        set => Config.QueuedMaxMessagesKbytes = value;
 234    }
 235
 236    /// <summary>
 237    /// <inheritdoc cref="ConsumerConfig.MaxPartitionFetchBytes"/>
 238    /// </summary>
 239    public int? MaxPartitionFetchBytes
 240    {
 0241        get => Config.MaxPartitionFetchBytes;
 0242        set => Config.MaxPartitionFetchBytes = value;
 243    }
 244
 245    /// <summary>
 246    /// <inheritdoc cref="ConsumerConfig.FetchMaxBytes"/>
 247    /// </summary>
 248    public int? FetchMaxBytes
 249    {
 0250        get => Config.FetchMaxBytes;
 0251        set => Config.FetchMaxBytes = value;
 252    }
 253
 254    /// <summary>
 255    /// <inheritdoc cref="ConsumerConfig.FetchErrorBackoffMs"/>
 256    /// </summary>
 257    public int? FetchErrorBackoffMs
 258    {
 0259        get => Config.FetchErrorBackoffMs;
 0260        set => Config.FetchErrorBackoffMs = value;
 261    }
 262
 263    /// <summary>
 264    /// <inheritdoc cref="ConsumerConfig.CheckCrcs"/>
 265    /// </summary>
 266    public bool? CheckCrcs
 267    {
 0268        get => Config.CheckCrcs;
 0269        set => Config.CheckCrcs = value;
 270    }
 271
 272    /// <summary>
 273    /// <inheritdoc cref="ClientConfig.Debug"/>
 274    /// </summary>
 275    public string Debug
 276    {
 0277        get => Config.Debug;
 5278        set => Config.Debug = value;
 279    }
 280
 281    /// <summary>
 282    /// <inheritdoc cref="ClientConfig.ClientId"/>
 283    /// </summary>
 284    public string ClientId
 285    {
 0286        get => Config.ClientId;
 0287        set => Config.ClientId = value;
 288    }
 289
 290    /// <summary>
 291    /// <inheritdoc cref="ClientConfig.MessageCopyMaxBytes"/>
 292    /// </summary>
 293    public int? MessageCopyMaxBytes
 294    {
 0295        get => Config.MessageMaxBytes;
 0296        set => Config.MessageMaxBytes = value;
 297    }
 298
 299    /// <summary>
 300    /// <inheritdoc cref="ClientConfig.MaxInFlight"/>
 301    /// </summary>
 302    public int? MaxInFlight
 303    {
 0304        get => Config.MaxInFlight;
 0305        set => Config.MaxInFlight= value;
 306    }
 307
 308    /// <summary>
 309    /// <inheritdoc cref="ClientConfig.TopicMetadataRefreshIntervalMs"/>
 310    /// </summary>
 311    public int? TopicMetadataRefreshIntervalMs
 312    {
 0313        get => Config.TopicMetadataRefreshIntervalMs;
 0314        set => Config.TopicMetadataRefreshIntervalMs = value;
 315    }
 316
 317    /// <summary>
 318    /// <inheritdoc cref="ClientConfig.MetadataMaxAgeMs"/>
 319    /// </summary>
 320    public int? MetadataMaxAgeMs
 321    {
 0322        get => Config.MetadataMaxAgeMs;
 0323        set => Config.MetadataMaxAgeMs = value;
 324    }
 325
 326    /// <summary>
 327    /// <inheritdoc cref="ClientConfig.TopicMetadataRefreshFastIntervalMs"/>
 328    /// </summary>
 329    public int? TopicMetadataRefreshFastIntervalMs
 330    {
 0331        get => Config.TopicMetadataRefreshFastIntervalMs;
 0332        set => Config.TopicMetadataRefreshFastIntervalMs = value;
 333    }
 334
 335    /// <summary>
 336    /// <inheritdoc cref="ClientConfig.TopicMetadataRefreshSparse"/>
 337    /// </summary>
 338    public bool? TopicMetadataRefreshSparse
 339    {
 0340        get => Config.TopicMetadataRefreshSparse;
 0341        set => Config.TopicMetadataRefreshSparse = value;
 342    }
 343
 344    /// <summary>
 345    /// <inheritdoc cref="ClientConfig.TopicMetadataPropagationMaxMs"/>
 346    /// </summary>
 347    public int? TopicMetadataPropagationMaxMs
 348    {
 0349        get => Config.TopicMetadataPropagationMaxMs;
 0350        set => Config.TopicMetadataPropagationMaxMs = value;
 351    }
 352
 353    /// <summary>
 354    /// <inheritdoc cref="ClientConfig.TopicBlacklist"/>
 355    /// </summary>
 356    public string TopicBlacklist
 357    {
 0358        get => Config.TopicBlacklist;
 0359        set => Config.TopicBlacklist = value;
 360    }
 361
 362    /// <summary>
 363    /// <inheritdoc cref="ClientConfig.SocketTimeoutMs"/>
 364    /// </summary>
 365    public int? SocketTimeoutMs
 366    {
 0367        get => Config.SocketTimeoutMs;
 0368        set => Config.SocketTimeoutMs = value;
 369    }
 370
 371    /// <summary>
 372    /// <inheritdoc cref="ClientConfig.SocketSendBufferBytes"/>
 373    /// </summary>
 374    public int? SocketSendBufferBytes
 375    {
 0376        get => Config.SocketSendBufferBytes;
 0377        set => Config.SocketSendBufferBytes = value;
 378    }
 379
 380    /// <summary>
 381    /// <inheritdoc cref="ClientConfig.SocketReceiveBufferBytes"/>
 382    /// </summary>
 383    public int? SocketReceiveBufferBytes
 384    {
 0385        get => Config.SocketReceiveBufferBytes;
 0386        set => Config.SocketReceiveBufferBytes = value;
 387    }
 388
 389    /// <summary>
 390    /// <inheritdoc cref="ClientConfig.SocketKeepaliveEnable"/>
 391    /// </summary>
 392    public bool? SocketKeepaliveEnable
 393    {
 0394        get => Config.SocketKeepaliveEnable;
 0395        set => Config.SocketKeepaliveEnable = value;
 396    }
 397
 398    /// <summary>
 399    /// <inheritdoc cref="ClientConfig.SocketNagleDisable"/>
 400    /// </summary>
 401    public bool? SocketNagleDisable
 402    {
 0403        get => Config.SocketNagleDisable;
 0404        set => Config.SocketNagleDisable = value;
 405    }
 406
 407    /// <summary>
 408    /// <inheritdoc cref="ClientConfig.SocketMaxFails"/>
 409    /// </summary>
 410    public int? SocketMaxFails
 411    {
 0412        get => Config.SocketMaxFails;
 0413        set => Config.SocketMaxFails = value;
 414    }
 415
 416    /// <summary>
 417    /// <inheritdoc cref="ClientConfig.BrokerAddressTtl"/>
 418    /// </summary>
 419    public int? BrokerAddressTtl
 420    {
 0421        get => Config.BrokerAddressTtl;
 0422        set => Config.BrokerAddressTtl = value;
 423    }
 424
 425    /// <summary>
 426    /// <inheritdoc cref="ClientConfig.BrokerAddressFamily"/>
 427    /// </summary>
 428    /// <exception cref="ArgumentOutOfRangeException"></exception>
 429    public BrokerAddressFamily? BrokerAddressFamily
 430    {
 0431        get => Config.BrokerAddressFamily;
 432        set
 433        {
 0434            if (value.HasValue && !BrokerAddressFamilyHelper.IsDefined(value.Value))
 435            {
 0436                throw new ArgumentOutOfRangeException(nameof(value));
 437            }
 438
 0439            Config.BrokerAddressFamily = value;
 0440        }
 441    }
 442
 443    /// <summary>
 444    /// <inheritdoc cref="ClientConfig.LogQueue"/>
 445    /// </summary>
 446    public bool? LogQueue
 447    {
 0448        get => Config.LogQueue;
 0449        set => Config.LogQueue = value;
 450    }
 451
 452    /// <summary>
 453    /// <inheritdoc cref="ClientConfig.LogThreadName"/>
 454    /// </summary>
 455    public bool? LogThreadName
 456    {
 0457        get => Config.LogThreadName;
 0458        set => Config.LogThreadName = value;
 459    }
 460
 461    /// <summary>
 462    /// <inheritdoc cref="ClientConfig.EnableRandomSeed"/>
 463    /// </summary>
 464    public bool? EnableRandomSeed
 465    {
 0466        get => Config.EnableRandomSeed;
 0467        set => Config.EnableRandomSeed = value;
 468    }
 469
 470    /// <summary>
 471    /// <inheritdoc cref="ClientConfig.LogConnectionClose"/>
 472    /// </summary>
 473    public bool? LogConnectionClose
 474    {
 0475        get => Config.LogConnectionClose;
 0476        set => Config.LogConnectionClose = value;
 477    }
 478
 479    /// <summary>
 480    /// <inheritdoc cref="ClientConfig.InternalTerminationSignal"/>
 481    /// </summary>
 482    public int? InternalTerminationSignal
 483    {
 0484        get => Config.InternalTerminationSignal;
 0485        set => Config.InternalTerminationSignal = value;
 486    }
 487
 488    /// <summary>
 489    /// <inheritdoc cref="ClientConfig.ApiVersionRequestTimeoutMs"/>
 490    /// </summary>
 491    public int? ApiVersionRequestTimeoutMs
 492    {
 0493        get => Config.ApiVersionRequestTimeoutMs;
 0494        set => Config.ApiVersionRequestTimeoutMs = value;
 495    }
 496
 497    /// <summary>
 498    /// <inheritdoc cref="ClientConfig.PluginLibraryPaths"/>
 499    /// </summary>
 500    public string PluginLibraryPaths
 501    {
 0502        get => Config.PluginLibraryPaths;
 0503        set => Config.PluginLibraryPaths = value;
 504    }
 505
 506    /// <summary>
 507    /// <inheritdoc cref="ClientConfig.ClientRack"/>
 508    /// </summary>
 509    public string ClientRack
 510    {
 0511        get => Config.ClientRack;
 0512        set => Config.ClientRack = value;
 513    }
 514
 515    /// <summary>
 516    /// <inheritdoc cref="ConsumerConfig.HeartbeatIntervalMs"/>
 517    /// </summary>
 518    public int? HeartbeatIntervalMs
 519    {
 0520        get => Config.HeartbeatIntervalMs;
 0521        set => Config.HeartbeatIntervalMs = value;
 522    }
 523
 524    /// <summary>
 525    /// <inheritdoc cref="ConsumerConfig.GroupProtocolType"/>
 526    /// </summary>
 527    public string GroupProtocolType
 528    {
 0529        get => Config.GroupProtocolType;
 0530        set => Config.GroupProtocolType = value;
 531    }
 532
 533    /// <summary>
 534    /// <inheritdoc cref="ConsumerConfig.CoordinatorQueryIntervalMs"/>
 535    /// </summary>
 536    public int? CoordinatorQueryIntervalMs
 537    {
 0538        get => Config.CoordinatorQueryIntervalMs;
 0539        set => Config.CoordinatorQueryIntervalMs = value;
 540    }
 541
 542    /// <summary>
 543    /// <inheritdoc cref="ConsumerConfig.FetchWaitMaxMs"/>
 544    /// </summary>
 545    public int? FetchWaitMaxMs
 546    {
 0547        get => Config.FetchWaitMaxMs;
 0548        set => Config.FetchWaitMaxMs = value;
 549    }
 550
 551    /// <summary>
 552    /// <inheritdoc cref="ConsumerConfig.FetchMinBytes"/>
 553    /// </summary>
 554    public int? FetchMinBytes
 555    {
 0556        get => Config.FetchMinBytes;
 0557        set => Config.FetchMinBytes = value;
 558    }
 559
 560    /// <summary>
 561    /// <inheritdoc cref="ConsumerConfig.EnablePartitionEof"/>
 562    /// </summary>
 563    public bool? EnablePartitionEof
 564    {
 0565        get => Config.EnablePartitionEof;
 0566        set => Config.EnablePartitionEof = value;
 567    }
 568}

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka/src/CoreWCF/Channels/KafkaTransportBindingElement.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using Confluent.Kafka;
 6using CoreWCF.Configuration;
 7using CoreWCF.Queue.Common;
 8using CoreWCF.Queue.Common.Configuration;
 9using Microsoft.Extensions.DependencyInjection;
 10using Microsoft.Extensions.Logging;
 11
 12namespace CoreWCF.Channels
 13{
 14    public partial class KafkaTransportBindingElement : QueueBaseTransportBindingElement
 15    {
 57316        private KafkaMessageEncoding _messageEncoding = KafkaMessageEncoding.Text;
 17        private KafkaDeliverySemantics _deliverySemantics;
 18        private KafkaErrorHandlingStrategy _errorHandlingStrategy = KafkaErrorHandlingStrategy.Ignore;
 19        private string _deadLetterQueueTopic;
 250820        internal ConsumerConfig Config { get; } = new();
 21
 22        public KafkaDeliverySemantics DeliverySemantics
 23        {
 75624            get => _deliverySemantics;
 25            set
 26            {
 4427                if (!KafkaDeliverySemanticsHelper.IsDefined(value))
 28                {
 029                    throw new ArgumentOutOfRangeException(nameof(value));
 30                }
 31
 4432                _deliverySemantics = value;
 4433            }
 34        }
 35
 36        public KafkaMessageEncoding MessageEncoding
 37        {
 88238            get => _messageEncoding;
 39            set
 40            {
 241                if (!KafkaMessageEncodingHelper.IsDefined(value))
 42                {
 043                    throw new ArgumentOutOfRangeException(nameof(value));
 44                }
 45
 246                _messageEncoding = value;
 247            }
 48        }
 49
 50        public KafkaErrorHandlingStrategy ErrorHandlingStrategy
 51        {
 18052            get => _errorHandlingStrategy;
 53            set
 54            {
 255                if (!KafkaErrorHandlingStrategyHelper.IsDefined(value))
 56                {
 057                    throw new ArgumentOutOfRangeException(nameof(value));
 58                }
 59
 260                _errorHandlingStrategy = value;
 261            }
 62        }
 63
 64        public string DeadLetterQueueTopic
 65        {
 666            get => _deadLetterQueueTopic;
 67            set
 68            {
 269                if (string.IsNullOrWhiteSpace(value))
 70                {
 071                    throw new ArgumentNullException(nameof(value));
 72                }
 73
 274                _deadLetterQueueTopic = value;
 275            }
 76        }
 77
 57378        public KafkaTransportBindingElement()
 79        {
 57380        }
 81
 82        private KafkaTransportBindingElement(KafkaTransportBindingElement other)
 52883            : this()
 84        {
 52885            _deliverySemantics = other._deliverySemantics;
 52886            _messageEncoding = other._messageEncoding;
 52887            _errorHandlingStrategy = other._errorHandlingStrategy;
 52888            _deadLetterQueueTopic = other._deadLetterQueueTopic;
 52889            Config = other.Config;
 52890        }
 91
 92        public override BindingElement Clone()
 93        {
 52894            return new KafkaTransportBindingElement(this);
 95        }
 96
 12997        public override string Scheme => "net.kafka";
 98
 99        public override T GetProperty<T>(BindingContext context)
 100        {
 129101            if (context == null)
 102            {
 0103                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(context));
 104            }
 105
 129106            if (typeof(T) == typeof(ISecurityCapabilities))
 107            {
 43108                return null;
 109            }
 110
 86111            return base.GetProperty<T>(context);
 112        }
 113
 114        public override QueueTransportPump BuildQueueTransportPump(BindingContext context)
 115        {
 43116            var serviceProvider = context.BindingParameters.Find<IServiceProvider>();
 43117            var serviceDispatcher = context.BindingParameters.Find<IServiceDispatcher>();
 43118            var logger = serviceProvider.GetRequiredService<ILogger<KafkaTransportPump>>();
 119
 43120            return new KafkaTransportPump(this, logger, serviceDispatcher, DeliverySemantics);
 121        }
 122    }
 123}

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Kafka/src/CoreWCF/Channels/KafkaTransportBindingElement.Security.Config.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using Confluent.Kafka;
 6
 7namespace CoreWCF.Channels;
 8
 9public partial class KafkaTransportBindingElement
 10{
 11    /// <summary>
 12    /// <inheritdoc cref="ClientConfig.SecurityProtocol"/>
 13    /// </summary>
 14    /// <exception cref="ArgumentOutOfRangeException"></exception>
 15    public SecurityProtocol? SecurityProtocol
 16    {
 88217        get => Config.SecurityProtocol;
 18        set
 19        {
 4420            if (value.HasValue && !SecurityProtocolHelper.IsDefined(value.Value))
 21            {
 022                throw new ArgumentOutOfRangeException(nameof(value));
 23            }
 24
 4425            Config.SecurityProtocol = value;
 4426        }
 27    }
 28
 29    /// <summary>
 30    /// <inheritdoc cref="ClientConfig.SslCaLocation"/>
 31    /// </summary>
 32    public string SslCaLocation
 33    {
 034        get => Config.SslCaLocation;
 135        set => Config.SslCaLocation = value;
 36    }
 37
 38    /// <summary>
 39    /// <inheritdoc cref="ClientConfig.SslCaPem"/>
 40    /// </summary>
 41    public string SslCaPem
 42    {
 7843        get => Config.SslCaPem;
 644        set => Config.SslCaPem = value;
 45    }
 46
 47    /// <summary>
 48    /// <inheritdoc cref="ClientConfig.SaslUsername"/>
 49    /// </summary>
 50    public string SaslUsername
 51    {
 5252        get => Config.SaslUsername;
 453        set => Config.SaslUsername = value;
 54    }
 55
 56    /// <summary>
 57    /// <inheritdoc cref="ClientConfig.SaslPassword"/>
 58    /// </summary>
 59    public string SaslPassword
 60    {
 5261        get => Config.SaslPassword;
 462        set => Config.SaslPassword = value;
 63    }
 64
 65    /// <summary>
 66    /// <inheritdoc cref="ClientConfig.SslCertificateLocation"/>
 67    /// </summary>
 68    public string SslCertificateLocation
 69    {
 070        get => Config.SslCertificateLocation;
 171        set => Config.SslCertificateLocation = value;
 72    }
 73
 74    /// <summary>
 75    /// <inheritdoc cref="ClientConfig.SslCertificatePem"/>
 76    /// </summary>
 77    public string SslCertificatePem
 78    {
 2679        get => Config.SslCertificatePem;
 280        set => Config.SslCertificatePem = value;
 81    }
 82
 83    /// <summary>
 84    /// <inheritdoc cref="ClientConfig.SslKeystoreLocation"/>
 85    /// </summary>
 86    public string SslKeystoreLocation
 87    {
 088        get => Config.SslKeystoreLocation;
 089        set => Config.SslKeystoreLocation = value;
 90    }
 91
 92    /// <summary>
 93    /// <inheritdoc cref="ClientConfig.SslKeystorePassword"/>
 94    /// </summary>
 95    public string SslKeystorePassword
 96    {
 097        get => Config.SslKeystorePassword;
 098        set => Config.SslKeystorePassword = value;
 99    }
 100
 101    /// <summary>
 102    /// <inheritdoc cref="ClientConfig.SslKeyPassword"/>
 103    /// </summary>
 104    public string SslKeyPassword
 105    {
 26106        get => Config.SslKeyPassword;
 3107        set => Config.SslKeyPassword = value;
 108    }
 109
 110    /// <summary>
 111    /// <inheritdoc cref="ClientConfig.SslKeyPem"/>
 112    /// </summary>
 113    public string SslKeyPem
 114    {
 26115        get => Config.SslKeyPem;
 2116        set => Config.SslKeyPem = value;
 117    }
 118
 119    /// <summary>
 120    /// <inheritdoc cref="ClientConfig.SslKeyLocation"/>
 121    /// </summary>
 122    public string SslKeyLocation
 123    {
 0124        get => Config.SslKeyLocation;
 1125        set => Config.SslKeyLocation = value;
 126    }
 127
 128    /// <summary>
 129    /// <inheritdoc cref="ClientConfig.SaslMechanism"/>
 130    /// </summary>
 131    /// <exception cref="ArgumentOutOfRangeException"></exception>
 132    public SaslMechanism? SaslMechanism
 133    {
 52134        get => Config.SaslMechanism;
 135        set
 136        {
 4137            if (value.HasValue && !SaslMechanismHelper.IsDefined(value.Value))
 138            {
 0139                throw new ArgumentOutOfRangeException(nameof(value));
 140            }
 141
 4142            Config.SaslMechanism = value;
 4143        }
 144    }
 145
 146    /// <summary>
 147    /// <inheritdoc cref="ClientConfig.SslCipherSuites"/>
 148    /// </summary>
 149    public string SslCipherSuites
 150    {
 0151        get => Config.SslCipherSuites;
 0152        set => Config.SslCipherSuites = value;
 153    }
 154
 155    /// <summary>
 156    /// <inheritdoc cref="ClientConfig.SslCurvesList"/>
 157    /// </summary>
 158    public string SslCurvesList
 159    {
 0160        get => Config.SslCurvesList;
 0161        set => Config.SslCurvesList = value;
 162    }
 163
 164    /// <summary>
 165    /// <inheritdoc cref="ClientConfig.SslSigalgsList"/>
 166    /// </summary>
 167    public string SslSigalgsList
 168    {
 0169        get => Config.SslSigalgsList;
 0170        set => Config.SslSigalgsList = value;
 171    }
 172
 173    /// <summary>
 174    /// <inheritdoc cref="ClientConfig.SslCaCertificateStores"/>
 175    /// </summary>
 176    public string SslCaCertificateStores
 177    {
 0178        get => Config.SslCaCertificateStores;
 0179        set => Config.SslCaCertificateStores = value;
 180    }
 181
 182    /// <summary>
 183    /// <inheritdoc cref="ClientConfig.SslCrlLocation"/>
 184    /// </summary>
 185    public string SslCrlLocation
 186    {
 0187        get => Config.SslCrlLocation;
 0188        set => Config.SslCrlLocation = value;
 189    }
 190
 191    /// <summary>
 192    /// <inheritdoc cref="ClientConfig.SslProviders"/>
 193    /// </summary>
 194    public string SslProviders
 195    {
 0196        get => Config.SslProviders;
 0197        set => Config.SslProviders = value;
 198    }
 199
 200    /// <summary>
 201    /// <inheritdoc cref="ClientConfig.SslEngineLocation"/>
 202    /// </summary>
 203    public string SslEngineLocation
 204    {
 0205        get => Config.SslEngineLocation;
 0206        set => Config.SslEngineLocation = value;
 207    }
 208
 209    /// <summary>
 210    /// <inheritdoc cref="ClientConfig.SslEngineId"/>
 211    /// </summary>
 212    public string SslEngineId
 213    {
 0214        get => Config.SslEngineId;
 0215        set => Config.SslEngineId = value;
 216    }
 217
 218    /// <summary>
 219    /// <inheritdoc cref="ClientConfig.EnableSslCertificateVerification"/>
 220    /// </summary>
 221    public bool? EnableSslCertificateVerification
 222    {
 0223        get => Config.EnableSslCertificateVerification;
 0224        set => Config.EnableSslCertificateVerification = value;
 225    }
 226
 227    /// <summary>
 228    /// <inheritdoc cref="ClientConfig.SslEndpointIdentificationAlgorithm"/>
 229    /// </summary>
 230    /// <exception cref="ArgumentOutOfRangeException"></exception>
 231    public SslEndpointIdentificationAlgorithm? SslEndpointIdentificationAlgorithm
 232    {
 0233        get => Config.SslEndpointIdentificationAlgorithm;
 234        set
 235        {
 0236            if (value.HasValue && !SslEndpointIdentificationAlgorithmHelper.IsDefined(value.Value))
 237            {
 0238                throw new ArgumentOutOfRangeException(nameof(value));
 239            }
 240
 0241            Config.SslEndpointIdentificationAlgorithm = value;
 0242        }
 243    }
 244
 245    /// <summary>
 246    /// <inheritdoc cref="ClientConfig.SaslKerberosServiceName"/>
 247    /// </summary>
 248    public string SaslKerberosServiceName
 249    {
 0250        get => Config.SaslKerberosServiceName;
 0251        set => Config.SaslKerberosServiceName = value;
 252    }
 253
 254    /// <summary>
 255    /// <inheritdoc cref="ClientConfig.SaslKerberosPrincipal"/>
 256    /// </summary>
 257    public string SaslKerberosPrincipal
 258    {
 0259        get => Config.SaslKerberosPrincipal;
 0260        set => Config.SaslKerberosPrincipal = value;
 261    }
 262
 263    /// <summary>
 264    /// <inheritdoc cref="ClientConfig.SaslKerberosKinitCmd"/>
 265    /// </summary>
 266    public string SaslKerberosKinitCmd
 267    {
 0268        get => Config.SaslKerberosKinitCmd;
 0269        set => Config.SaslKerberosKinitCmd = value;
 270    }
 271
 272    /// <summary>
 273    /// <inheritdoc cref="ClientConfig.SaslKerberosKeytab"/>
 274    /// </summary>
 275    public string SaslKerberosKeytab
 276    {
 0277        get => Config.SaslKerberosKeytab;
 0278        set => Config.SaslKerberosKeytab = value;
 279    }
 280
 281    /// <summary>
 282    /// <inheritdoc cref="ClientConfig.SaslKerberosMinTimeBeforeRelogin"/>
 283    /// </summary>
 284    public int? SaslKerberosMinTimeBeforeRelogin
 285    {
 0286        get => Config.SaslKerberosMinTimeBeforeRelogin;
 0287        set => Config.SaslKerberosMinTimeBeforeRelogin = value;
 288    }
 289
 290    /// <summary>
 291    /// <inheritdoc cref="ClientConfig.SaslOauthbearerConfig"/>
 292    /// </summary>
 293    public string SaslOauthbearerConfig
 294    {
 0295        get => Config.SaslOauthbearerConfig;
 0296        set => Config.SaslOauthbearerConfig = value;
 297    }
 298
 299    /// <summary>
 300    /// <inheritdoc cref="ClientConfig.EnableSaslOauthbearerUnsecureJwt"/>
 301    /// </summary>
 302    public bool? EnableSaslOauthbearerUnsecureJwt
 303    {
 0304        get => Config.EnableSaslOauthbearerUnsecureJwt;
 0305        set => Config.EnableSaslOauthbearerUnsecureJwt = value;
 306    }
 307
 308    /// <summary>
 309    /// <inheritdoc cref="ClientConfig.SaslOauthbearerMethod"/>
 310    /// </summary>
 311    /// <exception cref="ArgumentOutOfRangeException"></exception>
 312    public SaslOauthbearerMethod? SaslOauthbearerMethod
 313    {
 0314        get => Config.SaslOauthbearerMethod;
 315        set
 316        {
 0317            if (value.HasValue && !SaslOauthbearerMethodHelper.IsDefined(value.Value))
 318            {
 0319                throw new ArgumentOutOfRangeException(nameof(value));
 320            }
 321
 0322            Config.SaslOauthbearerMethod = value;
 0323        }
 324    }
 325
 326    /// <summary>
 327    /// <inheritdoc cref="ClientConfig.SaslOauthbearerClientId"/>
 328    /// </summary>
 329    public string SaslOauthbearerClientId
 330    {
 0331        get => Config.SaslOauthbearerClientId;
 0332        set => Config.SaslOauthbearerClientId = value;
 333    }
 334
 335    /// <summary>
 336    /// <inheritdoc cref="ClientConfig.SaslOauthbearerClientSecret"/>
 337    /// </summary>
 338    public string SaslOauthbearerClientSecret
 339    {
 0340        get => Config.SaslOauthbearerClientSecret;
 0341        set => Config.SaslOauthbearerClientSecret = value;
 342    }
 343
 344    /// <summary>
 345    /// <inheritdoc cref="ClientConfig.SaslOauthbearerScope"/>
 346    /// </summary>
 347    public string SaslOauthbearerScope
 348    {
 0349        get => Config.SaslOauthbearerScope;
 0350        set => Config.SaslOauthbearerScope = value;
 351    }
 352
 353    /// <summary>
 354    /// <inheritdoc cref="ClientConfig.SaslOauthbearerExtensions"/>
 355    /// </summary>
 356    public string SaslOauthbearerExtensions
 357    {
 0358        get => Config.SaslOauthbearerExtensions;
 0359        set => Config.SaslOauthbearerExtensions = value;
 360    }
 361
 362    /// <summary>
 363    /// <inheritdoc cref="ClientConfig.SaslOauthbearerTokenEndpointUrl"/>
 364    /// </summary>
 365    public string SaslOauthbearerTokenEndpointUrl
 366    {
 0367        get => Config.SaslOauthbearerTokenEndpointUrl;
 0368        set => Config.SaslOauthbearerTokenEndpointUrl = value;
 369    }
 370}

Methods/Properties

EnableAutoOffsetStore()
EnableAutoOffsetStore(System.Nullable`1<System.Boolean>)
EnableAutoCommit()
EnableAutoCommit(System.Nullable`1<System.Boolean>)
AutoOffsetReset()
AutoOffsetReset(System.Nullable`1<Confluent.Kafka.AutoOffsetReset>)
IsolationLevel()
IsolationLevel(System.Nullable`1<Confluent.Kafka.IsolationLevel>)
MessageMaxBytes()
MessageMaxBytes(System.Nullable`1<System.Int32>)
ReceiveMessageMaxBytes()
ReceiveMessageMaxBytes(System.Nullable`1<System.Int32>)
SocketConnectionSetupTimeoutMs()
SocketConnectionSetupTimeoutMs(System.Nullable`1<System.Int32>)
ConnectionsMaxIdleMs()
ConnectionsMaxIdleMs(System.Nullable`1<System.Int32>)
ReconnectBackoffMs()
ReconnectBackoffMs(System.Nullable`1<System.Int32>)
ReconnectBackoffMaxMs()
ReconnectBackoffMaxMs(System.Nullable`1<System.Int32>)
StatisticsIntervalMs()
StatisticsIntervalMs(System.Nullable`1<System.Int32>)
ApiVersionRequest()
ApiVersionRequest(System.Nullable`1<System.Boolean>)
ApiVersionFallbackMs()
ApiVersionFallbackMs(System.Nullable`1<System.Int32>)
BrokerVersionFallback()
BrokerVersionFallback(System.String)
GroupId()
GroupId(System.String)
GroupInstanceId()
GroupInstanceId(System.String)
PartitionAssignmentStrategy()
PartitionAssignmentStrategy(System.Nullable`1<Confluent.Kafka.PartitionAssignmentStrategy>)
SessionTimeoutMs()
SessionTimeoutMs(System.Nullable`1<System.Int32>)
MaxPollIntervalMs()
MaxPollIntervalMs(System.Nullable`1<System.Int32>)
AutoCommitIntervalMs()
AutoCommitIntervalMs(System.Nullable`1<System.Int32>)
QueuedMinMessages()
QueuedMinMessages(System.Nullable`1<System.Int32>)
QueuedMaxMessagesKbytes()
QueuedMaxMessagesKbytes(System.Nullable`1<System.Int32>)
MaxPartitionFetchBytes()
MaxPartitionFetchBytes(System.Nullable`1<System.Int32>)
FetchMaxBytes()
FetchMaxBytes(System.Nullable`1<System.Int32>)
FetchErrorBackoffMs()
FetchErrorBackoffMs(System.Nullable`1<System.Int32>)
CheckCrcs()
CheckCrcs(System.Nullable`1<System.Boolean>)
Debug()
Debug(System.String)
ClientId()
ClientId(System.String)
MessageCopyMaxBytes()
MessageCopyMaxBytes(System.Nullable`1<System.Int32>)
MaxInFlight()
MaxInFlight(System.Nullable`1<System.Int32>)
TopicMetadataRefreshIntervalMs()
TopicMetadataRefreshIntervalMs(System.Nullable`1<System.Int32>)
MetadataMaxAgeMs()
MetadataMaxAgeMs(System.Nullable`1<System.Int32>)
TopicMetadataRefreshFastIntervalMs()
TopicMetadataRefreshFastIntervalMs(System.Nullable`1<System.Int32>)
TopicMetadataRefreshSparse()
TopicMetadataRefreshSparse(System.Nullable`1<System.Boolean>)
TopicMetadataPropagationMaxMs()
TopicMetadataPropagationMaxMs(System.Nullable`1<System.Int32>)
TopicBlacklist()
TopicBlacklist(System.String)
SocketTimeoutMs()
SocketTimeoutMs(System.Nullable`1<System.Int32>)
SocketSendBufferBytes()
SocketSendBufferBytes(System.Nullable`1<System.Int32>)
SocketReceiveBufferBytes()
SocketReceiveBufferBytes(System.Nullable`1<System.Int32>)
SocketKeepaliveEnable()
SocketKeepaliveEnable(System.Nullable`1<System.Boolean>)
SocketNagleDisable()
SocketNagleDisable(System.Nullable`1<System.Boolean>)
SocketMaxFails()
SocketMaxFails(System.Nullable`1<System.Int32>)
BrokerAddressTtl()
BrokerAddressTtl(System.Nullable`1<System.Int32>)
BrokerAddressFamily()
BrokerAddressFamily(System.Nullable`1<Confluent.Kafka.BrokerAddressFamily>)
LogQueue()
LogQueue(System.Nullable`1<System.Boolean>)
LogThreadName()
LogThreadName(System.Nullable`1<System.Boolean>)
EnableRandomSeed()
EnableRandomSeed(System.Nullable`1<System.Boolean>)
LogConnectionClose()
LogConnectionClose(System.Nullable`1<System.Boolean>)
InternalTerminationSignal()
InternalTerminationSignal(System.Nullable`1<System.Int32>)
ApiVersionRequestTimeoutMs()
ApiVersionRequestTimeoutMs(System.Nullable`1<System.Int32>)
PluginLibraryPaths()
PluginLibraryPaths(System.String)
ClientRack()
ClientRack(System.String)
HeartbeatIntervalMs()
HeartbeatIntervalMs(System.Nullable`1<System.Int32>)
GroupProtocolType()
GroupProtocolType(System.String)
CoordinatorQueryIntervalMs()
CoordinatorQueryIntervalMs(System.Nullable`1<System.Int32>)
FetchWaitMaxMs()
FetchWaitMaxMs(System.Nullable`1<System.Int32>)
FetchMinBytes()
FetchMinBytes(System.Nullable`1<System.Int32>)
EnablePartitionEof()
EnablePartitionEof(System.Nullable`1<System.Boolean>)
.ctor()
Config()
DeliverySemantics()
DeliverySemantics(CoreWCF.Channels.KafkaDeliverySemantics)
MessageEncoding()
MessageEncoding(CoreWCF.Channels.KafkaMessageEncoding)
ErrorHandlingStrategy()
ErrorHandlingStrategy(CoreWCF.Channels.KafkaErrorHandlingStrategy)
DeadLetterQueueTopic()
DeadLetterQueueTopic(System.String)
.ctor(CoreWCF.Channels.KafkaTransportBindingElement)
Clone()
Scheme()
GetProperty(CoreWCF.Channels.BindingContext)
BuildQueueTransportPump(CoreWCF.Channels.BindingContext)
SecurityProtocol()
SecurityProtocol(System.Nullable`1<Confluent.Kafka.SecurityProtocol>)
SslCaLocation()
SslCaLocation(System.String)
SslCaPem()
SslCaPem(System.String)
SaslUsername()
SaslUsername(System.String)
SaslPassword()
SaslPassword(System.String)
SslCertificateLocation()
SslCertificateLocation(System.String)
SslCertificatePem()
SslCertificatePem(System.String)
SslKeystoreLocation()
SslKeystoreLocation(System.String)
SslKeystorePassword()
SslKeystorePassword(System.String)
SslKeyPassword()
SslKeyPassword(System.String)
SslKeyPem()
SslKeyPem(System.String)
SslKeyLocation()
SslKeyLocation(System.String)
SaslMechanism()
SaslMechanism(System.Nullable`1<Confluent.Kafka.SaslMechanism>)
SslCipherSuites()
SslCipherSuites(System.String)
SslCurvesList()
SslCurvesList(System.String)
SslSigalgsList()
SslSigalgsList(System.String)
SslCaCertificateStores()
SslCaCertificateStores(System.String)
SslCrlLocation()
SslCrlLocation(System.String)
SslProviders()
SslProviders(System.String)
SslEngineLocation()
SslEngineLocation(System.String)
SslEngineId()
SslEngineId(System.String)
EnableSslCertificateVerification()
EnableSslCertificateVerification(System.Nullable`1<System.Boolean>)
SslEndpointIdentificationAlgorithm()
SslEndpointIdentificationAlgorithm(System.Nullable`1<Confluent.Kafka.SslEndpointIdentificationAlgorithm>)
SaslKerberosServiceName()
SaslKerberosServiceName(System.String)
SaslKerberosPrincipal()
SaslKerberosPrincipal(System.String)
SaslKerberosKinitCmd()
SaslKerberosKinitCmd(System.String)
SaslKerberosKeytab()
SaslKerberosKeytab(System.String)
SaslKerberosMinTimeBeforeRelogin()
SaslKerberosMinTimeBeforeRelogin(System.Nullable`1<System.Int32>)
SaslOauthbearerConfig()
SaslOauthbearerConfig(System.String)
EnableSaslOauthbearerUnsecureJwt()
EnableSaslOauthbearerUnsecureJwt(System.Nullable`1<System.Boolean>)
SaslOauthbearerMethod()
SaslOauthbearerMethod(System.Nullable`1<Confluent.Kafka.SaslOauthbearerMethod>)
SaslOauthbearerClientId()
SaslOauthbearerClientId(System.String)
SaslOauthbearerClientSecret()
SaslOauthbearerClientSecret(System.String)
SaslOauthbearerScope()
SaslOauthbearerScope(System.String)
SaslOauthbearerExtensions()
SaslOauthbearerExtensions(System.String)
SaslOauthbearerTokenEndpointUrl()
SaslOauthbearerTokenEndpointUrl(System.String)