mercyblitz commented on issue #305: 现在dubbo已经支持REST,这个配置怎么时间跟进,同时发布RPC和REST服务那种#235 URL: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/305#issuecomment-445109338 You can export two protocols, please add those properties to your `application.properties`: ```properties dubbo.protocols.dubbo.name = dubbo dubbo.protocols.dubbo.port = 20880 dubbo.protocols.rest.name = rest dubbo.protocols.rest.port = 8080 ``` Then, declare above protocols on `@Service`: ```java @Service(protocols={"dubbo","rest"}) public class UserServiceImpl implement UserService { @GET @Path("{id : \\d+}") @Produces({MediaType.APPLICATION_JSON}) public User getUser(@PathParam("id") Long id) { // ... } } ``` `UserServiceImpl` will be exported "dubbo" and "rest" services for consumers.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
