upgrade to netflix feign 7.1.0.
Add feign-slf4j support. fixes gh-178
This commit is contained in:
15
pom.xml
15
pom.xml
@@ -23,7 +23,7 @@
|
||||
<main.basedir>${basedir}</main.basedir>
|
||||
<archaius.version>0.6.3</archaius.version>
|
||||
<eureka.version>1.1.145</eureka.version>
|
||||
<feign.version>6.1.3</feign.version>
|
||||
<feign.version>7.1.0</feign.version>
|
||||
<hystrix.version>1.4.0-RC5</hystrix.version>
|
||||
<ribbon.version>2.0-RC13</ribbon.version>
|
||||
<zuul.version>1.0.28</zuul.version>
|
||||
@@ -169,8 +169,17 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!--<dependency> <groupId>com.netflix.feign</groupId> <artifactId>feign-slf4j</artifactId>
|
||||
<version>${feign.version}</version> </dependency> -->
|
||||
<!-- TODO: remove with feign 8.0.0 -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.dagger</groupId>
|
||||
<artifactId>dagger</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-slf4j</artifactId>
|
||||
<version>${feign.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.hystrix</groupId>
|
||||
<artifactId>hystrix-core</artifactId>
|
||||
|
||||
@@ -65,11 +65,21 @@
|
||||
<artifactId>feign-core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-slf4j</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-ribbon</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.dagger</groupId>
|
||||
<artifactId>dagger</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.hystrix</groupId>
|
||||
<artifactId>hystrix-core</artifactId>
|
||||
|
||||
@@ -6,6 +6,8 @@ import org.springframework.context.ApplicationEvent;
|
||||
/**
|
||||
* Specifically used when eureka is in the parent bootstrap context to relay the DiscoveryHeartbeatEvent to the child. Avoids stack overflow
|
||||
* @author Spencer Gibb
|
||||
*
|
||||
* TODO: create a ParentDiscoveryHeartbeatEvent in s-c-commons rather than eureka, so eureka doesn't leak into zuul (so zuul can be used with consul for example)
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class EurekaHeartbeatEvent extends ApplicationEvent {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.netflix.feign;
|
||||
|
||||
import feign.slf4j.Slf4jLogger;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.cloud.netflix.archaius.ArchaiusAutoConfiguration;
|
||||
@@ -52,8 +53,7 @@ public class FeignAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public Logger feignLogger() {
|
||||
// return new Slf4jLogger(); //TODO pass Client classname in
|
||||
return new Logger.JavaLogger();
|
||||
return new Slf4jLogger();
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.cloud.netflix.feign;
|
||||
|
||||
import feign.slf4j.Slf4jLogger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.netflix.archaius.ConfigurableEnvironmentConfiguration;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -95,6 +96,7 @@ public class FeignConfiguration {
|
||||
}
|
||||
|
||||
protected <T> T loadBalance(Feign.Builder builder, Class<T> type, String schemeName) {
|
||||
builder.logger(new Slf4jLogger(type)); //TODO: how to have choice here?
|
||||
if (this.ribbonClient != null) {
|
||||
return builder.client(this.ribbonClient).target(type, schemeName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user