{"record":{"id":"5e15479b9371c120","repo":"redis/jedis","slug":"idmp-maxsize-must-be-between-1-and-10000","errorCode":null,"errorMessage":"IDMP-MAXSIZE must be between 1 and 10000","messagePattern":"IDMP-MAXSIZE must be between 1 and 10000","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/params/XCfgSetParams.java","lineNumber":44,"sourceCode":"   */\n  public XCfgSetParams idmpDuration(int duration) {\n    if (duration < 1 || duration > 86400) {\n      throw new IllegalArgumentException(\"IDMP-DURATION must be between 1 and 86400 seconds\");\n    }\n    this.idmpDuration = duration;\n    return this;\n  }\n\n  /**\n   * Set the maximum number of most recent idempotent IDs that Redis keeps for each producer ID.\n   * Minimum value: 1; Maximum value: 10000; default value: 100.\n   * @param maxsize maximum number of idempotent IDs per producer (1-10000)\n   * @return XCfgSetParams\n   * @throws IllegalArgumentException if maxsize is not between 1 and 10000\n   */\n  public XCfgSetParams idmpMaxsize(int maxsize) {\n    if (maxsize < 1 || maxsize > 10000) {\n      throw new IllegalArgumentException(\"IDMP-MAXSIZE must be between 1 and 10000\");\n    }\n    this.idmpMaxsize = maxsize;\n    return this;\n  }\n\n  @Override\n  public void addParams(CommandArguments args) {\n    if (idmpDuration != null) {\n      args.add(\"IDMP-DURATION\").add(idmpDuration);\n    }\n    if (idmpMaxsize != null) {\n      args.add(\"IDMP-MAXSIZE\").add(idmpMaxsize);\n    }\n  }\n\n  @Override\n  public boolean equals(Object o) {\n    if (this == o) return true;","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/params/XCfgSetParams.java#L26-L62","documentation":"XCfgSetParams.idmpMaxsize() validates the stream IDMP-MAXSIZE setting client-side; Redis allows 1 to 10000 idempotent IDs per producer. Jedis throws this IllegalArgumentException for values outside that range before any command is sent.","triggerScenarios":"Calling XCfgSetParams.xCfgSetParams().idmpMaxsize(n) with n < 1 or n > 10000, e.g. idmpMaxsize(0) or idmpMaxsize(50000).","commonSituations":"Attempting to disable the IDMP table by passing 0 instead of not setting it; sizing the table from an unconstrained user config; confusing maxsize with a byte/KB size.","solutions":["Pass a maxsize between 1 and 10000, e.g. idmpMaxsize(1000).","Omit the idmpMaxsize() call to keep the server default.","Clamp the configured value: Math.max(1, Math.min(10000, maxsize))."],"exampleFix":"// before\nXCfgSetParams params = XCfgSetParams.xCfgSetParams().idmpMaxsize(0);\n// after\nXCfgSetParams params = XCfgSetParams.xCfgSetParams().idmpMaxsize(10000);","handlingStrategy":"validation","validationCode":"if (maxsize < 1 || maxsize > 10000) throw new IllegalArgumentException(\"IDMP-MAXSIZE must be in [1, 10000], got \" + maxsize);","typeGuard":"boolean isValidIdmpMaxsize(int size) { return size >= 1 && size <= 10000; }","tryCatchPattern":"try {\n  params = XCfgSetParams.xCfgSetParams().idmpMaxsize(cfg.getMaxsize());\n} catch (IllegalArgumentException e) {\n  log.warn(\"Invalid IDMP-MAXSIZE, using default\", e);\n  params = XCfgSetParams.xCfgSetParams();\n}","preventionTips":["Clamp: Math.max(1, Math.min(10000, size)).","Document the valid range next to the config key.","Omit idmpMaxsize() to use the server default instead of guessing."],"tags":["jedis","params","validation","redis-streams"],"backgroundTag":"value-out-of-range","analyzedSha":"6dac31d4c224fb3257c216f3985340c6f500cdcb","analyzedAt":"2026-09-08T04:55:01.204Z","contentChangedAt":"2026-09-08T04:55:01.204Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}