apache / rocketmq-client-python

Apache RocketMQ python client
https://rocketmq.apache.org/
Apache License 2.0
277 stars 95 forks source link

The default instance names generated for Consumer and Producer may be duplicated. #151

Open Heng-Bian opened 5 months ago

Heng-Bian commented 5 months ago

BUG REPORT

  1. Please describe the issue you observed:
  1. Please tell us about your environment:
  1. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc): Suggestion: When no instance name is specified, generate a default instance name that includes a timestamp to avoid duplication.
Heng-Bian commented 5 months ago

I am preparing to submit a PR to fix this issue.

Heng-Bian commented 5 months ago

For the instance name @8#DEFAULT, I found that the default instance name generated by rocketmq-client-cpp includes the IP address. The correct format should be 127.0.0.1@8#DEFAULT. However, under certain complex conditions, the program often cannot obtain the IP address, resulting in the instance name being generated as @8#DEFAULT, which ultimately leads to name duplication. Therefore, adding a timestamp is still necessary.