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

dubbo 3.1.9升级dubbo 3.2.0,在使用REST中发现了几个问题 #12142

Closed
1 task
tell1014 opened this issue Apr 20, 2023 · 3 comments
Closed
1 task

dubbo 3.1.9升级dubbo 3.2.0,在使用REST中发现了几个问题 #12142

tell1014 opened this issue Apr 20, 2023 · 3 comments
Labels
type/bug Bugs to being fixed

Comments

@tell1014
Copy link

tell1014 commented Apr 20, 2023

  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.1.9 -> 3.2.0
  • dubbo-rpc-rest:3.1.9 -> 3.2.0
  • Operating System version: win11
  • Java version: java 8

Steps to reproduce this issue

接口定义如下:
`
@path("users")
@consumes({ContentType.APPLICATION_JSON_UTF_8})
@produces({MediaType.APPLICATION_JSON})
public interface UserService {

@GET
Response getUsers();

@POST
Response createUser(Object user);

@GET
@Path("{uid}")
Response getUserByUid(@PathParam("uid") String uid);

@DELETE
@Path("{uid}")
Response deleteUserByUid(@PathParam("uid") String uid);

}
`

以上使用dubbo发布为REST风格的服务(参见上面接口定义),把dubbo版本从3.1.9升级到3.2.0出现了几个问题,问题如下:
1、不能出现相同的URI而HTTP method不同,导致服务不能启动;
比如:GET http://127.0.0.1:8080/users 与 POST http://127.0.0.1:8080/users
GET http://127.0.0.1:8080/users/1 与 DELETE http://127.0.0.1:8080/users/1
3.2.0版本的启动报错内容在最底下。
注:这个问题在dubbo 3.1.9版本中并不会出现

2、在dubbo 3.2.0中一个URI无论用什么HTTP method请求都可以成功;
在接口定义的方法中中使用@get注解,使用GET还是其他HTTP方法都可以正常访问且HTTP响应状态为200
注:这个问题在dubbo 3.1.9版本中使用非注解的HTTP方法请求会得到HTTP status为405(Method Not Allowed)

3、同样是javax.ws.rs.core.Response返回类型,但3.1.9和3.2.0版本在HTTP body中的内容不相同;
在下面的实现中:
public Response getUsers() {
HashMap<String, Object> map = new HashMap<>();
map.put("code", 10000);
map.put("msg", "ok~~~");
return Response.serverError().entity(map).build();
}

使用3.1.9版本的HTTP body为
{
"msg": "ok~~~",
"code": 10000
}

使用3.2.0版本的HTTP body为
{
"allowedMethods": [ ],
"closed": false,
"cookies": { },
-"entity": {
"msg": "ok~~~",
"code": 10000
},
"entityClass": "java.util.HashMap",
"headers": { },
"length": -1,
"links": [ ],
"metadata": { },
"reasonPhrase": "Internal Server Error",
"status": 500,
"statusInfo": "INTERNAL_SERVER_ERROR",
"stringHeaders": { }
}

在dubbo-rpc-rest 3.1.9版本中依赖的是jboss-jaxrs-api_2.0_spec而在dubbo-rpc-rest 3.2.0中依赖的是jboss-jaxrs-api_2.1_spec,在3.1.9中直接返回entity而3.2.0返回Response,造成这种差异的原因不知道是dubbo方面的原因还是jaxrs-api的原因,又或者项目配置的问题呢?

3.2.0版本启动报错:
Exception in thread "main" java.lang.IllegalArgumentException: dubbo rest metadata resolve double path error,and contain path variable is: PathMatcher{path='/users/{uid}', version='null', group='null', port=null, hasPathVariable=true, contextPath='null'}, rest method metadata is: RestMethodMetadata{method=MethodDefinition [name=getUserByUid, parameterTypes=[java.lang.String], returnType=javax.ws.rs.core.Response], request=RequestMetadata{method='GET', path='/users/{uid}', params={}, headers={}, consumes=[application/json; charset=UTF-8], produces=[application/json]}, urlIndex=null, bodyIndex=null, headerMapIndex=null, bodyType='null', indexToName=null, formParams=null, indexToEncoded=null, argInfos=[ArgInfo{index=0, annotationNameAttribute='uid', paramAnnotationType=interface javax.ws.rs.PathParam, paramType=class java.lang.String, paramName='arg0', urlSplitIndex=2, defaultValue={0}, formContentType=false}], reflectMethod=public abstract javax.ws.rs.core.Response com.mydomain.test.service.UserService.getUserByUid(java.lang.String), codeStyle=class org.apache.dubbo.metadata.rest.jaxrs.JAXRSServiceRestMetadataResolver} at org.apache.dubbo.metadata.rest.ServiceRestMetadata.doublePathCheck(ServiceRestMetadata.java:144) at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addPathToServiceMap(ServiceRestMetadata.java:131) at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addRestMethodMetadata(ServiceRestMetadata.java:114) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processRestMethodMetadata(AbstractServiceRestMetadataResolver.java:292) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processAllRestMethodMetadata(AbstractServiceRestMetadataResolver.java:156) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.resolve(AbstractServiceRestMetadataResolver.java:118) at org.apache.dubbo.rpc.protocol.rest.annotation.metadata.MetadataResolver.resolveProviderServiceMetadata(MetadataResolver.java:63) at org.apache.dubbo.rpc.protocol.rest.RestProtocol.export(RestProtocol.java:88) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:73) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$3(RegistryProtocol.java:305) at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:303) at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:249) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:66) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:58) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:748) at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:726) at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:667) at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:459) at org.apache.dubbo.config.ServiceConfig.lambda$doExportUrls$5(ServiceConfig.java:438) at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:95) at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:62) at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:427) at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:398) at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:250) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:363) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:335) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:161) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:142) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85) at com.mydomain.test.app.Application.main(Application.java:10)

@tell1014 tell1014 added the type/bug Bugs to being fixed label Apr 20, 2023
@AlbumenJ
Copy link
Member

@suncairong163 PTAL

@jojocodeX
Copy link
Contributor

  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.1.9 -> 3.2.0
  • dubbo-rpc-rest:3.1.9 -> 3.2.0
  • Operating System version: win11
  • Java version: java 8

Steps to reproduce this issue

接口定义如下: ` @path("users") @consumes({ContentType.APPLICATION_JSON_UTF_8}) @produces({MediaType.APPLICATION_JSON}) public interface UserService {

@GET
Response getUsers();

@POST
Response createUser(Object user);

@GET
@Path("{uid}")
Response getUserByUid(@PathParam("uid") String uid);

@DELETE
@Path("{uid}")
Response deleteUserByUid(@PathParam("uid") String uid);

} `

以上使用dubbo发布为REST风格的服务(参见上面接口定义),把dubbo版本从3.1.9升级到3.2.0出现了几个问题,问题如下: 1、不能出现相同的URI而HTTP method不同,导致服务不能启动; 比如:GET http://127.0.0.1:8080/users 与 POST http://127.0.0.1:8080/users GET http://127.0.0.1:8080/users/1 与 DELETE http://127.0.0.1:8080/users/1 3.2.0版本的启动报错内容在最底下。 注:这个问题在dubbo 3.1.9版本中并不会出现

2、在dubbo 3.2.0中一个URI无论用什么HTTP method请求都可以成功; 在接口定义的方法中中使用@get注解,使用GET还是其他HTTP方法都可以正常访问且HTTP响应状态为200 注:这个问题在dubbo 3.1.9版本中使用非注解的HTTP方法请求会得到HTTP status为405(Method Not Allowed)

3、同样是javax.ws.rs.core.Response返回类型,但3.1.9和3.2.0版本在HTTP body中的内容不相同; 在下面的实现中: public Response getUsers() { HashMap<String, Object> map = new HashMap<>(); map.put("code", 10000); map.put("msg", "ok~~~"); return Response.serverError().entity(map).build(); }

使用3.1.9版本的HTTP body为 { "msg": "ok~~~", "code": 10000 }

使用3.2.0版本的HTTP body为 { "allowedMethods": [ ], "closed": false, "cookies": { }, -"entity": { "msg": "ok~~~", "code": 10000 }, "entityClass": "java.util.HashMap", "headers": { }, "length": -1, "links": [ ], "metadata": { }, "reasonPhrase": "Internal Server Error", "status": 500, "statusInfo": "INTERNAL_SERVER_ERROR", "stringHeaders": { } }

