[ 
https://issues.apache.org/jira/browse/TUBEMQ-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17113975#comment-17113975
 ] 

viviel commented on TUBEMQ-141:
-------------------------------

I sorted out the general process.
After referring to the previous tboy's comments and viewing the source code of 
other related projects, I found that the general idea is similar

1. Obtain all local Network interface information
2. Traverse the IP information bound to each Network interface
3. Exclude the loopback address and some private addresses

If none can be obtained, an exception will be thrown and handed over to the 
user for processing

In addition, two TubeClientConfig constructors will be overloaded to be 
compatible with the original logic

If there is no problem, I will follow this process to achieve

> Remove the requirement to provide localHostIP
> ---------------------------------------------
>
>                 Key: TUBEMQ-141
>                 URL: https://issues.apache.org/jira/browse/TUBEMQ-141
>             Project: Apache TubeMQ
>          Issue Type: Improvement
>            Reporter: Guocheng Zhang
>            Assignee: viviel
>            Priority: Major
>             Fix For: 0.5.0
>
>         Attachments: image-2020-05-21-20-54-37-013.png
>
>
> The initial requirement to provide localHostIP during initialization is 
> because we have multiple network cards and multiple IPs in our environment. 
> The initial implementation is to find the first IP from the specified 
> NetworkInterface and report it, but It is found that sometimes the specified 
> NetworkInterface is not configured with IP, so, we consider the user is 
> required to provide a local IP:
>  !image-2020-05-21-20-54-37-013.png! 
> After a period of use, the user feedback the API is cumbersome to use. The 
> best way is to provide a configurable NetworkInterface API, so if the IP is 
> not found, we can change the NetworkInterface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to