Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this a bug in the feign rule for the latest feign-core? #604

Open
qbwu opened this issue Jan 12, 2021 · 0 comments
Open

Is this a bug in the feign rule for the latest feign-core? #604

qbwu opened this issue Jan 12, 2021 · 0 comments

Comments

@qbwu
Copy link

qbwu commented Jan 12, 2021

In rule/feign/src/main/java/io/opentracing/contrib/specialagent/rule/feign/FeignAgentIntercept.java:

 private static Request inject(final Tracer tracer, final SpanContext spanContext, final Request request) {
    final HashMap<String,Collection<String>> headersWithTracingContext = new HashMap<>(request.headers());
    tracer.inject(spanContext, Format.Builtin.HTTP_HEADERS, new HttpHeadersInjectAdapter(headersWithTracingContext));
    return Request.create(request.method(), request.url(), headersWithTracingContext, request.body(), request.charset());
 }

The ending return statement calls the Request.create, which is a deprecated method for the latest feign-core, and it will create a Request with requestTemplate = null, and when others try to use the RequestTemplate to revise the Request later, it will throw a NPE.

@qbwu qbwu changed the title Is thisBug in the feign rule for the latest version Is this a bug in the feign rule for the latest feign-core? Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant