mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
refactor dubbo examples & add datasource feature in example & update docs
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
@@ -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
|
Reference in New Issue
Block a user