{"record":{"id":"8edc928f9f3b8417","repo":"conductor-oss/conductor","slug":"batch-size-must-be-greater-than-0","errorCode":null,"errorMessage":"Batch size must be greater than 0","messagePattern":"Batch size must be greater than 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPObservableQueue.java","lineNumber":89,"sourceCode":"    public AMQPObservableQueue(\n            ConnectionFactory factory,\n            Address[] addresses,\n            boolean useExchange,\n            AMQPSettings settings,\n            AMQPRetryPattern retrySettings,\n            int batchSize,\n            int pollTimeInMS) {\n        if (factory == null) {\n            throw new IllegalArgumentException(\"Connection factory is undefined\");\n        }\n        if (addresses == null || addresses.length == 0) {\n            throw new IllegalArgumentException(\"Addresses are undefined\");\n        }\n        if (settings == null) {\n            throw new IllegalArgumentException(\"Settings are undefined\");\n        }\n        if (batchSize <= 0) {\n            throw new IllegalArgumentException(\"Batch size must be greater than 0\");\n        }\n        if (pollTimeInMS <= 0) {\n            throw new IllegalArgumentException(\"Poll time must be greater than 0 ms\");\n        }\n        this.useExchange = useExchange;\n        this.settings = settings;\n        this.batchSize = batchSize;\n        this.amqpConnection = AMQPConnection.getInstance(factory, addresses, retrySettings);\n        this.retrySettings = retrySettings;\n        this.setPollTimeInMS(pollTimeInMS);\n    }\n\n    @Override\n    public Observable<Message> observe() {\n        Observable.OnSubscribe<Message> onSubscribe = null;\n        // This will enabled the messages to be processed one after the other as per the\n        // observable next behavior.\n        if (settings.isSequentialProcessing()) {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/amqp/src/main/java/com/netflix/conductor/contribs/queue/amqp/AMQPObservableQueue.java#L71-L107","documentation":"Constructor guard on AMQPObservableQueue: batchSize <= 0. batchSize controls basicQos(prefetch) and how many messages are drained per poll cycle, so a non-positive value is rejected. The Builder reads it from AMQPEventQueueProperties.getBatchSize().","triggerScenarios":"Constructing the queue with batchSize of 0 or negative; the Builder used because properties.getBatchSize() returned a non-positive value (unset property defaulting to 0).","commonSituations":"The batchSize property (e.g. conductor AMQP batch size) is unset or misconfigured to 0; a profile override cleared it.","solutions":["Set a positive batchSize in AMQPEventQueueProperties (e.g. 1 or higher).","If constructing directly, pass an explicit positive batchSize.","Validate the property at application startup."],"exampleFix":"# before: unset batch size defaults to 0 -> constructor rejects\n# (no property set)\n\n# after: set a positive batch size\nconductor.amqp.batchSize=10","handlingStrategy":"validation","validationCode":"if (batchSize <= 0) {\n    throw new IllegalArgumentException(\"batchSize must be positive; check conductor.amqp.batchSize\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set a positive batchSize in AMQPEventQueueProperties.","Validate numeric AMQP properties at application startup.","Default missing numeric properties to a sane positive value in config."],"tags":["amqp","config","validation"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}