[
https://issues.apache.org/jira/browse/CXF-7792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569854#comment-16569854
]
bambus commented on CXF-7792:
-----------------------------
[~reta] I know that this is off topic. I have java application that is sending
requests to the bundles. I have implemented brave there. But now I can see
separate traces. I cant see the trace like this: Service1 - > Service2 - > DB
-> GIVE RESPONSE.
I have the separate services and traces now...
This is what i add in the client app.
{code:java}
public String sendRequest(String url) throws StatusErrorCodeException,
IOException {
OkHttpSender sender = OkHttpSender.create("http://localhost:9411/api/v2/spans");
AsyncReporter<Span> spanReporter = AsyncReporter.create(sender);
Tracing tracing =
Tracing.newBuilder().localServiceName("myApp").spanReporter(spanReporter).build();
CloseableHttpClient httpClient =
TracingHttpClientBuilder.create(tracing).build();
// CloseableHttpClient client = HttpClientBuilder.create().build();
brave.Span span = tracing.tracer().newTrace();
span.start();
HttpGet request = new HttpGet(url);
ResponseHandler<String> handler = new BasicResponseHandler();
request.addHeader("accept", "application/json");
CloseableHttpResponse response = httpClient.execute(request);
if (response.getStatusLine().getStatusCode() != 200) {
throw new StatusErrorCodeException(
"Failed : HTTP error code : " + response.getStatusLine().getStatusCode());
}
String body = handler.handleResponse(response);
tracing.close();
spanReporter.close();
sender.close();
return body;
}
{code}
> Distributed Tracing with OpenZipkin Brave and OSGi
> --------------------------------------------------
>
> Key: CXF-7792
> URL: https://issues.apache.org/jira/browse/CXF-7792
> Project: CXF
> Issue Type: Wish
> Components: Tracing Brave
> Affects Versions: 3.2.5
> Reporter: bambus
> Priority: Critical
> Attachments: image-2018-07-25-09-01-33-506.png,
> image-2018-07-30-13-04-31-402.png, image-2018-07-31-10-15-37-839.png,
> jaxws_tracing_brave_osgi.zip
>
>
> I have followed your example and brave example for implementing brave in cxf
> based application. After I added brave I could not package it like bundle. I
> always get different errors. Error like: Caused by:
> java.lang.NoClassDefFoundError: zipkin/reporter/Reporter
> Another one: Caused by: java.lang.ClassCastException: Cannot cast
> org.apache.cxf.service.factory.FactoryBeanListenerManager to
> org.apache.cxf.service.factory.FactoryBeanListenerManager
> I am using Service Mix 7.0.1 with Karaf 4.0.9.
> Can you help me how to pack it like as a bundle.
> In this example that thing is missing:
>
> [https://cwiki.apache.org/confluence/display/CXF20DOC/Using+OpenZipkin+Brave#UsingOpenZipkinBrave-SpringXML-Configuration]
> I have configured the blueprint like in the example.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)