[Bug] maxUserPropertySize = 0 (documented as "no limit") rejects every message with a tag, key or user property

Aperta
#11,387 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@iloveeyjafjalla ci sta già lavorando.

Dal 13/10/2026.

  • #11388 di @iloveeyjafjalla — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
grpc, java
Ambito
backend

Direzione di ricerca

The user-property check is in SendMessageActivity in the proxy module, and the limit comes from ProxyConfig.maxUserPropertySize. Compare it with the guards above it for message body and group size, which return early when the limit is not positive. Done means a non-positive limit skips the check, and a test covers a tagged message with the limit set to 0. Pull request #11388 already addresses this, so check it before starting.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Before Creating the Bug Report
  • I found a bug, not just asking a question, which should be created in GitHub Discussions.
  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment

OS: any (proxy module, gRPC v2 producer path)

RocketMQ version

branch: develop
Git commit id: 9ea2ccdc2b41445aee5e177e14e501d606f5a1ed (the files are unchanged on develop@b76420599)

JDK Version

Compiler: Temurin 1.8.0_504 (target 1.8, same as CI)

Describe the Bug

Setting maxUserPropertySize to the documented "no limit" value rejects every message that carries a tag, a key or a user property.

ProxyConfig documents the option as:

/**
 * max user property size, 0 or negative number means no limit for proxy
 */
private int maxUserPropertySize = 16 * 1024;

and the other size limits in SendMessageActivity all honour that convention:

int max = ConfigurationManager.getProxyConfig().getMaxMessageSize();
if (max <= 0) { return; }                      // message body
int maxSize = ...getMaxMessageGroupSize(); if (maxSize <= 0) { return; }     // message group
long maxDelay = ...getMaxDelayTimeMills();  if (maxDelay <= 0) { return; }   // delay time
long maxTransactionRecoverySecond = ...;    if (maxTransactionRecoverySecond <= 0) { return; }

but the user-property check has no such guard:

if (userPropertySize > config.getMaxUserPropertySize()) {
    throw new GrpcProxyException(Code.MESSAGE_PROPERTIES_TOO_LARGE, "the total size of user property is too large, max is " + ...);
}

userPropertySize counts the user properties, the tag and the keys, so it is greater than 0 for any message that uses them —
and with maxUserPropertySize = 0 (or negative, i.e. the documented "no limit") every such send fails with
MESSAGE_PROPERTIES_TOO_LARGE. The documented way of disabling the limit therefore bricks those sends instead of lifting
the check.

Steps to Reproduce
  1. Set maxUserPropertySize: 0 in rmq-proxy.json (documented meaning: no limit).
  2. Send a message with a tag or a user property through a gRPC client.
  3. The broker answers MESSAGE_PROPERTIES_TOO_LARGE ("the total size of user property is too large, max is 0").
Expected behavior

A non-positive maxUserPropertySize disables the check, exactly like the other size limits of the same activity.

Actual behavior

Every message that carries a tag, a key or a user property is rejected.

Additional context

Fix: run the comparison only when the configured limit is positive.

Lingua principale
Java
Stelle
22.7k
Fork
12k
Merge medio
4g 20h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/rocketmq

Tutte le issue di apache/rocketmq

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.