commit
ecb5819648
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.metadata.core;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
/**
|
||||
* resolve custom transitive metadata from request.
|
||||
*@author lepdou 2022-05-20
|
||||
*/
|
||||
public class CustomTransitiveMetadataResolver {
|
||||
|
||||
private static final String TRANSITIVE_HEADER_PREFIX = "X-SCT-Metadata-Transitive-";
|
||||
private static final int TRANSITIVE_HEADER_PREFIX_LENGTH = TRANSITIVE_HEADER_PREFIX.length();
|
||||
|
||||
public static Map<String, String> resolve(ServerWebExchange exchange) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
|
||||
HttpHeaders headers = exchange.getRequest().getHeaders();
|
||||
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
|
||||
if (StringUtils.isNotBlank(key) &&
|
||||
StringUtils.startsWithIgnoreCase(key, TRANSITIVE_HEADER_PREFIX)
|
||||
&& !CollectionUtils.isEmpty(entry.getValue())) {
|
||||
|
||||
String sourceKey = StringUtils.substring(key, TRANSITIVE_HEADER_PREFIX_LENGTH);
|
||||
result.put(sourceKey, entry.getValue().get(0));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Map<String, String> resolve(HttpServletRequest request) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
|
||||
Enumeration<String> headers = request.getHeaderNames();
|
||||
while (headers.hasMoreElements()) {
|
||||
String key = headers.nextElement();
|
||||
|
||||
if (StringUtils.isNotBlank(key) &&
|
||||
StringUtils.startsWithIgnoreCase(key, TRANSITIVE_HEADER_PREFIX)
|
||||
&& StringUtils.isNotBlank(request.getHeader(key))) {
|
||||
|
||||
String sourceKey = StringUtils.substring(key, TRANSITIVE_HEADER_PREFIX_LENGTH);
|
||||
result.put(sourceKey, request.getHeader(key));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.common.metadata;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.tencent.cloud.common.metadata.config.MetadataLocalProperties;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* manage metadata from env/config file.
|
||||
*
|
||||
*@author lepdou 2022-05-20
|
||||
*/
|
||||
public class StaticMetadataManager {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(StaticMetadataManager.class);
|
||||
|
||||
private static final String ENV_METADATA_PREFIX = "SCT_METADATA_CONTENT_";
|
||||
private static final int ENV_METADATA_PREFIX_LENGTH = ENV_METADATA_PREFIX.length();
|
||||
private static final String ENV_METADATA_CONTENT_TRANSITIVE = "SCT_METADATA_CONTENT_TRANSITIVE";
|
||||
|
||||
private Map<String, String> envMetadata;
|
||||
private Map<String, String> envTransitiveMetadata;
|
||||
private Map<String, String> configMetadata;
|
||||
private Map<String, String> configTransitiveMetadata;
|
||||
private Map<String, String> mergedStaticMetadata;
|
||||
private Map<String, String> mergedStaticTransitiveMetadata;
|
||||
|
||||
public StaticMetadataManager(MetadataLocalProperties metadataLocalProperties) {
|
||||
parseConfigMetadata(metadataLocalProperties);
|
||||
parseEnvMetadata();
|
||||
merge();
|
||||
}
|
||||
|
||||
private void parseEnvMetadata() {
|
||||
Map<String, String> allEnvs = System.getenv();
|
||||
|
||||
envMetadata = new HashMap<>();
|
||||
// parse all metadata
|
||||
for (Map.Entry<String, String> entry : allEnvs.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
if (StringUtils.isNotBlank(key) && key.startsWith(ENV_METADATA_PREFIX)
|
||||
&& !key.equals(ENV_METADATA_CONTENT_TRANSITIVE)) {
|
||||
String sourceKey = StringUtils.substring(key, ENV_METADATA_PREFIX_LENGTH);
|
||||
envMetadata.put(sourceKey, value);
|
||||
|
||||
LOGGER.info("[SCT] resolve metadata from env. key = {}, value = {}", sourceKey, value);
|
||||
}
|
||||
}
|
||||
envMetadata = Collections.unmodifiableMap(envMetadata);
|
||||
|
||||
envTransitiveMetadata = new HashMap<>();
|
||||
// parse transitive metadata
|
||||
String transitiveKeys = allEnvs.get(ENV_METADATA_CONTENT_TRANSITIVE);
|
||||
if (StringUtils.isNotBlank(transitiveKeys)) {
|
||||
String[] keyArr = StringUtils.split(transitiveKeys, ",");
|
||||
if (keyArr != null && keyArr.length > 0) {
|
||||
for (String key : keyArr) {
|
||||
String value = envMetadata.get(key);
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
envTransitiveMetadata.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
envTransitiveMetadata = Collections.unmodifiableMap(envTransitiveMetadata);
|
||||
}
|
||||
|
||||
private void parseConfigMetadata(MetadataLocalProperties metadataLocalProperties) {
|
||||
Map<String, String> allMetadata = metadataLocalProperties.getContent();
|
||||
List<String> transitiveKeys = metadataLocalProperties.getTransitive();
|
||||
|
||||
Map<String, String> result = new HashMap<>();
|
||||
for (String key : transitiveKeys) {
|
||||
if (allMetadata.containsKey(key)) {
|
||||
result.put(key, allMetadata.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
configTransitiveMetadata = Collections.unmodifiableMap(result);
|
||||
configMetadata = Collections.unmodifiableMap(allMetadata);
|
||||
}
|
||||
|
||||
private void merge() {
|
||||
// env priority is bigger than config
|
||||
Map<String, String> mergedMetadataResult = new HashMap<>();
|
||||
|
||||
mergedMetadataResult.putAll(configMetadata);
|
||||
mergedMetadataResult.putAll(envMetadata);
|
||||
|
||||
this.mergedStaticMetadata = Collections.unmodifiableMap(mergedMetadataResult);
|
||||
|
||||
Map<String, String> mergedTransitiveMetadataResult = new HashMap<>();
|
||||
mergedTransitiveMetadataResult.putAll(configTransitiveMetadata);
|
||||
mergedTransitiveMetadataResult.putAll(envTransitiveMetadata);
|
||||
|
||||
this.mergedStaticTransitiveMetadata = Collections.unmodifiableMap(mergedTransitiveMetadataResult);
|
||||
}
|
||||
|
||||
public Map<String, String> getAllEnvMetadata() {
|
||||
return envMetadata;
|
||||
}
|
||||
|
||||
public Map<String, String> getEnvTransitiveMetadata() {
|
||||
return envTransitiveMetadata;
|
||||
}
|
||||
|
||||
public Map<String, String> getAllConfigMetadata() {
|
||||
return configMetadata;
|
||||
}
|
||||
|
||||
public Map<String, String> getConfigTransitiveMetadata() {
|
||||
return configTransitiveMetadata;
|
||||
}
|
||||
|
||||
public Map<String, String> getMergedStaticMetadata() {
|
||||
return mergedStaticMetadata;
|
||||
}
|
||||
|
||||
Map<String, String> getMergedStaticTransitiveMetadata() {
|
||||
return mergedStaticTransitiveMetadata;
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.common.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
|
||||
/**
|
||||
* the utils for bean factory.
|
||||
* @author lepdou 2022-05-23
|
||||
*/
|
||||
public class BeanFactoryUtils {
|
||||
|
||||
public static <T> List<T> getBeans(BeanFactory beanFactory, Class<T> requiredType) {
|
||||
if (!(beanFactory instanceof DefaultListableBeanFactory)) {
|
||||
throw new RuntimeException("bean factory not support get list bean. factory type = " + beanFactory.getClass()
|
||||
.getName());
|
||||
}
|
||||
|
||||
String[] beanNames = ((DefaultListableBeanFactory) beanFactory).getBeanNamesForType(requiredType);
|
||||
|
||||
if (beanNames.length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return Arrays.stream(beanNames).map(
|
||||
beanName -> beanFactory.getBean(beanName, requiredType)
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<?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>
|
||||
<artifactId>spring-cloud-tencent-examples</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>polaris-router-grayrelease-example</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Tencent Polaris Router GrayRelease Example</name>
|
||||
<description>Example of Spring Cloud Tencent Polaris Router GrayRelease</description>
|
||||
<modules>
|
||||
<module>router-grayrelease-gateway</module>
|
||||
<module>router-grayrelease-frontend</module>
|
||||
<module>router-grayrelease-middle</module>
|
||||
<module>router-grayrelease-backend</module>
|
||||
</modules>
|
||||
</project>
|
@ -0,0 +1,79 @@
|
||||
<?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>
|
||||
<artifactId>polaris-router-grayrelease-example</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>router-grayrelease-backend</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-router</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-circuitbreaker</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-metadata-transfer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,15 @@
|
||||
############################################################
|
||||
# Dockerfile to build polaris-java quickstart example provider
|
||||
|
||||
# 1. You need to build the binary from the source code,
|
||||
# use `mvn clean install` to build the binary.
|
||||
# 2. You need to copy the quickstart-example-provider-*.jar to this directory
|
||||
# 3. Replace the ${VERSION} to the real version of the project
|
||||
|
||||
############################################################
|
||||
|
||||
FROM java:8
|
||||
|
||||
ADD router-grayrelease-backend-1.5.0-Hoxton.SR9-SNAPSHOT.jar /root/app.jar
|
||||
|
||||
ENTRYPOINT ["java","-jar","/root/app.jar"]
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.back;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/router/gray")
|
||||
public class BackController {
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
/**
|
||||
* Get information of callee.
|
||||
* @return information of callee
|
||||
*/
|
||||
@GetMapping("/rest")
|
||||
public String rest() {
|
||||
String env = System.getenv("SCT_METADATA_CONTENT_env");
|
||||
String appName = environment.getProperty("spring.application.name");
|
||||
return appName + "[" + env + "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.back;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class GrayReleaseBackendApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GrayReleaseBackendApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
server:
|
||||
session-timeout: 1800
|
||||
port: 59002
|
||||
spring:
|
||||
application:
|
||||
name: gray-release-back
|
||||
cloud:
|
||||
polaris:
|
||||
address: ${polaris_address}
|
||||
namespace: default
|
||||
enabled: true
|
||||
discovery:
|
||||
service-list-refresh-interval: 1000
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.gateway: info
|
||||
com.tencent.cloud.polaris: debug
|
@ -0,0 +1,6 @@
|
||||
global:
|
||||
statReporter:
|
||||
enable: true
|
||||
plugin:
|
||||
prometheus:
|
||||
pushgatewayAddress: ${prometheus_address}
|
@ -0,0 +1,79 @@
|
||||
<?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>
|
||||
<artifactId>polaris-router-grayrelease-example</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>router-grayrelease-frontend</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-router</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-circuitbreaker</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-metadata-transfer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,15 @@
|
||||
############################################################
|
||||
# Dockerfile to build polaris-java quickstart example provider
|
||||
|
||||
# 1. You need to build the binary from the source code,
|
||||
# use `mvn clean install` to build the binary.
|
||||
# 2. You need to copy the quickstart-example-provider-*.jar to this directory
|
||||
# 3. Replace the ${VERSION} to the real version of the project
|
||||
|
||||
############################################################
|
||||
|
||||
FROM java:8
|
||||
|
||||
ADD router-grayrelease-frontend-1.5.0-Hoxton.SR9-SNAPSHOT.jar /root/app.jar
|
||||
|
||||
ENTRYPOINT ["java","-jar","/root/app.jar"]
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.front;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/router/gray")
|
||||
public class FrontController {
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
@Autowired
|
||||
private RouterService routerService;
|
||||
|
||||
/**
|
||||
* Get information of callee.
|
||||
* @return information of callee
|
||||
*/
|
||||
@GetMapping("/rest")
|
||||
public String rest() {
|
||||
String env = System.getenv("SCT_METADATA_CONTENT_env");
|
||||
String appName = environment.getProperty("spring.application.name");
|
||||
String curName = appName + "[" + env + "]";
|
||||
String resp = routerService.rest();
|
||||
return curName + " -> " + resp;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.front;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients
|
||||
public class GrayReleaseFrontApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GrayReleaseFrontApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.front;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* Router callee feign client.
|
||||
*
|
||||
* @author lepdou 2022-04-06
|
||||
*/
|
||||
@FeignClient("gray-release-middle")
|
||||
public interface RouterService {
|
||||
|
||||
@GetMapping("/router/gray/rest")
|
||||
String rest();
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
server:
|
||||
session-timeout: 1800
|
||||
port: 59000
|
||||
spring:
|
||||
application:
|
||||
name: gray-release-front
|
||||
cloud:
|
||||
polaris:
|
||||
address: ${polaris_address}
|
||||
namespace: default
|
||||
enabled: true
|
||||
discovery:
|
||||
service-list-refresh-interval: 1000
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.gateway: info
|
||||
com.tencent.cloud.polaris: debug
|
@ -0,0 +1,6 @@
|
||||
global:
|
||||
statReporter:
|
||||
enable: true
|
||||
plugin:
|
||||
prometheus:
|
||||
pushgatewayAddress: ${prometheus_address}
|
@ -0,0 +1,62 @@
|
||||
<?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>
|
||||
<artifactId>polaris-router-grayrelease-example</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>router-grayrelease-gateway</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-router</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-circuitbreaker</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-metadata-transfer</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,15 @@
|
||||
############################################################
|
||||
# Dockerfile to build polaris-java quickstart example provider
|
||||
|
||||
# 1. You need to build the binary from the source code,
|
||||
# use `mvn clean install` to build the binary.
|
||||
# 2. You need to copy the quickstart-example-provider-*.jar to this directory
|
||||
# 3. Replace the ${VERSION} to the real version of the project
|
||||
|
||||
############################################################
|
||||
|
||||
FROM java:8
|
||||
|
||||
ADD router-grayrelease-gateway-1.5.0-Hoxton.SR9-SNAPSHOT.jar /root/app.jar
|
||||
|
||||
ENTRYPOINT ["java","-jar","/root/app.jar"]
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.gateway;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/router/gray")
|
||||
public class GatewayController {
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
@Autowired
|
||||
private RouterService routerService;
|
||||
|
||||
/**
|
||||
* Get information of callee.
|
||||
* @return information of callee
|
||||
*/
|
||||
@GetMapping("/entry")
|
||||
public String rest() {
|
||||
String appName = environment.getProperty("spring.application.name");
|
||||
String resp = routerService.rest();
|
||||
return appName + " -> " + resp;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.gateway;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients
|
||||
public class GrayReleaseGatewayApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GrayReleaseGatewayApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.gateway;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* Router callee feign client.
|
||||
*
|
||||
* @author lepdou 2022-04-06
|
||||
*/
|
||||
@FeignClient("gray-release-front")
|
||||
public interface RouterService {
|
||||
|
||||
@GetMapping("/router/gray/rest")
|
||||
String rest();
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
server:
|
||||
session-timeout: 1800
|
||||
port: 59100
|
||||
spring:
|
||||
application:
|
||||
name: gray-release-gateway
|
||||
cloud:
|
||||
polaris:
|
||||
address: ${polaris_address}
|
||||
namespace: default
|
||||
enabled: true
|
||||
discovery:
|
||||
service-list-refresh-interval: 1000
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.gateway: info
|
||||
com.tencent.cloud.polaris: debug
|
@ -0,0 +1,6 @@
|
||||
global:
|
||||
statReporter:
|
||||
enable: true
|
||||
plugin:
|
||||
prometheus:
|
||||
pushgatewayAddress: ${prometheus_address}
|
@ -0,0 +1,79 @@
|
||||
<?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>
|
||||
<artifactId>polaris-router-grayrelease-example</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>router-grayrelease-middle</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-router</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>spring-cloud-starter-tencent-polaris-circuitbreaker</artifactId>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-tencent-metadata-transfer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,15 @@
|
||||
############################################################
|
||||
# Dockerfile to build polaris-java quickstart example provider
|
||||
|
||||
# 1. You need to build the binary from the source code,
|
||||
# use `mvn clean install` to build the binary.
|
||||
# 2. You need to copy the quickstart-example-provider-*.jar to this directory
|
||||
# 3. Replace the ${VERSION} to the real version of the project
|
||||
|
||||
############################################################
|
||||
|
||||
FROM java:8
|
||||
|
||||
ADD router-grayrelease-middle-1.5.0-Hoxton.SR9-SNAPSHOT.jar /root/app.jar
|
||||
|
||||
ENTRYPOINT ["java","-jar","/root/app.jar"]
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.middle;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients
|
||||
public class GrayReleaseMiddleApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GrayReleaseMiddleApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.middle;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/router/gray")
|
||||
public class MiddleController {
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
@Autowired
|
||||
private RouterService routerService;
|
||||
|
||||
/**
|
||||
* Get information of callee.
|
||||
* @return information of callee
|
||||
*/
|
||||
@GetMapping("/rest")
|
||||
public String rest() {
|
||||
String env = System.getenv("SCT_METADATA_CONTENT_env");
|
||||
String appName = environment.getProperty("spring.application.name");
|
||||
String curName = appName + "[" + env + "]";
|
||||
String resp = routerService.rest();
|
||||
return curName + " -> " + resp;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
|
||||
*
|
||||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
*
|
||||
* Licensed under the BSD 3-Clause License (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
* 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 com.tencent.cloud.polaris.router.grayrelease.middle;
|
||||
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* Router callee feign client.
|
||||
*
|
||||
* @author lepdou 2022-04-06
|
||||
*/
|
||||
@FeignClient("gray-release-back")
|
||||
public interface RouterService {
|
||||
|
||||
@GetMapping("/router/gray/rest")
|
||||
String rest();
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
server:
|
||||
session-timeout: 1800
|
||||
port: 59001
|
||||
spring:
|
||||
application:
|
||||
name: gray-release-middle
|
||||
cloud:
|
||||
polaris:
|
||||
address: ${polaris_address}
|
||||
namespace: default
|
||||
enabled: true
|
||||
discovery:
|
||||
service-list-refresh-interval: 1000
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.gateway: info
|
||||
com.tencent.cloud.polaris: debug
|
@ -0,0 +1,6 @@
|
||||
global:
|
||||
statReporter:
|
||||
enable: true
|
||||
plugin:
|
||||
prometheus:
|
||||
pushgatewayAddress: ${prometheus_address}
|
Loading…
Reference in new issue