in registry/nacos/src/lib.rs [623:656]
fn test_subscribe() {
tracing_subscriber::fmt()
.with_thread_names(true)
.with_file(true)
.with_level(true)
.with_line_number(true)
.with_thread_ids(true)
.with_max_level(LevelFilter::DEBUG)
.init();
let nacos_registry_url = Url::from_url("nacos://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=dubbo-demo-triple-api-provider&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=7015").unwrap();
let mut registry = NacosRegistry::new(nacos_registry_url);
let mut service_url = Url::from_url("tri://127.0.0.1:50052/org.apache.dubbo.demo.GreeterService?anyhost=true&application=dubbo-demo-triple-api-provider&background=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.GreeterService&methods=sayHello,sayHelloAsync&pid=7015&service-name-mapping=true&side=provider×tamp=1670060843807").unwrap();
service_url
.params
.insert(SIDE_KEY.to_owned(), PROVIDER_SIDE.to_owned());
let ret = registry.register(service_url);
info!("register result: {:?}", ret);
let subscribe_url = Url::from_url("provider://192.168.0.102:50052/org.apache.dubbo.demo.GreeterService?anyhost=true&application=dubbo-demo-triple-api-provider&background=false&bind.ip=192.168.0.102&bind.port=50052&category=configurators&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.GreeterService&ipv6=fd00:6cb1:58a2:8ddf:0:0:0:1000&methods=sayHello,sayHelloAsync&pid=44270&service-name-mapping=true&side=provider").unwrap();
let ret = registry.subscribe(subscribe_url, Arc::new(TestNotifyListener));
if let Err(e) = ret {
error!("error message: {:?}", e);
return;
}
let sleep_millis = time::Duration::from_secs(300);
thread::sleep(sleep_millis);
}