{"record":{"id":"e9b564ee24751e3f","repo":"apache/rocketmq","slug":"pullinterval-out-of-range-0-65535","errorCode":null,"errorMessage":"pullInterval Out of range [0, 65535]","messagePattern":"pullInterval Out of range \\[0, 65535\\]","errorType":"validation","errorClass":"MQClientException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java","lineNumber":1171,"sourceCode":"            throw new MQClientException(\n                \"pullThresholdSizeForQueue Out of range [1, 1024]\"\n                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL),\n                null);\n        }\n\n        if (this.defaultMQPushConsumer.getPullThresholdSizeForTopic() != -1) {\n            // pullThresholdSizeForTopic\n            if (this.defaultMQPushConsumer.getPullThresholdSizeForTopic() < 1 || this.defaultMQPushConsumer.getPullThresholdSizeForTopic() > 102400) {\n                throw new MQClientException(\n                    \"pullThresholdSizeForTopic Out of range [1, 102400]\"\n                        + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL),\n                    null);\n            }\n        }\n\n        // pullInterval\n        if (this.defaultMQPushConsumer.getPullInterval() < 0 || this.defaultMQPushConsumer.getPullInterval() > 65535) {\n            throw new MQClientException(\n                \"pullInterval Out of range [0, 65535]\"\n                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL),\n                null);\n        }\n\n        // consumeMessageBatchMaxSize\n        if (this.defaultMQPushConsumer.getConsumeMessageBatchMaxSize() < 1\n            || this.defaultMQPushConsumer.getConsumeMessageBatchMaxSize() > 1024) {\n            throw new MQClientException(\n                \"consumeMessageBatchMaxSize Out of range [1, 1024]\"\n                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_PARAMETER_CHECK_URL),\n                null);\n        }\n\n        // pullBatchSize\n        if (this.defaultMQPushConsumer.getPullBatchSize() < 1 || this.defaultMQPushConsumer.getPullBatchSize() > 1024) {\n            throw new MQClientException(\n                \"pullBatchSize Out of range [1, 1024]\"","sourceCodeStart":1153,"sourceCodeEnd":1189,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java#L1153-L1189","documentation":"Thrown during push-consumer startup when pullInterval is outside [0, 65535] milliseconds. pullInterval is the delay between two consecutive pull requests on a queue, used to slow down consumption (application-level throttling). Zero means pull as fast as possible; the client rejects negative delays and anything above ~65 s because scheduling with such values is not meaningful.","triggerScenarios":"Calling consumer.setPullInterval(n) with n < 0 or n > 65535, then consumer.start(). Most commonly n was specified in the wrong time unit (seconds or microseconds handed to a millisecond API).","commonSituations":"Passing seconds where milliseconds are expected (e.g. 10 intended as 10 s but 10_000_000 ms given, exceeding 65535); attempting to slow consumption drastically via a huge interval instead of using a RateLimiter in the listener; YAML/properties value parsed as nanoseconds by a framework.","solutions":["Set pullInterval to a millisecond value in [0, 65535] (default 0)","Verify the time unit at the call site and convert explicitly, e.g. TimeUnit.SECONDS.toMillis(10)","For aggressive throttling, use a rate limiter inside the MessageListener instead of a large pullInterval"],"exampleFix":"// before\nconsumer.setPullInterval(10); // meant 10 seconds? no — 10 ms; or\nconsumer.setPullInterval(60_000_000); // out of range\n// after\nconsumer.setPullInterval(TimeUnit.SECONDS.toMillis(1)); // 1000 ms, in range","handlingStrategy":"validation","validationCode":"long v = consumer.getPullInterval();\nif (v < 0 || v > 65535) throw new IllegalArgumentException(\"pullInterval must be [0,65535] ms: \" + v);\nconsumer.start();","typeGuard":null,"tryCatchPattern":"catch (MQClientException e) { if (e.getMessage().contains(\"pullInterval\")) throw new ConfigException(e); throw e; }","preventionTips":["Always construct the value with TimeUnit: TimeUnit.SECONDS.toMillis(n)","Use a listener-side RateLimiter for heavy throttling instead of pullInterval"],"tags":["rocketmq","consumer","configuration","throttling","validation"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}