Skip to content

Commit

Permalink
[#4035] fix invocation context loss issue (#4087)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghao605 authored Dec 11, 2023
1 parent 6066887 commit f305716
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,14 @@
public class ZipkinTracingFilter extends AbstractFilter implements ConsumerFilter, ProviderFilter {
public static final String NAME = "zipkin";

private ZipkinConsumerDelegate consumer;

private ZipkinProviderDelegate producer;
@Autowired
private HttpTracing httpTracing;

@Override
public String getName() {
return NAME;
}

@Autowired
public void setHttpTracing(HttpTracing httpTracing) {
this.consumer = new ZipkinConsumerDelegate(httpTracing);
this.producer = new ZipkinProviderDelegate(httpTracing);
}

@SuppressWarnings({"try", "unused"})
@Override
public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) {
Expand All @@ -66,9 +59,9 @@ public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode ne

private ZipkinTracingDelegate collectTracing(Invocation invocation) {
if (PROVIDER.equals(invocation.getInvocationType())) {
return producer;
return new ZipkinProviderDelegate(httpTracing);
}

return consumer;
return new ZipkinConsumerDelegate(httpTracing);
}
}

0 comments on commit f305716

Please sign in to comment.