{"record":{"id":"14dc04ca6e3446eb","repo":"dotnetcore/CAP","slug":"value-cannot-be-null-parameter-configure-14dc04","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'configure')","messagePattern":"Value cannot be null\\. \\(Parameter 'configure'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/DotNetCore.CAP.Kafka/CAP.Options.Extensions.cs","lineNumber":30,"sourceCode":"    /// <summary>\n    /// Configuration to use kafka in CAP.\n    /// </summary>\n    /// <param name=\"options\">CAP configuration options</param>\n    /// <param name=\"bootstrapServers\">Kafka bootstrap server urls.</param>\n    public static CapOptions UseKafka(this CapOptions options, string bootstrapServers)\n    {\n        return options.UseKafka(opt => { opt.Servers = bootstrapServers; });\n    }\n\n    /// <summary>\n    /// Configuration to use kafka in CAP.\n    /// </summary>\n    /// <param name=\"options\">CAP configuration options</param>\n    /// <param name=\"configure\">Provides programmatic configuration for the kafka .</param>\n    /// <returns></returns>\n    public static CapOptions UseKafka(this CapOptions options, Action<KafkaOptions> configure)\n    {\n        if (configure == null) throw new ArgumentNullException(nameof(configure));\n\n        options.RegisterExtension(new KafkaCapOptionsExtension(configure));\n\n        return options;\n    }\n}","sourceCodeStart":12,"sourceCodeEnd":36,"githubUrl":"https://github.com/dotnetcore/CAP/blob/e52b8508e54cdb7a9ce7f9fec03d9ea8ad2710fb/src/DotNetCore.CAP.Kafka/CAP.Options.Extensions.cs#L12-L36","documentation":"ArgumentNullException on the 'configure' parameter: the UseKafka(CapOptions, Action<KafkaOptions>) overload was called with a null configuration delegate. This is a generic null-guard sentinel; the faulting input is the configure lambda the caller passed (or failed to pass).","triggerScenarios":"Thrown at src/DotNetCore.CAP.Kafka/CAP.Options.Extensions.cs:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-null lambda: services.AddCap(options => options.UseKafka(opt => opt.Servers = \"host:9092\"))","Use the string overload UseKafka(options, bootstrapServers) which builds the delegate for you","Do not resolve/invoke UseKafka with a variable that may be null; default to opt => { }"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e52b8508e54cdb7a9ce7f9fec03d9ea8ad2710fb","analyzedAt":"2026-09-14T14:46:34.677Z","contentChangedAt":"2026-09-14T14:46:34.677Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}