1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

add dubbo example in springboot 1.x and fix some typo

This commit is contained in:
fangjian0423
2018-09-06 21:10:02 +08:00
parent 4600f42647
commit a50079bd75
17 changed files with 684 additions and 8 deletions

View File

@@ -0,0 +1,15 @@
package org.springframework.cloud.alibaba.cloud.examples;
import com.alibaba.dubbo.config.annotation.Service;
/**
* @author fangjian
*/
@Service(version = "${foo.service.version}", application = "${dubbo.application.id}", protocol = "${dubbo.protocol.id}", registry = "${dubbo.registry.id}")
public class FooServiceImpl implements FooService {
@Override
public String hello(String name) {
return "hello, " + name;
}
}

View File

@@ -0,0 +1,19 @@
package org.springframework.cloud.alibaba.cloud.examples;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
/**
* @author fangjian
*/
@SpringBootApplication
public class SentinelDubboProviderApp {
public static void main(String[] args) {
SpringApplicationBuilder providerBuilder = new SpringApplicationBuilder();
providerBuilder.web(WebApplicationType.NONE)
.sources(SentinelDubboProviderApp.class).run(args);
}
}

View File

@@ -0,0 +1,16 @@
spring.application.name = dubbo-provider-demo
foo.service.version = 1.0.0
dubbo.scan.basePackages = org.springframework.cloud.alibaba.cloud.examples
dubbo.application.id = dubbo-provider-demo
dubbo.application.name = dubbo-provider-demo
dubbo.protocol.id = dubbo
dubbo.protocol.name = dubbo
dubbo.protocol.port = 12345
dubbo.protocol.status = server
dubbo.registry.id = my-registry
dubbo.registry.address = N/A