Merge branch '1.0.x' into 1.1.x
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package org.springframework.cloud.sleuth.instrument.web.client.feign;
|
||||
|
||||
import feign.RetryableException;
|
||||
import feign.Retryer;
|
||||
|
||||
/**
|
||||
* This is essentially the same implementation of a Retryer that is in newer versions of
|
||||
* Feign. For the 1.0.x stream we add it here.
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public class NeverRetry implements Retryer {
|
||||
@Override
|
||||
public void continueOrPropagate(RetryableException e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Retryer clone() {
|
||||
return this;
|
||||
}
|
||||
|
||||
public static final NeverRetry INSTANCE = new NeverRetry();
|
||||
}
|
||||
@@ -16,9 +16,8 @@
|
||||
|
||||
package org.springframework.cloud.sleuth.instrument.web.client.feign;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
|
||||
import feign.Feign;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
|
||||
/**
|
||||
* Contains {@link feign.Feign.Builder} implementation with tracing components
|
||||
@@ -33,7 +32,7 @@ final class SleuthFeignBuilder {
|
||||
private SleuthFeignBuilder() {}
|
||||
|
||||
static Feign.Builder builder(BeanFactory beanFactory) {
|
||||
return Feign.builder()
|
||||
return Feign.builder().retryer(NeverRetry.INSTANCE)
|
||||
.client(new TraceFeignClient(beanFactory));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
|
||||
package org.springframework.cloud.sleuth.instrument.web.client.feign;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
|
||||
import feign.Feign;
|
||||
import feign.hystrix.HystrixFeign;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
|
||||
/**
|
||||
* Contains {@link Feign.Builder} implementation that delegates execution
|
||||
@@ -35,7 +34,7 @@ final class SleuthHystrixFeignBuilder {
|
||||
private SleuthHystrixFeignBuilder() {}
|
||||
|
||||
static Feign.Builder builder(BeanFactory beanFactory) {
|
||||
return HystrixFeign.builder()
|
||||
return HystrixFeign.builder().retryer(NeverRetry.INSTANCE)
|
||||
.client(new TraceFeignClient(beanFactory));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,8 @@ public class DefaultTracer implements Tracer {
|
||||
.traceIdHigh(parent.getTraceIdHigh())
|
||||
.traceId(parent.getTraceId()).parent(parent.getSpanId()).spanId(id)
|
||||
.processId(parent.getProcessId()).savedSpan(parent)
|
||||
.exportable(parent.isExportable()).build();
|
||||
.exportable(parent.isExportable())
|
||||
.build();
|
||||
this.spanLogger.logStartedSpan(parent, span);
|
||||
return span;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user