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 2020/07/19 01:58:46 UTC

[GitHub] [dubbo-go] JiaLiangoooo opened a new issue #663: registry-consul support pure consumer regist

JiaLiangoooo opened a new issue #663:
URL: https://github.com/apache/dubbo-go/issues/663


   <!-- Please only use this template for submitting enhancement requests -->
   
   **What would you like to be added**: consul注册中心支持纯消费者注册、监听.
   **Why is this needed**: 有业务需要监听消费者服务是否消费正常. 从而进行一些异常处理操作. 
   
   


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

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


[GitHub] [dubbo-go] zouyx commented on issue #663: consul registry not support consumer register

Posted by GitBox <gi...@apache.org>.
zouyx commented on issue #663:
URL: https://github.com/apache/dubbo-go/issues/663#issuecomment-681317448


   any other quertions?


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

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


[GitHub] [dubbo-go] JiaLiangoooo commented on issue #663: registry-consul support pure consumer regist

Posted by GitBox <gi...@apache.org>.
JiaLiangoooo commented on issue #663:
URL: https://github.com/apache/dubbo-go/issues/663#issuecomment-660637299


   @gaoxinge 
   - 目前来看consul是绑定了provider和consumer的, 如果去掉了这个限制的话,  注册中心只提供注册相关能力的话, 可以让自己去实现.  
   - 后续如果支持应用维度注册的话, 单纯的consumer是否也可以去把自己注册上去. 可以被外界监控到? 


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

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


[GitHub] [dubbo-go] JiaLiangoooo commented on issue #663: registry-consul support pure consumer regist

Posted by GitBox <gi...@apache.org>.
JiaLiangoooo commented on issue #663:
URL: https://github.com/apache/dubbo-go/issues/663#issuecomment-660572805


   目前并没有好的方案去解决这个问题.  请问有没有更好办法?
   ```
   func registerConsul(wssId string) error {
   	consumerConfig := config.GetConsumerConfig()
   	address := consumerConfig.Registry.Address
   	s := strings.Split(address, ":")
   
   	getRegistry, err := extension.GetRegistry(consumerConfig.Registry.Protocol, newRegistryUrl(s[0], s[1]))
   	if err != nil {
   		return errors.WithMessage(err, "get registry error")
   	}
   
   	var ip string
   	tcp, err := gxnet.ListenOnTCPRandomPort(ip)
   	if err != nil {
   		return errors.WithMessage(err, "listen tcp error")
   	}
   
   	providerUrl := newProviderUrl("localhost", strings.Split(tcp.Addr().String(), ":")[1], wssId, "tcp")
   	err = getRegistry.Register(providerUrl)
   	if err != nil {
   		return errors.WithMessage(err, "register error")
   	}
   
   	// TODO: 这样写有问题,开启一个Go协程去处理, 已经脱离了控制? gxnet是否有提供一个接口可以使用?
   	go func() {
   		logger.Infof("start listen address: %s", tcp.Addr().String())
   		if err := http.ListenAndServe(tcp.Addr().String(), nil); err != nil {
   			logger.Errorf("http listen port:%s error: %v", tcp.Addr().String(), err)
   		}
   	}()
   	return nil
   }
   ```


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

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


[GitHub] [dubbo-go] gaoxinge edited a comment on issue #663: consul registry not support consumer register

Posted by GitBox <gi...@apache.org>.
gaoxinge edited a comment on issue #663:
URL: https://github.com/apache/dubbo-go/issues/663#issuecomment-670832935


   I have commented an issue https://github.com/apache/dubbo/issues/6569 in [apache/dubbo](https://github.com/apache/dubbo).


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

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


[GitHub] [dubbo-go] gaoxinge commented on issue #663: consul registry not support consumer register

Posted by GitBox <gi...@apache.org>.
gaoxinge commented on issue #663:
URL: https://github.com/apache/dubbo-go/issues/663#issuecomment-670832935


   I have commented an issue https://github.com/apache/dubbo/issues/6569 for [apache/dubbo](https://github.com/apache/dubbo/issues/6569).


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

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


[GitHub] [dubbo-go] JiaLiangoooo closed issue #663: consul registry not support consumer register

Posted by GitBox <gi...@apache.org>.
JiaLiangoooo closed issue #663:
URL: https://github.com/apache/dubbo-go/issues/663


   


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

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


[GitHub] [dubbo-go] gaoxinge commented on issue #663: registry-consul support pure consumer regist

Posted by GitBox <gi...@apache.org>.
gaoxinge commented on issue #663:
URL: https://github.com/apache/dubbo-go/issues/663#issuecomment-660580580


   @JiaLiangoooo 
   - 目前Java还不支持consul consumer的[register](https://github.com/apache/dubbo/blob/fb5761683729f63c715e39c78a8b7b75278050c9/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulRegistry.java#L100-L107)和[unregister](https://github.com/apache/dubbo/blob/master/dubbo-registry/dubbo-registry-consul/src/main/java/org/apache/dubbo/registry/consul/ConsulRegistry.java#L118-L125)。
   - 我们是不是可以参照consul provider的register和unregister,也给consul consumer加一个?
   
   


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

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


[GitHub] [dubbo-go] JiaLiangoooo commented on issue #663: registry-consul support pure consumer regist

Posted by GitBox <gi...@apache.org>.
JiaLiangoooo commented on issue #663:
URL: https://github.com/apache/dubbo-go/issues/663#issuecomment-660573272


   会限制注册的URL的类型吗 
   
   ```
   // Register service to consul registry center
   func (r *consulRegistry) Register(url common.URL) error {
   	var err error
   
   	role, _ := strconv.Atoi(r.URL.GetParam(constant.ROLE_KEY, ""))
   	if role == common.PROVIDER {
   		err = r.register(url)
   		if err != nil {
   			return err
   		}
   	}
   	return nil
   }
   
   // Unregister service from consul registry center
   func (r *consulRegistry) Unregister(url common.URL) error {
   	var err error
   
   	role, _ := strconv.Atoi(r.URL.GetParam(constant.ROLE_KEY, ""))
   	if role == common.PROVIDER {
   		err = r.unregister(url)
   		if err != nil {
   			return err
   		}
   	}
   	return nil
   }
   ```


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

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