Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
880 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## 简介 | ||
SOFA-Jarslink 提供了三个样例工程来演示 Jarslink2.0 使用,工程目录组织如下: | ||
```text | ||
│ | ||
├── spring-boot-transform-sample | ||
│ | ||
├── biz-jvm-invocation-sample | ||
│ | ||
└── biz-health-check-sample | ||
``` | ||
|
||
### spring-boot-transform-sample | ||
该工程演示了如何快速的将 Spring Boot 工程改造成 SOFABoot 工程。 | ||
|
||
### biz-jvm-invocation-sample | ||
该工程演示了如何使用 JVM 服务实现跨应用通信。 | ||
|
||
### biz-health-check-sample | ||
该工程演示了如何集成 SOFABoot 健康检查能力。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
详细参考[官方文档链接](http://www.sofastack.tech/sofa-boot/docs/sofa-jarslink-jarslink-health-demo) |
109 changes: 109 additions & 0 deletions
109
sofa-jarslink-samples/biz-health-check-sample/app-one/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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>com.alipay.sofa</groupId> | ||
<artifactId>sofaboot-dependencies</artifactId> | ||
<version>2.5.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>me.qlong.tech</groupId> | ||
<artifactId>app-one</artifactId> | ||
<version>1.0.0</version> | ||
|
||
<dependencies> | ||
<!-- 用于 ark-biz 动态管理 --> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>sofa-jarslink-ark-starter</artifactId> | ||
<classifier>ark-plugin</classifier> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<!-- 用于健康检查 --> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>runtime-sofa-boot-starter</artifactId> | ||
<classifier>ark-plugin</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>runtime-sofa-boot-starter</artifactId> | ||
</dependency> | ||
|
||
<!-- 用于 IDE 运行或者执行测试用例 --> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>sofa-ark-springboot-starter</artifactId> | ||
</dependency> | ||
|
||
<!-- web 应用 --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<!--health check--> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>healthcheck-sofa-boot-starter</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<profiles> | ||
<profile> | ||
<id>default</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<repositories> | ||
<repository> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<id>snapshot</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<id>snapshot</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>sofa-ark-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<!--goal executed to generate executable-ark-jar --> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
|
||
<configuration> | ||
<!--specify destination where executable-ark-jar will be saved, default saved to ${project.build.directory}--> | ||
<outputDirectory>target</outputDirectory> | ||
|
||
<!--default none--> | ||
<arkClassifier>executable-ark</arkClassifier> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
|
||
</project> |
31 changes: 31 additions & 0 deletions
31
...ink-samples/biz-health-check-sample/app-one/src/main/java/me/qlong/AppOneApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* 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 me.qlong; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
/** | ||
* @author qilong.zql 18/6/12-下午8:48 | ||
*/ | ||
@SpringBootApplication | ||
public class AppOneApplication { | ||
public static void main(String[] args) { | ||
SpringApplication springApplication = new SpringApplication(AppOneApplication.class); | ||
springApplication.run(args); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...-samples/biz-health-check-sample/app-one/src/main/resources/config/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# can't be deleted | ||
spring.application.name=appOne | ||
|
||
logging.path=./logs | ||
|
||
com.alipay.sofa.boot.skipJvmReferenceHealthCheck=true |
94 changes: 94 additions & 0 deletions
94
sofa-jarslink-samples/biz-health-check-sample/app-two/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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>com.alipay.sofa</groupId> | ||
<artifactId>sofaboot-dependencies</artifactId> | ||
<version>2.5.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>me.qlong.tech</groupId> | ||
<artifactId>app-two</artifactId> | ||
<version>1.0.0</version> | ||
|
||
<dependencies> | ||
<!-- 用于健康检查 --> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>runtime-sofa-boot-starter</artifactId> | ||
<classifier>ark-plugin</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>runtime-sofa-boot-starter</artifactId> | ||
</dependency> | ||
|
||
<!--health check--> | ||
<dependency> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>healthcheck-sofa-boot-starter</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
<profiles> | ||
<profile> | ||
<id>default</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<repositories> | ||
<repository> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<id>snapshot</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<id>snapshot</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.alipay.sofa</groupId> | ||
<artifactId>sofa-ark-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<!--goal executed to generate executable-ark-jar --> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
|
||
<configuration> | ||
<attach>true</attach> | ||
<!--specify destination where executable-ark-jar will be saved, default saved to ${project.build.directory}--> | ||
<outputDirectory>target</outputDirectory> | ||
|
||
<!--default none--> | ||
<arkClassifier>executable-ark</arkClassifier> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
31 changes: 31 additions & 0 deletions
31
...iz-health-check-sample/app-two/src/main/java/me/qlong/tech/service/AppTwoApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* 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 me.qlong.tech.service; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
/** | ||
* @author qilong.zql 18/6/13-上午11:34 | ||
*/ | ||
@SpringBootApplication | ||
public class AppTwoApplication { | ||
public static void main(String[] args) { | ||
SpringApplication springApplication = new SpringApplication(AppTwoApplication.class); | ||
springApplication.run(args); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...-samples/biz-health-check-sample/app-two/src/main/resources/config/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# can't be deleted | ||
spring.application.name=appTwo | ||
|
||
logging.path=./logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>biz-health-check-sample</artifactId> | ||
<packaging>pom</packaging> | ||
<groupId>me.qlong.tech</groupId> | ||
<version>1.0.0</version> | ||
|
||
<profiles> | ||
<profile> | ||
<id>default</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<repositories> | ||
<repository> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<id>snapshot</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
<id>snapshot</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
详细参考[官方文档链接](http://www.sofastack.tech/sofa-boot/docs/sofa-jarslink-jarslink-invocation-demo) |
Oops, something went wrong.