You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2022. It is now read-only.
Hi @antergone, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.
We encourage you to describe your issue in English which is more friendly to other users.
The annotation is now processed in the ReferenceAnnotationBeanPostProcessor stage, which scans the annotation to create the RPC proxy object and puts it into the injection point by reflection. Ideas: 1. Can you provide a static class factory class (SofaRpcFactory) and a generic configuration file (SofaProperties) directly. The create method is provided in this factory, and various RPC initialization operations are performed internally, and the RPC dynamic proxy interface object is returned. TestFacade SofaRpcFactory.create(TestFacade.class, props). This can directly initialize the client to the black box in the RPC component, bind the lifecycle of the facade to the spring container, and the initialization phase no longer relies on annotations. Explicitly connect RPC and Spring with @Bean. This idea comes from the client-side construction process of Retrofit2: retrofit2.Retrofit#create 2. Provides EnableSofaRPC annotations, activates Registrar by importing, and uses Registrar with Scanner to scan and register beans. Here you can define a specification. Locally, there must be a Facade interface inheriting the Facade package of other services with the annotation of @SofaRpcClient, or the developer needs to give a list of classes calling Facade for the framework to scan. This idea comes from the practice of Spring Cloud FeignClient
现在注解是在ReferenceAnnotationBeanPostProcessor阶段处理,扫描注解创建RPC代理对象,并通过反射的方式放到了注入点。
想法:
TestFacade SofaRpcFactory.create(TestFacade.class, props)
。这样做可以直接将Client初始化完全黑盒在RPC组件内,将Facade的生命周期绑定到spring容器中去,初始化阶段不再依赖注解,显式的用
@Bean
将RPC和Spring连接起来。这个想法来源于Retrofit2的客户端构造过程:
retrofit2.Retrofit#create
@SofaRpcClient
注解,或者开发者需要给出一个调用Facade 的Class列表供框架扫描。这个想法来源于 Spring Cloud FeignClient的做法
The text was updated successfully, but these errors were encountered: