MaiSR9527 opened a new issue, #4512:
URL: https://github.com/apache/shenyu/issues/4512
### Question
My config application yml. I use http register type. I do not want to add
`@ShenyuSpringMvcClient` on each controller method, so I try to use isFull. But
meta data is not registered.
```
shenyu:
register:
registerType: http
serverLists: http://localhost:9095
props:
username: admin
password: 123456
client:
http:
props:
contextPath: /user
appName: user
isFull: true
```
log `registerMetaData` is false
```
metadata client register success:
{"appName":"user","contextPath":"/user","path":"/user/","rpcType":"http","ruleName":"/user","enabled":true,"pluginNames":[],"registerMetaData":false,"timeMillis":1680074943806,"addPrefixed":false}
```
`org.apache.shenyu.client.springmvc.init.SpringMvcClientEventListener#getBeans`
don't set registerMetaData, default is false
```
@Override
protected Map<String, Object> getBeans(final ApplicationContext context)
{
// Filter out
if (Boolean.TRUE.equals(isFull)) {
getPublisher().publishEvent(MetaDataRegisterDTO.builder()
.contextPath(getContextPath())
.addPrefixed(addPrefixed)
.appName(getAppName())
.path(PathUtils.decoratorPathWithSlash(getContextPath()))
.rpcType(RpcTypeEnum.HTTP.getName())
.enabled(true)
.ruleName(getContextPath())
.build());
return null;
}
return context.getBeansWithAnnotation(Controller.class);
}
```
In
`org.apache.shenyu.admin.service.register.ShenyuClientRegisterDivideServiceImpl#registerMetadata`
```
protected void registerMetadata(final MetaDataRegisterDTO dto) {
if (dto.isRegisterMetaData()) {
MetaDataService metaDataService = getMetaDataService();
MetaDataDO exist = metaDataService.findByPath(dto.getPath());
metaDataService.saveOrUpdateMetaData(exist, dto);
}
}
```
I use ShenYu 2.5.1.
So http register type do not support isFull ?????????????
--
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]