Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【优化建议】CommonService的getBean方法可以优化一下 #26

Open
ligb888 opened this issue Nov 18, 2020 · 5 comments
Open

【优化建议】CommonService的getBean方法可以优化一下 #26

ligb888 opened this issue Nov 18, 2020 · 5 comments

Comments

@ligb888
Copy link

ligb888 commented Nov 18, 2020

现在只能按照class查找,可以改成按照类名查找。
因为我在尝试使用其他语言调用时,调用需要写全路径会比较麻烦

比如:

client.handle({
    serialize: 3,
    request: JSON.stringify({
        clazz: "com.kshb.test.common.service.Grpc2Service",
        method: "test",
        args: ["param 参数"]
    }).toBytes("utf-8")
}, function(err, response) {
    console.log(response.response.toString("utf-8"));
    client.close();
});
@AnoyiX
Copy link
Owner

AnoyiX commented Nov 18, 2020

如果有多个类,包不同,类名相同,那么如何解决这个冲突呢?

@ligb888
Copy link
Author

ligb888 commented Nov 18, 2020

如果有多个类,包不同,类名相同,那么如何解决这个冲突呢?

跟spring里一样,当有相同的名称启动就会报错

@ligb888
Copy link
Author

ligb888 commented Nov 18, 2020

如果有多个类,包不同,类名相同,那么如何解决这个冲突呢?

老板,这个写的挺棒的,啥时候再更新呀~
还有就是效率,连接池tls什么的很多可以开发的。哈哈哈

@AnoyiX
Copy link
Owner

AnoyiX commented Nov 18, 2020

可惜了,现在从事的工作很少用 Java 了,但是 grpc 会用,哈哈,得靠你们贡献了

@AnoyiX AnoyiX closed this as completed Sep 1, 2021
@AnoyiX AnoyiX reopened this Sep 1, 2021
@yangchangming
Copy link

我也是在服务端getbean这个地方卡住,无法通过接口的class找到对应的实现类实例(在spring容器中),跟踪了一下代码,是AbstractBeanFactory中 typeToMatch.isInstance(beanInstance)方法返回false导致,但是不知道为什么?都是按照样例代码配置的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants