leizhiyuan opened a new pull request, #1472:
URL: https://github.com/apache/rocketmq-clients/pull/1472

   ### Which Issue(s) This PR Fixes
   
   Fixes #1471
   
   ### Brief Description
   
   Align the log messages and levels of the Rust client with the Java client. 
This is a log-only change: no protocol, timing or public API changes.
   
   **Noise removed (logged on every settings sync / every batch):**
   
   - `Producer`: drop `handle setting command success.` at INFO. It fired once 
per session every 30s. Java's `ClientImpl#onSettingsCommand` applies the 
settings without logging.
   - `SimpleConsumer`: `applied server-pushed long_polling_timeout` INFO → 
DEBUG (Java's `SimpleSubscriptionSettings#sync` does not log).
   - `LiteSubscriptionManager::sync_settings`: quota / max lite topic size INFO 
→ DEBUG (Java's `LiteSubscriptionManager#sync` does not log).
   - FIFO accelerator: per-batch INFO → DEBUG, using Java's `FifoConsumeService 
parallel consume, messageViewsNum={}, groupNum={}`.
   - Per-queue `start consumer worker count` INFO → DEBUG.
   - `SimpleConsumer::start` logged its startup twice. It now logs once.
   
   **Received telemetry commands** are now logged once in `Session`, with the 
wording of Java's `ClientSessionImpl#onNext` plus `endpoints=`/`clientId=`. 
`Settings` stays at DEBUG instead of Java's INFO, because this client syncs 
every 30s vs Java's 5min. The old full `Debug` dump of every command is gone.
   
   **Same events, Java wording plus endpoints/clientId:** session creation, 
telemetry stream start/renew/release/completion/error, heartbeat (failures 
ERROR → WARN, like Java's `ClientImpl#doHeartbeat`), route cache update errors, 
scheduler shutdown, producer/simple consumer startup, and unexpected commands 
(`Ignore unexpected command from remote, ...`). Also fixes the `trannsaction` 
typo.
   
   Out of scope, called out in the issue: changing the 30s settings sync 
interval to Java's 5min. That is a behaviour change, since the timer also helps 
rebuild broken telemetry streams.
   
   ### How Did You Test This Change?
   
   - Added `util::test_log::capture()`, a test-only `tracing` subscriber that 
records events so tests can assert on level and content. It uses the existing 
`tracing-subscriber` dev-dependency.
   - New tests:
     - `producer::tests::producer_telemetry_command_logs_align_with_java`
     - `simple_consumer::tests::simple_consumer_start_logs_once`
     - `simple_consumer::tests::apply_server_settings_does_not_log_at_info`
     - 
`lite_subscription_manager::tests::test_sync_settings_does_not_log_at_info`
     - 
`push_consumer::tests::test_fifo_consume_accelerator_does_not_log_at_info`
     - `session::tests::received_telemetry_commands_are_logged_like_java`
   - Checked that each new test fails when the old level/message is restored.
   - `cargo fmt --check`, `cargo clippy --all-features -- -D warnings`, 
`RUSTDOCFLAGS='--cfg docsrs' cargo doc --no-deps --all-features` and `cargo 
test` all pass locally (lib: 156 passed, 1 ignored).
   


-- 
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