Home > Back-end >  DUBBO - REST protocols
DUBBO - REST protocols

Time:03-19

Springboot project can expose interfaces at the same time use the DUBBO DUBBO and rest

CodePudding user response:

1, pom. XML


Javax.mail. Ws. Rs
Javax.mail. Ws. Rs - api
2.1 & lt;/version>


Org. Jboss. Resteasy
Resteasy - jaxrs
3.6.0. Final


Org. Jboss. Resteasy
Resteasy - client
3.6.0. Final


Org. Jboss. Resteasy
Resteasy jaxb - provider
3.6.0. Final


Org. Jboss. Resteasy
Resteasy - Jackson - provider
3.6.0. Final


Org. Jboss. Resteasy
Jaxrs - api
3.0.12. Final


Org. Eclipse. Jetty
Jetty - server
9.4.19. V20190610 & lt;/version>


Org. Eclipse. Jetty
Jetty - servlet
9.4.19. V20190610 & lt;/version>


Org. Eclipse. Jetty
Jetty - http
9.4.26. V20200117 & lt;/version>


2, XxxServiceImpl. Java

@ Path (" hi ")
@ Consumes (" application/json ")
@ Produces (" application/json; Charset=utf-8 ")
@ Service
Public class XxxServiceImpl implements XxxService {
@ GET
@ Path (" getAbc ")
@ Override
Public ServiceResponseDTO GetAbc (@ QueryParam (" id ") int id) {
return null;
}
}

3, the service. The XML

4, with the postman test request
http://ip:port/hi/getAbc? Id=12345

CodePudding user response:

0, application. The properties

,,,,,,,

Dubbo. Separate protocols. Rest. Name=rest
Dubbo. Separate protocols. Rest. Id=rest
Dubbo. Separate protocols. Rest. Port=8888

Dubbo. Separate protocols. Dubbo. Name=dubbo
Dubbo. Separate protocols. Dubbo. Id=dubbo
Dubbo. Separate protocols. Dubbo. Port=9999

.
  • Related