youngkermit8-coder opened a new issue, #1522:
URL: https://github.com/apache/rocketmq-dashboard/issues/1522

   ## Bug Report
   
   ### Runtime environment
   
   - Branch: `rocketmq-studio`
   - JDK: 21
   
   ### Description
   
   The oversized-message check added for #1443 currently runs only after
   `DefaultMQProducer.start()` succeeds. `sendMessage()` resolves the selected
   instance endpoint, constructs a producer, and connects to the NameServer 
before
   encoding and validating the request body.
   
   This makes validation of an invalid request depend on external 
infrastructure:
   
   - an unavailable or invalid NameServer can return a 500 before the expected 
400;
   - oversized requests still create and start a short-lived producer;
   - the broker connection and shutdown work is unnecessary because the message 
can
     never be sent.
   
   ### Steps to reproduce
   
   1. Configure an unavailable NameServer endpoint.
   2. Call `POST /api/topics/send` with a UTF-8 body larger than 4 MiB.
   3. Observe that the producer startup fails before the body-size validation 
runs.
   
   ### Expected behavior
   
   Encode and validate the body before resolving an instance endpoint or 
creating a
   producer. A body larger than 4 MiB should deterministically return a 400 
without
   performing any network or producer operation.
   
   ### Proposed fix
   
   - Move request field extraction and UTF-8 body-size validation to the 
beginning
     of `RocketMQAdminClientImpl.sendMessage()`.
   - Add regression coverage proving an oversized multibyte body is rejected 
before
     endpoint resolution or producer construction.
   - Keep exactly 4 MiB valid so the existing limit remains inclusive.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to