dragon-zhang commented on code in PR #3505:
URL: https://github.com/apache/incubator-shenyu/pull/3505#discussion_r894193368
##########
shenyu-client/shenyu-client-grpc/src/main/java/org/apache/shenyu/client/grpc/GrpcClientBeanPostProcessor.java:
##########
@@ -125,7 +125,7 @@ private void handler(final Object serviceBean) {
LOG.error(String.format("grpc SERVICE_NAME can not found: %s",
classes));
return;
}
- ShenyuGrpcClient grpcClassAnnotation =
AnnotationUtils.findAnnotation(clazz, ShenyuGrpcClient.class);
+ ShenyuGrpcClient grpcClassAnnotation =
AnnotatedElementUtils.findMergedAnnotation(clazz, ShenyuGrpcClient.class);
Review Comment:
> I've dealt with it, take a look
you mean this ?
```java
Class<?> clazz;
try {
clazz = serviceBean.getClass();
} catch (Exception e) {
LOG.error("failed to get grpc target class", e);
return;
}
Class<?> parent = clazz.getSuperclass();
Class<?> classes = parent.getDeclaringClass();
String packageName;
try {
String serviceName = ShenyuClientConstants.SERVICE_NAME;
Field field = classes.getField(serviceName);
field.setAccessible(true);
packageName = field.get(null).toString();
} catch (Exception e) {
LOG.error(String.format("SERVICE_NAME field not found: %s",
classes), e);
return;
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]