parent
786156341a
commit
fc16d17206
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.circuitbreaker.example;
|
|
||||||
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* service a provider.
|
|
||||||
*
|
|
||||||
* @author Haotian Zhang
|
|
||||||
*/
|
|
||||||
@FeignClient(name = "polaris-circuitbreaker-example-a",
|
|
||||||
fallback = ProviderAFallback.class)
|
|
||||||
public interface ProviderA {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get info of service A.
|
|
||||||
* @return info of service A
|
|
||||||
*/
|
|
||||||
@GetMapping("/example/service/a/info")
|
|
||||||
String info();
|
|
||||||
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.circuitbreaker.example;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* provider a fallback
|
|
||||||
*
|
|
||||||
* @author Haotian Zhang
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class ProviderAFallback implements ProviderA {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String info() {
|
|
||||||
return "trigger the refuse for service a";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
log4j.rootLogger=DEBUG,console,FILE
|
|
||||||
|
|
||||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.console.threshold=INFO
|
|
||||||
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%5p] - %c -%F(%L) -%m%n
|
|
||||||
|
|
||||||
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
|
|
||||||
log4j.appender.FILE.Append=true
|
|
||||||
|
|
||||||
log4j.appender.FILE.File=applog/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
|
|
||||||
log4j.appender.FILE.Threshold=INFO
|
|
||||||
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%5p] - %c -%F(%L) -%m%n
|
|
||||||
log4j.appender.FILE.MaxFileSize=10MB
|
|
@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
|
||||||
<contextName>logback</contextName>
|
|
||||||
<!--输出到控制台-->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!--按天生成日志-->
|
|
||||||
<appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<Prudent>true</Prudent>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<FileNamePattern>
|
|
||||||
applog/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
|
|
||||||
</FileNamePattern>
|
|
||||||
</rollingPolicy>
|
|
||||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
|
||||||
<Pattern>
|
|
||||||
%d{yyyy-MM-dd HH:mm:ss} -%msg%n
|
|
||||||
</Pattern>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
<root level="info">
|
|
||||||
<appender-ref ref="console"/>
|
|
||||||
<appender-ref ref="logFile"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</configuration>
|
|
@ -1,6 +1,10 @@
|
|||||||
global:
|
#global:
|
||||||
system:
|
# system:
|
||||||
discoverCluster:
|
# discoverCluster:
|
||||||
sameAsBuiltin: true
|
# sameAsBuiltin: false
|
||||||
healthCheckCluster:
|
# namespace: Polaris
|
||||||
sameAsBuiltin: true
|
# service: polaris.discover
|
||||||
|
# healthCheckCluster:
|
||||||
|
# sameAsBuiltin: false
|
||||||
|
# namespace: Polaris
|
||||||
|
# service: polaris.healthcheck
|
||||||
|
4
spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/src/main/java/com/tencent/cloud/polaris/discovery/service/caller/DiscoveryCalleeServiceCallback.java → spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/src/main/java/com/tencent/cloud/polaris/discovery/service/caller/DiscoveryCalleeServiceFallback.java
4
spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/src/main/java/com/tencent/cloud/polaris/discovery/service/caller/DiscoveryCalleeServiceCallback.java → spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/src/main/java/com/tencent/cloud/polaris/discovery/service/caller/DiscoveryCalleeServiceFallback.java
@ -1,15 +0,0 @@
|
|||||||
log4j.rootLogger=DEBUG,console,FILE
|
|
||||||
|
|
||||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.console.threshold=INFO
|
|
||||||
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%5p] - %c -%F(%L) -%m%n
|
|
||||||
|
|
||||||
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
|
|
||||||
log4j.appender.FILE.Append=true
|
|
||||||
|
|
||||||
log4j.appender.FILE.File=applog/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
|
|
||||||
log4j.appender.FILE.Threshold=INFO
|
|
||||||
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%5p] - %c -%F(%L) -%m%n
|
|
||||||
log4j.appender.FILE.MaxFileSize=10MB
|
|
@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
|
||||||
<contextName>logback</contextName>
|
|
||||||
<!--输出到控制台-->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>%d{HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!--按天生成日志-->
|
|
||||||
<appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<Prudent>true</Prudent>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<FileNamePattern>
|
|
||||||
applog/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
|
|
||||||
</FileNamePattern>
|
|
||||||
</rollingPolicy>
|
|
||||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
|
||||||
<Pattern>
|
|
||||||
%d{yyyy-MM-dd HH:mm:ss} -%msg%n
|
|
||||||
</Pattern>
|
|
||||||
</layout>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<root level="info">
|
|
||||||
<appender-ref ref="console"/>
|
|
||||||
<appender-ref ref="logFile"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</configuration>
|
|
@ -1,15 +0,0 @@
|
|||||||
log4j.rootLogger=DEBUG,console,FILE
|
|
||||||
|
|
||||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
|
||||||
log4j.appender.console.threshold=INFO
|
|
||||||
log4j.appender.console.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%5p] - %c -%F(%L) -%m%n
|
|
||||||
|
|
||||||
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
|
|
||||||
log4j.appender.FILE.Append=true
|
|
||||||
|
|
||||||
log4j.appender.FILE.File=applog/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
|
|
||||||
log4j.appender.FILE.Threshold=INFO
|
|
||||||
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
|
|
||||||
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} [%5p] - %c -%F(%L) -%m%n
|
|
||||||
log4j.appender.FILE.MaxFileSize=10MB
|
|
@ -1 +1,2 @@
|
|||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.tencent.cloud.polaris.context.PolarisContextConfiguration
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||||
|
com.tencent.cloud.polaris.context.PolarisContextConfiguration
|
||||||
|
Loading…
Reference in new issue