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

Spring Web MVC support for Dubbo Service Provider #22

Open
mercyblitz opened this issue Jun 8, 2018 · 0 comments
Open

Spring Web MVC support for Dubbo Service Provider #22

mercyblitz opened this issue Jun 8, 2018 · 0 comments

Comments

@mercyblitz
Copy link
Owner

Adding support for Dubbo's Service Provider in Spring Web MVC application without any @Controller.

Service Provider demo code :

@Service(
        version = "${demo.service.version}",
        application = "${dubbo.application.id}",
        protocol = "${dubbo.protocol.id}",
        registry = "${dubbo.registry.id}"
)
@RestService
public class DefaultDemoService implements DemoService {

    @RequestMapping("/say-hello")
    public String sayHello(String name) {
        return "Hello, " + name + " (from Spring Boot)";
    }

}

@RestService that is a meta-annotation declares current Dubbo's service exporting HTTP REST under Spring WebMVC, and it's required enabled by @EnableRestService in your @Configuration class , as follow:

@EnableRestService
public class WebMvcConfiguration {
}
mercyblitz added a commit that referenced this issue Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant