dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

dubbo:protocol register attribute not work

Open helppass opened this issue 7 years ago • 3 comments

Environment

  • Dubbo version: 2.7.3
  • Operating System version: CentOS7
  • Java version: 1.8

Steps to reproduce this issue

  1. Set two protocal, with different "register" attribute
<dubbo:protocol name="dubbo" port="8751" register="true"  />
<dubbo:protocol name="hessian" port="8752" register="false" />
  1. use the zookeeper registry center
<dubbo:registry address="..." file="./.dubbo_cache" />
  1. start the server and view the provider in zkCli

Expected Result

only the dubbo is registed

Actual Result

the dubbo and hession protocol are registed

helppass avatar Aug 07 '19 22:08 helppass

It looks like you are reading from the local cache, is this the first time you start it?

kaori-seasons avatar Aug 08 '19 01:08 kaori-seasons

It looks like you are reading from the local cache, is this the first time you start it?

file="./.dubbo_cache"
此设置是修改默认的cache文件位置,默认值在用户Home目录下 当客户端失去注册中心联系时,会是用此缓存数据尝试连接 此设置与服务注册无关,无论改不改都会有cache文件产生

helppass avatar Aug 08 '19 03:08 helppass

Can confirm the issue. I used dubbo-samples-zookeeper with dubbo.application.name=zookeeper-demo-provider (without caching) and 2 protocols (hessian was configured with setRegister(false)). Got the same result: in zookeeper dir dubbo://172.25.26.102:20880 and hessian://172.25.26.102:20881 both present have register=true. Actually, I am not able to find any usage of using neither ProtocolConfig::isRegister nor RegistryConfig::isRegister in dubbo source code (except tests).

AnthonyKot avatar Aug 08 '19 14:08 AnthonyKot