linghengqian opened a new issue, #29419:
URL: https://github.com/apache/shardingsphere/issues/29419

   ## Feature Request
   
   **For English only**, other languages will not be accepted.
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot make decision by current information, 
we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Is your feature request related to a problem?
   
   - Yes. Early investigation involving #29052 .
   
   ### Describe the feature you would like.
   
   - There are design issues with the current implementation of Consul. Refer 
to 
https://github.com/apache/shardingsphere/blob/5.4.1/mode/type/cluster/repository/provider/consul/src/main/java/org/apache/shardingsphere/mode/repository/cluster/consul/ConsulRepository.java
 .
   
   - There is a problem with the way `ConsulRawClient` is initialized, which 
results in `server-lists` not allowing ports to be configured.
   ```java
   ConsulRawClient rawClient = Strings.isNullOrEmpty(config.getServerLists()) ? 
new ConsulRawClient() : new ConsulRawClient(config.getServerLists());
   ```
   - If we configure the following configuration in the shardingsphere 
configuration file, this will resolve to `localhost:62391:8500`. This section 
lacks corresponding unit tests.
   ```yaml
   mode:
     type: Cluster
     repository:
       type: Consul
       props:
         namespace: governance
         server-lists: localhost:62391
   ```
   
   - This should parse `server-lists` and switch from calling 
`ConsulRawClient(String agentHost)` to calling `ConsulRawClient(String 
agentHost, int agentPort)`.
   
   - It is reasonable behavior to allow `ConsulRawClient` of 
`cluster-mode-repository-consul` to be configured on ports other than `8500`.
   - Also, I looked at `com.ecwid.consul.v1.ConsulRawClient`, and 
`server-lists` is a weird word in a consul client context, since it's actually 
only possible to connect to a consul instance.


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