You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/03/04 11:26:30 UTC

[GitHub] [dubbo] Alloyee commented on issue #9617: dubbo 2.7.14开始在docker swarm中注册到nacos中IP地址出现问题

Alloyee commented on issue #9617:
URL: https://github.com/apache/dubbo/issues/9617#issuecomment-1059078464


   一样的问题,目前通过扩展一个Registory和RegistoryFactory来解决的
   `public class Nacos2Registry extends NacosRegistry {
       public Nacos2Registry(URL url, NacosNamingServiceWrapper namingService) {
           super(url, namingService);
       }
   
       @Override
       public void register(URL url) {
           log.info("Nacos2Registry register before setting,url:{}",url);
           url = url.setHost(NetUtils.getIpAddress());
           log.info("Nacos2Registry register after setting,url:{}",url);
           super.register(url);
       }
   
       @Override
       public void unregister(URL url) {
           log.info("Nacos2Registry unregister,url:{}",url);
           url = url.setHost(NetUtils.getIpAddress());
           super.unregister(url);
       }
   }`
   
   ![image](https://user-images.githubusercontent.com/21155995/156755134-af271383-938e-4435-b6e1-7e994b1f9c25.png)
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org