在dubbo-rpc-rest 3.1.9版本中依赖的是jboss-jaxrs-api_2.0_spec而在dubbo-rpc-rest 3.2.0中依赖的是jboss-jaxrs-api_2.1_spec,在3.1.9中直接返回entity而3.2.0返回Response,造成这种差异的原因不知道是dubbo方面的原因还是jaxrs-api的原因,又或者项目配置的问题呢?

3.2.0版本启动报错: Exception in thread "main" java.lang.IllegalArgumentException: dubbo rest metadata resolve double path error,and contain path variable is: PathMatcher{path='/users/{uid}', version='null', group='null', port=null, hasPathVariable=true, contextPath='null'}, rest method metadata is: RestMethodMetadata{method=MethodDefinition [name=getUserByUid, parameterTypes=[java.lang.String], returnType=javax.ws.rs.core.Response], request=RequestMetadata{method='GET', path='/users/{uid}', params={}, headers={}, consumes=[application/json; charset=UTF-8], produces=[application/json]}, urlIndex=null, bodyIndex=null, headerMapIndex=null, bodyType='null', indexToName=null, formParams=null, indexToEncoded=null, argInfos=[ArgInfo{index=0, annotationNameAttribute='uid', paramAnnotationType=interface javax.ws.rs.PathParam, paramType=class java.lang.String, paramName='arg0', urlSplitIndex=2, defaultValue={0}, formContentType=false}], reflectMethod=public abstract javax.ws.rs.core.Response com.mydomain.test.service.UserService.getUserByUid(java.lang.String), codeStyle=class org.apache.dubbo.metadata.rest.jaxrs.JAXRSServiceRestMetadataResolver} at org.apache.dubbo.metadata.rest.ServiceRestMetadata.doublePathCheck(ServiceRestMetadata.java:144) at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addPathToServiceMap(ServiceRestMetadata.java:131) at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addRestMethodMetadata(ServiceRestMetadata.java:114) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processRestMethodMetadata(AbstractServiceRestMetadataResolver.java:292) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processAllRestMethodMetadata(AbstractServiceRestMetadataResolver.java:156) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.resolve(AbstractServiceRestMetadataResolver.java:118) at org.apache.dubbo.rpc.protocol.rest.annotation.metadata.MetadataResolver.resolveProviderServiceMetadata(MetadataResolver.java:63) at org.apache.dubbo.rpc.protocol.rest.RestProtocol.export(RestProtocol.java:88) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:73) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$3(RegistryProtocol.java:305) at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:303) at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:249) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:66) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:58) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:748) at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:726) at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:667) at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:459) at org.apache.dubbo.config.ServiceConfig.lambda$doExportUrls$5(ServiceConfig.java:438) at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:95) at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:62) at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:427) at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:398) at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:250) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:363) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:335) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:161) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:142) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85) at com.mydomain.test.app.Application.main(Application.java:10)

声明返回Respons这种模式,客户端是通过服务发现的机制,基于 consumer 的方式调用,还是直接端项目通过http?

@tell1014
Copy link
Author

tell1014 commented May 7, 2023

  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.1.9 -> 3.2.0
  • dubbo-rpc-rest:3.1.9 -> 3.2.0
  • Operating System version: win11
  • Java version: java 8

Steps to reproduce this issue

接口定义如下: ` @path("users") @consumes({ContentType.APPLICATION_JSON_UTF_8}) @produces({MediaType.APPLICATION_JSON}) public interface UserService {

@GET
Response getUsers();

@POST
Response createUser(Object user);

@GET
@Path("{uid}")
Response getUserByUid(@PathParam("uid") String uid);

@DELETE
@Path("{uid}")
Response deleteUserByUid(@PathParam("uid") String uid);

} 以上使用dubbo发布为REST风格的服务(参见上面接口定义),把dubbo版本从3.1.9升级到3.2.0出现了几个问题,问题如下: 1、不能出现相同的URI而HTTP method不同,导致服务不能启动; 比如:GET http://127.0.0.1:8080/users 与 POST http://127.0.0.1:8080/users GET http://127.0.0.1:8080/users/1 与 DELETE http://127.0.0.1:8080/users/1 3.2.0版本的启动报错内容在最底下。 注:这个问题在dubbo 3.1.9版本中并不会出现 2、在dubbo 3.2.0中一个URI无论用什么HTTP method请求都可以成功; 在接口定义的方法中中使用@get注解,使用GET还是其他HTTP方法都可以正常访问且HTTP响应状态为200 注:这个问题在dubbo 3.1.9版本中使用非注解的HTTP方法请求会得到HTTP status为405(Method Not Allowed) 3、同样是javax.ws.rs.core.Response返回类型,但3.1.9和3.2.0版本在HTTP body中的内容不相同; 在下面的实现中: public Response getUsers() { HashMap<String, Object> map = new HashMap<>(); map.put("code", 10000); map.put("msg", "ok~~~"); return Response.serverError().entity(map).build(); } 使用3.1.9版本的HTTP body为 { "msg": "ok~~~", "code": 10000 } 使用3.2.0版本的HTTP body为 { "allowedMethods": [ ], "closed": false, "cookies": { }, -"entity": { "msg": "ok~~~", "code": 10000 }, "entityClass": "java.util.HashMap", "headers": { }, "length": -1, "links": [ ], "metadata": { }, "reasonPhrase": "Internal Server Error", "status": 500, "statusInfo": "INTERNAL_SERVER_ERROR", "stringHeaders": { } } 在dubbo-rpc-rest 3.1.9版本中依赖的是jboss-jaxrs-api_2.0_spec而在dubbo-rpc-rest 3.2.0中依赖的是jboss-jaxrs-api_2.1_spec,在3.1.9中直接返回entity而3.2.0返回Response,造成这种差异的原因不知道是dubbo方面的原因还是jaxrs-api的原因,又或者项目配置的问题呢? 3.2.0版本启动报错:Exception in thread "main" java.lang.IllegalArgumentException: dubbo rest metadata resolve double path error,and contain path variable is: PathMatcher{path='/users/{uid}', version='null', group='null', port=null, hasPathVariable=true, contextPath='null'}, rest method metadata is: RestMethodMetadata{method=MethodDefinition [name=getUserByUid, parameterTypes=[java.lang.String], returnType=javax.ws.rs.core.Response], request=RequestMetadata{method='GET', path='/users/{uid}', params={}, headers={}, consumes=[application/json; charset=UTF-8], produces=[application/json]}, urlIndex=null, bodyIndex=null, headerMapIndex=null, bodyType='null', indexToName=null, formParams=null, indexToEncoded=null, argInfos=[ArgInfo{index=0, annotationNameAttribute='uid', paramAnnotationType=interface javax.ws.rs.PathParam, paramType=class java.lang.String, paramName='arg0', urlSplitIndex=2, defaultValue={0}, formContentType=false}], reflectMethod=public abstract javax.ws.rs.core.Response com.mydomain.test.service.UserService.getUserByUid(java.lang.String), codeStyle=class org.apache.dubbo.metadata.rest.jaxrs.JAXRSServiceRestMetadataResolver} at org.apache.dubbo.metadata.rest.ServiceRestMetadata.doublePathCheck(ServiceRestMetadata.java:144) at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addPathToServiceMap(ServiceRestMetadata.java:131) at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addRestMethodMetadata(ServiceRestMetadata.java:114) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processRestMethodMetadata(AbstractServiceRestMetadataResolver.java:292) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processAllRestMethodMetadata(AbstractServiceRestMetadataResolver.java:156) at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.resolve(AbstractServiceRestMetadataResolver.java:118) at org.apache.dubbo.rpc.protocol.rest.annotation.metadata.MetadataResolver.resolveProviderServiceMetadata(MetadataResolver.java:63) at org.apache.dubbo.rpc.protocol.rest.RestProtocol.export(RestProtocol.java:88) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:73) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$3(RegistryProtocol.java:305) at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:303) at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:249) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:66) at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:58) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:748) at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:726) at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:667) at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:459) at org.apache.dubbo.config.ServiceConfig.lambda$doExportUrls$5(ServiceConfig.java:438) at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:95) at org.apache.dubbo.metrics.event.MetricsEventBus.post(MetricsEventBus.java:62) at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:427) at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:398) at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:250) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:363) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:335) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:161) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:142) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:144) at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:85) at com.mydomain.test.app.Application.main(Application.java:10)`

声明返回Respons这种模式,客户端是通过服务发现的机制,基于 consumer 的方式调用,还是直接端项目通过http?

直接通过前端项目HTTP的,为了发布RESTful API的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

4 participants