因公司老系统和新系统过度期的临时调用,采用了dubbo同时提供dubbo和restful服务。
支持版本:dubbox 2.8.4
采用springboot框架
完整github代码:https://github.com/maweijun2015/dubbo-restful.git
pom文件
服务提供者
@Path("demo")
public interface DemoRestService {
@GET
@Path("test")
@Consumes({MediaType.APPLICATION_JSON,MediaType.TEXT_XML})
StringgetDemoMethod();
}
dubbo.xml
启动服务后,http://localhost:8888/demo/test 即可访问服务