Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14 from SkyeBeFreeman/main
Browse files Browse the repository at this point in the history
feat:update polaris version to 1.3.1
  • Loading branch information
andrewshan authored Apr 8, 2022
2 parents 64d3e7c + e2b4bf3 commit ec26b74
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 63 deletions.
75 changes: 47 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,57 @@
HELP.md
target/
logs/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
# Eclipse project files
.project
.classpath
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
# IntelliJ IDEA project files and directories
*.iml
*.ipr
*.iws
.idea/

# Build targets
/target
*/target
target
/applog
*/applog
applog

# Mac-specific directory that no other operating system needs.
.DS_Store

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
# JVM crash logs
hs_err_pid*.log

dependency-reduced-pom.xml

*/.unison.*

# exclude docker-sync stuff
.docker-sync
*/.docker-sync

# exclude vscode files
.vscode/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.factorypath

# misc
*classes
*.class
.svn
logs/
lib/
applog/

### Maven ignore ###
# Maven ignore
.flattened-pom.xml

# Polaris
polaris
*/backup
/backup
backup
29 changes: 20 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

<properties>
<spring.boot.version>2.4.3</spring.boot.version>
<polaris.version>1.2.3</polaris.version>
<polaris.version>1.3.1</polaris.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skip.maven.deploy>false</skip.maven.deploy>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<revision>1.0.1</revision>
<revision>1.1.0</revision>
<openfeign.version>11.1</openfeign.version>
<!-- Maven Plugin Versions -->
<jacoco.version>0.8.3</jacoco.version>
Expand All @@ -34,21 +34,32 @@
<maven.javadoc.plugin.version>3.2.0</maven.javadoc.plugin.version>
</properties>

<developers>
<developer>
<id>SkyeBeFreeman</id>
<name>Haotian Zhang</name>
<email>[email protected]</email>
<organization>Tencent</organization>
<url>https://github.com/SkyeBeFreeman/</url>
</developer>
</developers>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<artifactId>polaris-dependencies</artifactId>
<groupId>com.tencent.polaris</groupId>
<version>${polaris.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- polaris -->
<dependency>
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-all</artifactId>
<version>${polaris.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- feign -->
Expand Down
7 changes: 4 additions & 3 deletions spring-boot-polaris-context/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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"
<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">
<parent>
<artifactId>spring-boot-polaris</artifactId>
Expand All @@ -25,9 +25,10 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-all</artifactId>
<artifactId>polaris-factory</artifactId>
</dependency>
</dependencies>
</project>
14 changes: 12 additions & 2 deletions spring-boot-polaris-dependencies/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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"
<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">
<parent>
<groupId>com.tencent.polaris</groupId>
Expand All @@ -17,6 +17,16 @@
<name>SpringBoot Polaris Dependencies</name>
<description>All Dependencies for SpringBoot Polaris</description>

<developers>
<developer>
<id>SkyeBeFreeman</id>
<name>Haotian Zhang</name>
<email>[email protected]</email>
<organization>Tencent</organization>
<url>https://github.com/SkyeBeFreeman/</url>
</developer>
</developers>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
8 changes: 2 additions & 6 deletions spring-boot-polaris-discovery-feign/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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"
<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">
<parent>
<artifactId>spring-boot-polaris</artifactId>
Expand All @@ -15,10 +15,6 @@
<description>Feign Adapter for SpringBoot Polaris Discovery</description>

<dependencies>
<dependency>
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-all</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
Expand Down
8 changes: 2 additions & 6 deletions spring-boot-polaris-discovery-register/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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"
<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">
<parent>
<artifactId>spring-boot-polaris</artifactId>
Expand All @@ -15,10 +15,6 @@
<description>Register Adapter for SpringBoot Polaris Discovery</description>

<dependencies>
<dependency>
<groupId>com.tencent.polaris</groupId>
<artifactId>polaris-all</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@

import com.tencent.polaris.api.core.ProviderAPI;
import com.tencent.polaris.api.rpc.InstanceHeartbeatRequest;
import com.tencent.polaris.client.util.NamedThreadFactory;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
Expand All @@ -34,14 +32,16 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;

/**
* Heartbeat handler.
*
* @author Haotian Zhang
*/
public class HeartbeatHandler {

private static final Logger LOG = LoggerFactory.getLogger(HeartbeatHandler.class);

private ScheduledExecutorService scheduledExecutorService;

private final Map<InstanceKey, ScheduledFuture<?>> futures = new ConcurrentHashMap<>();

private ScheduledExecutorService scheduledExecutorService;
@Autowired
private ProviderAPI providerAPI;

Expand Down Expand Up @@ -102,7 +102,7 @@ public void run() {
} catch (Throwable e) {
LOG.error("[Polaris] fail to heartbeat instance {}:{}, service is {}, namespace is {}",
instanceHeartbeatRequest.getHost(), instanceHeartbeatRequest.getPort(),
instanceHeartbeatRequest.getService(), instanceHeartbeatRequest.getNamespace());
instanceHeartbeatRequest.getService(), instanceHeartbeatRequest.getNamespace(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
server.port=11011
spring.application.name=EchoClientBoot
polaris.address=grpc://9.134.15.118:8091
polaris.address=grpc://127.0.0.1:8091
polaris.discovery.register.enable=true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
server.port=11010
spring.application.name=EchoServerBoot
polaris.address=grpc://9.134.15.118:8091
polaris.address=grpc://127.0.0.1:8091
polaris.discovery.register.enable=true

0 comments on commit ec26b74

Please sign in to comment.