File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/main/kotlin/com/m3/tracing/apache/httpclient Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,16 @@ Add `M3TracingHttpInterceptor` as request/response interceptor of HttpClient.
88
99``` java:
1010// CAUTION: Must setup as BOTH interceptor otherwise it may cause memory leak.
11- httpclient.addRequestInterceptor(M3TracingHttpInterceptor.getINSTANCE() );
12- httpclient.addResponseInterceptor(M3TracingHttpInterceptor.getINSTANCE() );
11+ httpclient.addRequestInterceptor(M3TracingHttpInterceptor.INSTANCE );
12+ httpclient.addResponseInterceptor(M3TracingHttpInterceptor.INSTANCE );
1313```
1414
1515### httpclient 4.3+
1616
1717``` java
1818CloseableHttpClient httpClient = HttpClientBuilder . create()
19- .addInterceptorFirst((HttpRequestInterceptor ) M3TracingHttpInterceptor . getINSTANCE() )
20- .addInterceptorLast((HttpResponseInterceptor ) M3TracingHttpInterceptor . getINSTANCE() )
19+ .addInterceptorFirst((HttpRequestInterceptor ) M3TracingHttpInterceptor . INSTANCE )
20+ .addInterceptorLast((HttpResponseInterceptor ) M3TracingHttpInterceptor . INSTANCE )
2121 .build();
2222```
2323 }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ open class M3TracingHttpInterceptor(
1919 protected val tracer : M3Tracer
2020) : HttpRequestInterceptor, HttpResponseInterceptor {
2121 companion object {
22- @JvmStatic
22+ @JvmField
2323 public val INSTANCE = M3TracingHttpInterceptor ()
2424
2525 private val currentSpan = ThreadLocal <TraceSpan >()
You can’t perform that action at this time.
0 commit comments