RockteMQ-AI commented on issue #1316: URL: https://github.com/apache/rocketmq-clients/issues/1316#issuecomment-5142591942
## 🔧 Proposed Fix Summary The bot has analyzed this issue and generated a fix spec. Here is a summary: ### Problem `Producer.Start()` blocks indefinitely when no topics are pre-registered (i.e., `WithTopics(...)` is not called). The `startUp()` method loops waiting for `cli.inited` to become `true`, but `inited` is only set when a telemetry `Settings` command arrives — which never happens because no telemetry stream is opened when the router is empty. ### Root Cause Circular dependency: the telemetry stream is only opened when topics exist in the router, but `inited` (required to unblock startup) is only set when a telemetry `Settings` command arrives through that stream. ### Proposed Fix Open a telemetry session to the access point eagerly during `startUp()`, before the `initTopics` loop. This ensures the broker can push the initial `Settings` command regardless of whether topics are pre-registered. **File:** `golang/client.go` — `defaultClient.startUp()` **Change:** Add ~5 lines before the `initTopics` loop to call `cli.mustSyncSettingsToTargert(accessPointTarget)`. ### Safety - No public API changes - No behavioral change when topics are pre-registered (telemetry session is idempotent) - All client types (Producer, SimpleConsumer, PushConsumer) benefit --- 📋 **Full spec is available for review.** Please reply with one of the following commands: - `/approve` — Approve the spec and proceed with PR generation - `/revise <feedback>` — Request changes to the spec - `/reject` — Reject the proposal ⏰ *This will timeout in 72 hours if no feedback is received.* --- *🤖 Generated by github-manager bot* -- 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]
