{"record":{"id":"11cf1bd3ddb8c89b","repo":"openzipkin/zipkin","slug":"groupid-null","errorCode":null,"errorMessage":"groupId == null","messagePattern":"groupId == null","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"zipkin-collector/kafka/src/main/java/zipkin2/collector/kafka/KafkaCollector.java","lineNumber":99,"sourceCode":"     * Topic zipkin spans will be consumed from. Defaults to \"zipkin\". Multiple topics may be\n     * specified if comma delimited.\n     */\n    public Builder topic(String topic) {\n      if (topic == null) throw new NullPointerException(\"topic == null\");\n      this.topic = topic;\n      return this;\n    }\n\n    /** The bootstrapServers connect string, ex. 127.0.0.1:9092. No default. */\n    public Builder bootstrapServers(String bootstrapServers) {\n      if (bootstrapServers == null) throw new NullPointerException(\"bootstrapServers == null\");\n      properties.put(BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n      return this;\n    }\n\n    /** The consumer group this process is consuming on behalf of. Defaults to \"zipkin\" */\n    public Builder groupId(String groupId) {\n      if (groupId == null) throw new NullPointerException(\"groupId == null\");\n      properties.put(GROUP_ID_CONFIG, groupId);\n      return this;\n    }\n\n    /** Count of threads consuming the topic. Defaults to 1 */\n    public Builder streams(int streams) {\n      this.streams = streams;\n      return this;\n    }\n\n    /**\n     * By default, a consumer will be built from properties derived from builder defaults, as well\n     * as \"auto.offset.reset\" -> \"earliest\". Any properties set here will override the consumer\n     * config.\n     *\n     * <p>For example: Only consume spans since you connected by setting the below.\n     *\n     * <pre>{@code","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-collector/kafka/src/main/java/zipkin2/collector/kafka/KafkaCollector.java#L81-L117","documentation":"KafkaCollector.Builder.groupId(String) throws NullPointerException when passed null. The group id identifies the consumer group this process consumes on behalf of (default \"zipkin\"); the builder requires a non-null override. Fail-fast at builder time so an invalid consumer group never reaches Kafka.","triggerScenarios":"Calling .groupId(null) on KafkaCollector.Builder, typically with a value sourced from a config key that is absent (e.g. getProperty(\"group.id\") returning null).","commonSituations":"Mapping Kafka consumer properties into the zipkin collector builder and a missing group.id key, or conditionally setting a group id where the condition leaves the variable null.","solutions":["Pass a concrete group id, e.g. .groupId(\"zipkin\") or your service's group name","If sourced from properties, default it: props.getProperty(\"group.id\", \"zipkin\")","Skip the groupId() call entirely to keep the built-in default of \"zipkin\""],"exampleFix":"// before\nbuilder.groupId(props.getProperty(\"group.id\")); // null when key absent\n\n// after\nbuilder.groupId(props.getProperty(\"group.id\", \"zipkin\"));","handlingStrategy":"validation","validationCode":"String groupId = props.getProperty(\"group.id\", \"zipkin\");\nif (groupId == null) throw new IllegalStateException(\"group.id must not be null\");\nbuilder.groupId(groupId);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default optional Kafka settings at the config-reading layer, never at the builder with null","Centralize property loading so missing keys are logged by name before reaching the builder"],"tags":["kafka","zipkin","builder","null-check","configuration"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}