{"record":{"id":"6a2f5f1a9116d4a4","repo":"openzipkin/zipkin","slug":"concurrency-1","errorCode":null,"errorMessage":"concurrency < 1","messagePattern":"concurrency < 1","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java","lineNumber":64,"sourceCode":"      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;\n  final LazyInit lazyInit;\n\n  ActiveMQCollector(Builder builder) {\n    this.queue = builder.queue;\n    this.lazyInit = new LazyInit(builder);\n  }\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-collector/activemq/src/main/java/zipkin2/collector/activemq/ActiveMQCollector.java#L46-L82","documentation":"ActiveMQCollector.Builder.concurrency(int) requires at least 1 concurrent message listener; 0 or negative values throw IllegalArgumentException. Concurrency controls how many JMS MessageListeners process spans from the queue in parallel.","triggerScenarios":"Calling .concurrency(0) or a negative number — commonly a parsed config value (ACTIVEMQ_CONCURRENCY) that defaulted to 0 or was misparsed (e.g. empty string parsed as 0).","commonSituations":"Numeric env property unset and defaulting to 0 in a properties loader; a \"disable\" flag misused as concurrency; config typos producing non-numeric parses.","solutions":["Set concurrency to 1 or higher; 1 is the default and is fine for low volume.","Validate/normalize parsed config before the builder: if (c < 1) c = 1 or fail with a clear config error.","Check the raw property value (empty string, whitespace, wrong key) if it parses to 0."],"exampleFix":"// before\nint c = Integer.parseInt(props.getProperty(\"concurrency\", \"0\"));\nbuilder.concurrency(c); // throws 'concurrency < 1'\n\n// after\nint c = Integer.parseInt(props.getProperty(\"concurrency\", \"1\"));\nbuilder.concurrency(Math.max(1, c));","handlingStrategy":"validation","validationCode":"java\nint c = Integer.parseInt(props.getProperty(\"concurrency\", \"1\"));\nif (c < 1) throw new IllegalArgumentException(\"concurrency must be >= 1: \" + c);\nbuilder.concurrency(c);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize parsed numeric config to sane minimums before passing to builders.","Use non-zero defaults in property loaders."],"tags":["zipkin","java","activemq","configuration","validation"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}