{"record":{"id":"c6c4d67bef3cf818","repo":"openzipkin/zipkin","slug":"queue-null-c6c4d6","errorCode":null,"errorMessage":"queue == null","messagePattern":"queue == null","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"zipkin-collector/rabbitmq/src/main/java/zipkin2/collector/rabbitmq/RabbitMQCollector.java","lineNumber":90,"sourceCode":"    public Builder addresses(List<String> addresses) {\n      this.addresses = convertAddresses(addresses);\n      return this;\n    }\n\n    public Builder concurrency(int concurrency) {\n      this.concurrency = concurrency;\n      return this;\n    }\n\n    public Builder connectionFactory(ConnectionFactory connectionFactory) {\n      if (connectionFactory == null) throw new NullPointerException(\"connectionFactory == null\");\n      this.connectionFactory = connectionFactory;\n      return this;\n    }\n\n    /** Queue zipkin spans will be consumed from. Defaults to \"zipkin-spans\". */\n    public Builder queue(String queue) {\n      if (queue == null) throw new NullPointerException(\"queue == null\");\n      this.queue = queue;\n      return this;\n    }\n\n    @Override\n    public RabbitMQCollector build() {\n      return new RabbitMQCollector(this);\n    }\n  }\n\n  final String queue;\n  final LazyInit connection;\n\n  RabbitMQCollector(Builder builder) {\n    this.queue = builder.queue;\n    this.connection = new LazyInit(builder);\n  }\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-collector/rabbitmq/src/main/java/zipkin2/collector/rabbitmq/RabbitMQCollector.java#L72-L108","documentation":"RabbitMQCollector.Builder.queue(String) throws NullPointerException on a null queue name. The queue (default 'zipkin-spans') is what the consumers subscribe to; the builder rejects null so the declaration/subscription step never receives an invalid name. Empty string is not rejected here — only null.","triggerScenarios":"Calling .queue(null) — e.g. reading the queue name from a config key that is absent, or a variable left null on a code path that still calls the builder.","commonSituations":"Renaming the queue per environment with a missing key in one environment's config file.","solutions":["Pass a concrete queue name, e.g. .queue(\"zipkin-spans\")","Default the config: getOrDefault(\"rabbitmq.queue\", \"zipkin-spans\")","Omit the call to keep the built-in default 'zipkin-spans'"],"exampleFix":"// before\nbuilder.queue(props.getProperty(\"rabbitmq.queue\")); // null when key missing\n\n// after\nbuilder.queue(props.getProperty(\"rabbitmq.queue\", \"zipkin-spans\"));","handlingStrategy":"validation","validationCode":"String queue = props.getProperty(\"rabbitmq.queue\", \"zipkin-spans\");\nif (queue == null) throw new IllegalStateException(\"rabbitmq.queue must not be null\");\nbuilder.queue(queue);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default the queue name at the config layer","Per-environment queue names: add the key to every environment's config and lint for missing keys"],"tags":["rabbitmq","zipkin","builder","null-check","queue"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}