{"record":{"id":"140d6238b0d4b5cf","repo":"openzipkin/zipkin","slug":"queue-null","errorCode":null,"errorMessage":"queue == null","messagePattern":"queue == null","errorType":"exception","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java","lineNumber":57,"sourceCode":"      return this;\n    }\n\n    @Override public Builder metrics(CollectorMetrics metrics) {\n      if (metrics == null) throw new NullPointerException(\"metrics == null\");\n      this.metrics = metrics.forTransport(\"activemq\");\n      this.delegate.metrics(this.metrics);\n      return this;\n    }\n\n    public Builder connectionFactory(ActiveMQConnectionFactory 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\". */\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    /** Count of concurrent message listeners on the queue. Defaults to 1 */\n    public Builder concurrency(int concurrency) {\n      if (concurrency < 1) throw new IllegalArgumentException(\"concurrency < 1\");\n      this.concurrency = concurrency;\n      return this;\n    }\n\n    @Override public ActiveMQCollector build() {\n      if (connectionFactory == null) throw new NullPointerException(\"connectionFactory == null\");\n      return new ActiveMQCollector(this);\n    }\n  }\n\n  final String queue;","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java#L39-L75","documentation":"ActiveMQCollector.Builder.queue(String) throws NullPointerException on null because the queue name must be a concrete string. It is not a format check — empty or blank strings are technically accepted — only null is rejected; the default queue name is \"zipkin\".","triggerScenarios":"Calling .queue(null), most often by forwarding a null configuration property (e.g. ACTIVEMQ_QUEUE not set and the code does .queue(System.getenv(\"ACTIVEMQ_QUEUE\"))).","commonSituations":"Optional queue-name config treated as mandatory in code; property typo (queue vs destination); tests omitting the queue setting.","solutions":["Only call .queue(...) when you actually have a non-null name, otherwise rely on the default \"zipkin\".","Fix the property source so the queue name resolves (check env var / config key spelling).","Coalesce to the default: .queue(name != null ? name : \"zipkin\")."],"exampleFix":"// before\nString q = System.getenv(\"ACTIVEMQ_QUEUE\"); // null when unset\nbuilder.queue(q); // NPE\n\n// after\nif (System.getenv(\"ACTIVEMQ_QUEUE\") != null) builder.queue(System.getenv(\"ACTIVEMQ_QUEUE\"));","handlingStrategy":"validation","validationCode":"java\nString q = System.getenv(\"ACTIVEMQ_QUEUE\");\nif (q != null) builder.queue(q); // default \"zipkin\" otherwise","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only call optional-name setters when the value is present; rely on documented defaults otherwise."],"tags":["zipkin","java","activemq","configuration"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}