You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "namelessssssssssss (via GitHub)" <gi...@apache.org> on 2023/03/30 08:27:39 UTC
[GitHub] [dubbo] namelessssssssssss opened a new issue, #11970: Update dubbo-demo-api
namelessssssssssss opened a new issue, #11970:
URL: https://github.com/apache/dubbo/issues/11970
在dubbo-demo-api-consumer中, `runWithRefer()` 使用了过时的api : `reference.setApplication` 和 `reference.setMetadataReportConfig` :
```java
private static void runWithRefer() {
ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
reference.setApplication(new ApplicationConfig("dubbo-demo-api-consumer"));
reference.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
reference.setMetadataReportConfig(new MetadataReportConfig("zookeeper://127.0.0.1:2181"));
reference.setInterface(DemoService.class);
DemoService service = reference.get();
String message = service.sayHello("dubbo");
System.out.println(message);
}
```
以上问题在 dubbo-demo-api-provider 和 dubbo-demo-native 中同样存在。
是否有必要将其更新为最新的配置方法,如:
```java
private static void runWithRefer() {
FrameworkModel frameworkModel = new FrameworkModel();
ApplicationModel applicationModel = frameworkModel.newApplication();
applicationModel.setModelName("dubbo-demo-api-consumer");
ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
reference.setScopeModel(applicationModel);
reference.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
ConfigManager configManager = new ConfigManager(applicationModel);
configManager.addMetadataReport(new MetadataReportConfig("zookeeper://127.0.0.1:2181"));
reference.setInterface(DemoService.class);
DemoService service = reference.get();
String message = service.sayHello("dubbo");
System.out.println(message);
}
```
这样也可以更好展示Dubbo的配置模型。
If necessary, please assign to me.
--
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.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
[GitHub] [dubbo] namelessssssssssss closed issue #11970: Update dubbo-demo-api
Posted by "namelessssssssssss (via GitHub)" <gi...@apache.org>.
namelessssssssssss closed issue #11970: Update dubbo-demo-api
URL: https://github.com/apache/dubbo/issues/11970
--
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
[GitHub] [dubbo] MieAh commented on issue #11970: Update dubbo-demo-api
Posted by "MieAh (via GitHub)" <gi...@apache.org>.
MieAh commented on issue #11970:
URL: https://github.com/apache/dubbo/issues/11970#issuecomment-1489959166
You can sumbit a pr to optimize it.
--
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