shenyu
shenyu copied to clipboard
[Question] some code is not used in shenyu-client-dubbo?
Question
- org.apache.shenyu.client.apache.dubbo.ApacheDubboServiceBeanListener
public ApacheDubboServiceBeanListener(final PropertiesConfig clientConfig, final ShenyuClientRegisterRepository shenyuClientRegisterRepository) {
Properties props = clientConfig.getProps();
String contextPath = props.getProperty(ShenyuClientConstants.CONTEXT_PATH);
String appName = props.getProperty(ShenyuClientConstants.APP_NAME);
if (StringUtils.isBlank(contextPath)) {
throw new ShenyuClientIllegalArgumentException("apache dubbo client must config the contextPath or appName");
}
this.contextPath = contextPath;
this.appName = appName;
this.host = props.getProperty(ShenyuClientConstants.HOST);
this.port = props.getProperty(ShenyuClientConstants.PORT);
executorService = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("shenyu-apache-dubbo-client-thread-pool-%d").build());
publisher.start(shenyuClientRegisterRepository);
}
A thread pool(executorService ) was created in the constructor, but not used. Is it possible to delete it?
- ShenyuDubboClient Does ShenyuDubboClient only work on methods and not on classes? The current definitions are as follows:
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Inherited
public @interface ShenyuDubboClient {
/**
* Path string.
*
* @return the string
*/
String path();
/**
* Rule name string.
*
* @return the string
*/
String ruleName() default "";
/**
* Desc string.
*
* @return String string
*/
String desc() default "";
/**
* Enabled boolean.
*
* @return the boolean
*/
boolean enabled() default true;
}
Shouldn't we change @Target({ElementType.TYPE, ElementType.METHOD})
to @Target({ElementType.METHOD})
?
I think we should add the logic of annotation on the splicing class. Guys,what do you think ?
------------------ 原始邮件 ------------------ 发件人: "apache/incubator-shenyu" @.>; 发送时间: 2022年4月25日(星期一) 上午10:08 @.>; @.***>; 主题: [apache/incubator-shenyu] [Question] some code is not used in shenyu-client-dubbo? (Issue #3317)
Question
org.apache.shenyu.client.apache.dubbo.ApacheDubboServiceBeanListener public ApacheDubboServiceBeanListener(final PropertiesConfig clientConfig, final ShenyuClientRegisterRepository shenyuClientRegisterRepository) { Properties props = clientConfig.getProps(); String contextPath = props.getProperty(ShenyuClientConstants.CONTEXT_PATH); String appName = props.getProperty(ShenyuClientConstants.APP_NAME); if (StringUtils.isBlank(contextPath)) { throw new ShenyuClientIllegalArgumentException("apache dubbo client must config the contextPath or appName"); } this.contextPath = contextPath; this.appName = appName; this.host = props.getProperty(ShenyuClientConstants.HOST); this.port = props.getProperty(ShenyuClientConstants.PORT); executorService = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("shenyu-apache-dubbo-client-thread-pool-%d").build()); publisher.start(shenyuClientRegisterRepository); }
A thread pool(executorService ) was created in the constructor, but not used. Is it possible to delete it?
ShenyuDubboClient Does ShenyuDubboClient only work on methods and not on classes? The current definitions are as follows: @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD}) @Inherited public @interface ShenyuDubboClient { /** * Path string. * * @return the string / String path(); /* * Rule name string. * * @return the string / String ruleName() default ""; /* * Desc string. * * @return String string / String desc() default ""; /* * Enabled boolean. * * @return the boolean */ boolean enabled() default true; }
Shouldn't we change @Target({ElementType.TYPE, ElementType.METHOD}) to @Target({ElementType.METHOD})?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
yes, I think so.
yes, I think so.
How about publishing tasks and asking friends in the community to help?
I checked the TarsServiceBeanPostProcessor
and GrpcClientBeanPostProcessor
and found that maybe all RPC client
has this bug.
yes, I think so.
How about publishing tasks and asking friends in the community to help?
It's ok
I checked the
TarsServiceBeanPostProcessor
andGrpcClientBeanPostProcessor
and found that maybeall RPC client
has this bug.
good job