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

Add Nacos Samples #489

Merged
merged 63 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
1494a77
Fix apache/incubator-dubbo-spring-boot-project#169
mercyblitz Jun 8, 2018
0efa7c9
Merge remote-tracking branch 'upstream/master'
mercyblitz Jun 8, 2018
58e2c91
correct some wrongly written chinese characters in the README_CN.md
feichangxinfu Oct 30, 2018
531debd
Merge remote-tracking branch 'upstream/master'
mercyblitz Dec 7, 2018
d01cf26
0.2.1 (#345)
mercyblitz Dec 27, 2018
7021e60
0.2.1 (#346)
mercyblitz Dec 27, 2018
4cadcb6
0.2.1 (#357)
mercyblitz Jan 7, 2019
b5957e5
Remove dubbo-spring-boot-sample-consumer
mercyblitz Jan 7, 2019
dae4913
0.2.1 (#360)
mercyblitz Jan 8, 2019
4530413
Merge branch 'master' into 0.2.1
mercyblitz Jan 8, 2019
84ae184
0.2.1 (#367)
mercyblitz Jan 9, 2019
7ada763
0.2.1 (#372) (#374)
mercyblitz Jan 9, 2019
64095bc
0.2.1 (#378)
mercyblitz Jan 9, 2019
79e9fa8
0.2.1 (#389)
mercyblitz Jan 14, 2019
ef626c8
Merge branch 'master' into 0.2.1-release
mercyblitz Jan 21, 2019
0f93efb
Merge remote-tracking branch 'upstream/master'
mercyblitz Jan 24, 2019
ac98c7b
Remove spring.providers file from starter module (#403) (#404)
zhiwsun Jan 25, 2019
d7ff623
add @Override annotation (#409)
viviennes7 Jan 25, 2019
a02d6f1
to method reference (#410)
viviennes7 Jan 25, 2019
e8f6b8f
Update README.md
mercyblitz Jan 27, 2019
5adb2d8
Update README_CN.md
mercyblitz Jan 27, 2019
b03d006
Update README_CN.md
mercyblitz Jan 27, 2019
9f5024d
Update README.md
mercyblitz Jan 27, 2019
859b7ce
Merge branch '0.2.x' into master
mercyblitz Jan 27, 2019
73ad6b9
Sync master to 0.2.x (#417)
mercyblitz Jan 27, 2019
30154b5
Update README.md
mercyblitz Jan 28, 2019
c98f371
Update README_CN.md
mercyblitz Jan 28, 2019
d89ef99
Replace ${project.version} to ${revision} in the "pom.xml" files
mercyblitz Jan 29, 2019
3de5a51
Update <projectId>
mercyblitz Jan 29, 2019
2dc44c9
Update README.md
mercyblitz Jan 29, 2019
b77a096
Update README_CN.md
mercyblitz Jan 29, 2019
c539646
Merge branch 'master' into 0.2.x
mercyblitz Jan 30, 2019
9729fa6
0.2.x (#422)
mercyblitz Jan 30, 2019
7d102eb
Merge remote-tracking branch 'upstream/master'
mercyblitz Jan 30, 2019
1fea772
Merge remote-tracking branch 'upstream/0.2.x'
mercyblitz Jan 30, 2019
a67a728
2.7.0 release (#436)
mercyblitz Feb 1, 2019
3797561
Merge remote-tracking branch 'upstream/master'
mercyblitz Feb 25, 2019
033421d
Polish apache/incubator-dubbo-spring-boot-project#449
mercyblitz Feb 25, 2019
fa4c06a
Polish apache/incubator-dubbo-spring-boot-project#467 : Set "spring.m…
mercyblitz Mar 19, 2019
f705e64
Polish apache/incubator-dubbo-spring-boot-project#468 : Upgrade Dubbo…
mercyblitz Mar 19, 2019
a18ed48
Polish apache/incubator-dubbo-spring-boot-project#437 : Remove -XX:Pe…
mercyblitz Mar 19, 2019
63d54c1
Fix the issues of test cases
mercyblitz Mar 19, 2019
367d707
Update Samples
mercyblitz Mar 19, 2019
31c6771
Update default version using Dubbo's version
mercyblitz Mar 19, 2019
4c5d205
Polish apache/incubator-dubbo-spring-boot-project#456 : Update the Zo…
mercyblitz Mar 19, 2019
49aef0b
Polish apache/incubator-dubbo-spring-boot-project#458 : dubbo.metadat…
mercyblitz Mar 20, 2019
9429525
Polish apache/incubator-dubbo-spring-boot-project#458 : dubbo.metadat…
mercyblitz Mar 20, 2019
a5815ea
Update 2.7.1
mercyblitz Mar 20, 2019
7bc44d2
Polish apache/incubator-dubbo-spring-boot-project#458 : Add "override…
mercyblitz Mar 20, 2019
709d411
Merge branch 'master' into incubator-dubbo-spring-boot-project-branch
mercyblitz Mar 20, 2019
a14cd34
Merge pull request #1 from feichangxinfu/incubator-dubbo-spring-boot-…
mercyblitz Mar 20, 2019
7e0816c
Polish apache/incubator-dubbo-spring-boot-project#451 : Duplicate app…
mercyblitz Mar 20, 2019
fda8aca
Bugfix
mercyblitz Mar 20, 2019
25f0b03
Update SNAPSHOT
mercyblitz Mar 20, 2019
a39ea23
2.7.x (#470)
mercyblitz Mar 20, 2019
006cadc
Update 2.7.1
mercyblitz Mar 27, 2019
bf928e2
Merge branch '2.7.x' into 2.7.x
mercyblitz Mar 27, 2019
af590e9
Remove uesless files in source code distribution.
mercyblitz Mar 28, 2019
eb10705
Merge remote-tracking branch 'origin/2.7.x' into 2.7.x
mercyblitz Mar 28, 2019
4014a9c
Merge pull request #4 from mercyblitz/2.7.x
mercyblitz Apr 11, 2019
a4f21f0
Polish apache/incubator-dubbo-spring-boot-project#488
mercyblitz Apr 11, 2019
2c7b890
Update ASF License
mercyblitz Apr 11, 2019
98bcc53
Merge branch 'master' into master
mercyblitz Apr 11, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Dubbo Spring Boot 采用多 Maven 模块工程 , 模块如下:
[dubbo-spring-boot-actuator](dubbo-spring-boot-actuator) 提供 Production-Ready 特性:

* [健康检查](dubbo-spring-boot-actuator#health-checks)
* [控制断点](dubbo-spring-boot-actuator#endpoints)
* [控制端点](dubbo-spring-boot-actuator#endpoints)
* [外部化配置](dubbo-spring-boot-actuator#externalized-configuration)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dubbo-spring-boot-registry-nacos-samples</artifactId>
<groupId>org.apache.dubbo.samples</groupId>
<version>2.7.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>dubbo-spring-boot-registry-nacos-consumer-sample</artifactId>
<name>Apache Dubbo Spring Boot :: Samples : Registry Nacos :: Consumer Sample</name>

<properties>
<nacos.version>1.0.0-RC3</nacos.version>
</properties>

<dependencies>
<!-- Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${revision}</version>
</dependency>

<!-- Dubbo -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>

<!-- Dubbo Registry Nacos -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
<version>${revision}</version>
</dependency>

<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>${nacos.version}</version>
</dependency>

<dependency>
<groupId>org.apache.dubbo.samples</groupId>
<artifactId>dubbo-spring-boot-sample-api</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.spring.boot.demo.consumer.bootstrap;

import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.spring.boot.demo.consumer.DemoService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
* Dubbo Registry ZooKeeper Nacos Bootstrap
*/
@EnableAutoConfiguration
public class DubboRegistryNacosConsumerBootstrap {

private final Logger logger = LoggerFactory.getLogger(getClass());

@Reference(version = "${demo.service.version}")
private DemoService demoService;

public static void main(String[] args) {
SpringApplication.run(DubboRegistryNacosConsumerBootstrap.class).close();
}

@Bean
public ApplicationRunner runner() {
return args -> logger.info(demoService.sayHello("mercyblitz"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spring:
application:
name: dubbo-registry-nacos-consumer-sample

demo:
service:
version: 1.0.0

nacos:
host: 127.0.0.1
port: 8848

dubbo:
registry:
address: nacos://${nacos.host}:${nacos.port}
41 changes: 41 additions & 0 deletions dubbo-spring-boot-samples/dubbo-registry-nacos-samples/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dubbo-spring-boot-samples</artifactId>
<groupId>org.apache.dubbo.samples</groupId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>

<artifactId>dubbo-spring-boot-registry-nacos-samples</artifactId>
<name>Apache Dubbo Spring Boot :: Samples : Registry Nacos</name>
<description>Apache Dubbo Spring Boot Registry Nacos Samples</description>
<packaging>pom</packaging>


<modules>
<module>provider-sample</module>
<module>consumer-sample</module>
</modules>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.dubbo.samples</groupId>
<artifactId>dubbo-spring-boot-registry-nacos-samples</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>dubbo-spring-boot-registry-nacos-provider-sample</artifactId>
<name>Apache Dubbo Spring Boot :: Samples : Registry Nacos :: Provider Sample</name>

<properties>
<nacos.version>1.0.0-RC3</nacos.version>
</properties>

<dependencies>
<!-- Spring Boot dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${revision}</version>
</dependency>

<!-- Dubbo -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>

<!-- Dubbo Registry Nacos -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
<version>${revision}</version>
</dependency>

<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>${nacos.version}</version>
</dependency>

<dependency>
<groupId>org.apache.dubbo.samples</groupId>
<artifactId>dubbo-spring-boot-sample-api</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.spring.boot.demo.provider.bootstrap;

import org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;

/**
* Dubbo Registry Nacos Provider Bootstrap
*
* @see DefaultDemoService
* @since 2.7.0
*/
@EnableAutoConfiguration
public class DubboRegistryNacosProviderBootstrap {

public static void main(String[] args) {
new SpringApplicationBuilder(DubboRegistryNacosProviderBootstrap.class)
.run(args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dubbo.spring.boot.demo.provider.service;

import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.spring.boot.demo.consumer.DemoService;

import org.springframework.beans.factory.annotation.Value;

/**
* Default {@link DemoService}
*
* @see DemoService
* @since 2.7.0
*/
@Service(version = "${demo.service.version}")
public class DefaultDemoService implements DemoService {

/**
* The default value of ${dubbo.application.name} is ${spring.application.name}
*/
@Value("${dubbo.application.name}")
private String serviceName;

@Override
public String sayHello(String name) {
return String.format("[%s] : Hello, %s", serviceName, name);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Spring boot application
spring.application.name=dubbo-registry-nacos-provider-sample
# Base packages to scan Dubbo Component: @org.apache.dubbo.config.annotation.Service
dubbo.scan.base-packages=org.apache.dubbo.spring.boot.demo.provider.service

# Dubbo Application
## The default value of dubbo.application.name is ${spring.application.name}
## dubbo.application.name=${spring.application.name}
nacos.server-address = 127.0.0.1
nacos.port = 8848

# Dubbo Protocol
dubbo.protocol.name=dubbo
## Random port
dubbo.protocol.port=-1

## Dubbo Registry
dubbo.registry.address=nacos://${nacos.server-address}:${nacos.port}

## DemoService version
demo.service.version=1.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand Down
Loading