You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yzletter (via GitHub)" <gi...@apache.org> on 2025/12/28 03:29:04 UTC
[I] [Bug] Producer 不指定 WithTopics 无法正常启动 [rocketmq-clients]
yzletter opened a new issue, #1165:
URL: https://github.com/apache/rocketmq-clients/issues/1165
### Before Creating the Bug Report
- [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq-clients/discussions).
- [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq-clients/issues) and [GitHub Discussions](https://github.com/apache/rocketmq-clients/discussions) of this repository and believe that this is not a duplicate.
- [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
### Programming Language of the Client
Java
### Runtime Platform Environment
MacOS
### RocketMQ Version of the Client/Server
v5.1.3/client.go
### Run or Compiler Version
go 1.25.3
### Describe the Bug
Producer 不指定 WithTopics
```go
producer, err = rmq_client.NewProducer(
&rmq_client.Config{
Endpoint: common.EndPoint,
Credentials: &credentials.SessionCredentials{},
NameSpace: "",
ConsumerGroup: "",
},
rmq_client.WithMaxAttempts(1),
// rmq_client.WithTopics(common.NormalTopic),
)
```
无法正常启动,会卡在
```go
// wait syncSettings finish
for !cli.inited.Load() {
sugarBaseLogger.Infoln("wait for sync settings finish")
time.Sleep(time.Second)
}
sugarBaseLogger.Infoln("sync settings finished")
return nil
```
一直报
```shell
2025-12-28T11:21:40.709+0800 INFO v5@v5.1.3/client.go:590 wait for sync settings finish
```
### Steps to Reproduce
Producer 不指定 WithTopics 进行 Start
### What Did You Expect to See?
正常启动
```shell
2025-12-28T11:27:59.264+0800 INFO v5@v5.1.3/metric.go:337 metric is off, clientId=xxx
2025-12-28T11:27:59.264+0800 INFO v5@v5.1.3/client.go:99 Executed command successfully {"client_id": "xxx"}
2025-12-28T11:27:59.264+0800 INFO v5@v5.1.3/metric.go:337 metric is off, clientId=xxx
2025-12-28T11:27:59.264+0800 INFO v5@v5.1.3/client.go:99 Executed command successfully {"client_id": "xxx"}
2025-12-28T11:28:00.265+0800 INFO v5@v5.1.3/client.go:593 sync settings finished
```
### What Did You See Instead?
```shell
2025-12-28T11:21:35.703+0800 INFO v5@v5.1.3/client.go:590 wait for sync settings finish
2025-12-28T11:21:36.703+0800 INFO v5@v5.1.3/client.go:590 wait for sync settings finish
2025-12-28T11:21:37.706+0800 INFO v5@v5.1.3/client.go:590 wait for sync settings finish
2025-12-28T11:21:38.707+0800 INFO v5@v5.1.3/client.go:590 wait for sync settings finish
2025-12-28T11:21:39.708+0800 INFO v5@v5.1.3/client.go:590 wait for sync settings finish
2025-12-28T11:21:40.709+0800 INFO v5@v5.1.3/client.go:590 wait for sync settings finish
```
### Additional Context
_No response_
--
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: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Producer 不指定 WithTopics 无法正常启动 [rocketmq-clients]
Posted by "ShiKaiWi (via GitHub)" <gi...@apache.org>.
ShiKaiWi commented on issue #1165:
URL: https://github.com/apache/rocketmq-clients/issues/1165#issuecomment-4563656654
@lizhimins The current implementation can be confusing for users. When WithTopics() is not configured, the log repeatedly prints "wait for sync settings finish" indefinitely, which misleads users into suspecting a network issue between the client and the server, when in fact the root cause is a missing configuration.
I'd like to propose a minor, non-breaking improvement to the logging behavior: when the client has been waiting for settings synchronization for an extended period (e.g. 30 seconds) and initTopics is empty, the log message should include additional diagnostic details indicating that no initial topics were configured. This would help users quickly identify the root cause without changing any existing behavior or control flow.
Here is a simple code snippet to illustrate the idea:
```go
startTime := time.Now()
for !cli.inited.Load() {
if len(cli.initTopics) == 0 && time.Since(startTime) > 30*time.Second {
sugarBaseLogger.Warnf("wait for sync settings finish, but no initial topics configured via WithTopics(). "+
"The client cannot establish a telemetry connection without at least one topic. "+
"Elapsed: %v", time.Since(startTime))
} else {
sugarBaseLogger.Infoln("wait for sync settings finish")
}
time.Sleep(time.Second)
}
sugarBaseLogger.Infoln("sync settings finished")
```
I'm glad to submit a pull request if you aggre with this solution.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Producer 不指定 WithTopics 无法正常启动 [rocketmq-clients]
Posted by "yzletter (via GitHub)" <gi...@apache.org>.
yzletter closed issue #1165: [Bug] Producer 不指定 WithTopics 无法正常启动
URL: https://github.com/apache/rocketmq-clients/issues/1165
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Producer 不指定 WithTopics 无法正常启动 [rocketmq-clients]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #1165:
URL: https://github.com/apache/rocketmq-clients/issues/1165#issuecomment-3776364775
This is by design as intended.
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Producer 不指定 WithTopics 无法正常启动 [rocketmq-clients]
Posted by "yzletter (via GitHub)" <gi...@apache.org>.
yzletter commented on issue #1165:
URL: https://github.com/apache/rocketmq-clients/issues/1165#issuecomment-3776436192
3q,sir
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org