rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

[Bug] Proxy server's Topic route info maybe wrong when local mode.

Open supervate opened this issue 1 year ago • 0 comments

Before Creating the Bug Report

  • [X] I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • [X] I have searched the GitHub Issues and GitHub 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.

Runtime platform environment

No influence.

RocketMQ version

the newest version.

JDK Version

No influence.

Describe the Bug

Grpc Client will be get the error address of proxy-service, when deployed multi proxy with different port.

e.g. proxy1: 127.0.0.1:8090 broker-a: 127.0.0.1:10911 proxy2: 127.0.0.1:8091 broker-b: 127.0.0.1:20911

If clients query the topic route info from proxy1, it will get the result as 'broker-a 127.0.0.1:8090 | broker-b 127.0.0.1:8090' or 'broker-a 127.0.0.1:8091 | broker-b 127.0.0.1:8091'. Obviously, all broker's address's port be replaced with the same port depends on the proxy be called.

If I deployed proxy with different ip and port like '192.168.1.1:8090' and '192.168.1.2:8091', It must be throw error when I call the error address like '192.168.1.1:8091'.

Steps to Reproduce

Deploy multi proxy in different ip and port with local mode. e.g.: proxy1: 127.0.0.1:8090 and broker-a: 127.0.0.1:10911

proxyconfig:

{
  "rocketMQClusterName": "DefaultCluster",
  "grpcServerPort": 8090,
  "remotingListenPort": 9080
}

brokerconfig:

brokerClusterName = DefaultCluster
brokerName = broker-a
brokerId = 0
storePathRootDir = /Users/softcache/idea-rocketMq-5-1/store
listenPort = 10911

proxy2: 127.0.0.1:8091 and broker-b: 127.0.0.1:20911

proxyconfig:

{
  "rocketMQClusterName": "DefaultCluster",
  "grpcServerPort": 8091,
  "remotingListenPort": 9081
}

brokerconfig:

brokerClusterName = DefaultCluster
brokerName = broker-b
brokerId = 0
storePathRootDir = /Users/softcache/idea-rocketMq-5-2/store
listenPort = 20911

Use the grpc clients connect to proxy-service like send messages or consumer messages, and view the topic route info from proxy-service.

What Did You Expect to See?

Every topic route info's broker should has the right proxy address include ip and port.

What Did You See Instead?

Maybe we should return the route info like cluster mode, just return the addresses that in client request headers. And I think we should set this default value to 'true'. image

Additional Context

No response

supervate avatar Jun 17 '24 06:06 supervate