cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cxf git commit: CXF-7164: Support tracing using OpenZipkin Brave. Added OSGi support (features, metadata) and Brave OSGi example.
Date Sat, 14 Jan 2017 21:01:41 GMT
Repository: cxf
Updated Branches:
  refs/heads/master ae83629e6 -> e636c50b0


CXF-7164: Support tracing using OpenZipkin Brave. Added OSGi support (features, metadata)
and Brave OSGi example.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e636c50b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e636c50b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e636c50b

Branch: refs/heads/master
Commit: e636c50b0d5f9bd811896bd21e20f58d7942b96e
Parents: ae83629
Author: reta <drreta@gmail.com>
Authored: Sat Jan 14 16:00:37 2017 -0500
Committer: reta <drreta@gmail.com>
Committed: Sat Jan 14 16:00:37 2017 -0500

----------------------------------------------------------------------
 .../samples/jax_rs/tracing_brave/README.txt     |   4 +-
 .../jax_rs/tracing_brave_osgi/README.txt        |  79 +++++++++++
 .../samples/jax_rs/tracing_brave_osgi/pom.xml   | 116 ++++++++++++++++
 .../java/demo/jaxrs/tracing/server/Catalog.java | 135 +++++++++++++++++++
 .../demo/jaxrs/tracing/server/CatalogStore.java |  71 ++++++++++
 .../resources/OSGI-INF/blueprint/context.xml    |  58 ++++++++
 distribution/src/main/release/samples/pom.xml   |   1 +
 integration/tracing/tracing-brave/pom.xml       |   6 +-
 .../cxf/tracing/brave/jaxrs/BraveFeature.java   |   4 +-
 .../features/src/main/resources/features.xml    |  11 ++
 10 files changed, 480 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/distribution/src/main/release/samples/jax_rs/tracing_brave/README.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_brave/README.txt b/distribution/src/main/release/samples/jax_rs/tracing_brave/README.txt
index 03ec82a..3a04f91 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_brave/README.txt
+++ b/distribution/src/main/release/samples/jax_rs/tracing_brave/README.txt
@@ -1,7 +1,7 @@
-JAX-RS HTrace Demo 
+JAX-RS Brave/OpenZipkin Tracing Demo 
 =================
 
-The demo shows a basic usage of HTrace distributed tracer with REST based 
+The demo shows a basic usage of Brave/OpenZipkin distributed tracer with REST based 
 Web Services using  JAX-RS 2.0 (JSR-339). The REST server provides the 
 following services: 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/README.txt
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/README.txt b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/README.txt
new file mode 100644
index 0000000..2832d9e
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/README.txt
@@ -0,0 +1,79 @@
+JAX-RS Brave/OpenZipkin Tracing Demo in OSGi container
+=================
+
+The demo shows a basic usage of Brave/OpenZipkin distributed tracer with REST based 
+Web Services using  JAX-RS 2.0 (JSR-339). The REST server provides the 
+following services: 
+
+A RESTful catalog service is provided on URL http://localhost:9000/catalog 
+
+A HTTP GET request to URL http://localhost:8181/cxf/catalog generates following 
+traces:
+
+A HTTP POST request to URL http://localhost:8181/cxf/catalog generates following 
+traces:
+
+A HTTP GET request to URL http://localhost:8181/cxf/catalog/<id> generates following

+traces:
+
+A HTTP DELETE request to URL http://localhost:8181/cxf/catalog/<id> generates following

+traces:
+
+
+Building and running the demo using Maven
+---------------------------------------
+
+From the base directory of this sample (i.e., where this README file is
+located), the Maven pom.xml file can be used to build and run the demo. 
+
+Using either UNIX or Windows:
+
+  mvn install
+  
+Starting Karaf (refer to http://karaf.apache.org/manual/latest-4.0.x/quick-start.html)
+
+  bin/karaf
+
+
+          __ __                  ____      
+         / //_/____ __________ _/ __/      
+        / ,<  / __ `/ ___/ __ `/ /_        
+       / /| |/ /_/ / /  / /_/ / __/        
+      /_/ |_|\__,_/_/   \__,_/_/         
+  
+    Apache Karaf (4.0.7)
+  
+  Hit '<tab>' for a list of available commands
+  and '[cmd] --help' for help on a specific command.
+  Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
+
+
+In order to install CXF's features, you need to add the CXF's features repo using
+
+  feature:repo-add cxf 3.n.m
+
+ where 3.n.m corresponds to a valid CXF version number (e.g., 3.2.0).
+
+Install CXF's cxf-tracing-brave feature that installs all the required bundles
+for this demo bundle.
+
+  feature:install cxf-jaxrs
+  feature:install cxf-jsr-json
+  feature:install cxf-tracing-brave
+
+Install this demo bundle (using the appropriate bundle version number)
+  
+  install -s mvn:org.apache.cxf.samples/jax_rs_tracing_brave_osgi/3.n.m
+
+You can verify if the CXF JAX-RS OpenZipkin Brave Blueprint Demo is installed and started.
+
+  karaf@root()> list
+  START LEVEL 100 , List Threshold: 50
+   ID | State  | Lvl | Version | Name                              
+  -----------------------------------------------------------------
+  117 | Active |  80 | 3.2.0.SNAPSHOT | JAX-RS Demo Using Distributed Tracing with OpenZipkin
Brave and OSGi
+  karaf@root()>
+
+Now, you will be able to access this CXF JAXRS demo service on your Karaf instance at
+
+  http://localhost:8181/cxf/catalog
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/pom.xml b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/pom.xml
new file mode 100644
index 0000000..85f7550
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/pom.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>jax_rs_tracing_brave_osgi</artifactId>
+    <name>JAX-RS Demo Using Distributed Tracing with OpenZipkin Brave and OSGi</name>
+    <description>JAX-RS Demo Using Distributed Tracing with OpenZipkin Brave and OSGi</description>
+    <packaging>bundle</packaging>
+    <parent>
+        <groupId>org.apache.cxf.samples</groupId>
+        <artifactId>cxf-samples</artifactId>
+        <version>3.2.0-SNAPSHOT</version>
+        <relativePath>../..</relativePath>
+    </parent>
+    <properties>
+        <cxf.version>${project.version}</cxf.version>
+        <httpclient.version>3.1</httpclient.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>3.2.0-SNAPSHOT</version>
+        </dependency>
+        <!-- This dependency is needed if you're using the Jetty container -->
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http-jetty</artifactId>
+            <version>3.2.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+            <version>3.2.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-rs-client</artifactId>
+            <version>3.2.0-SNAPSHOT</version>
+        </dependency>    
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-integration-tracing-brave</artifactId>
+            <version>3.2.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-rs-extension-providers</artifactId>
+            <version>3.2.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.json</groupId>
+            <artifactId>javax.json-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish</groupId>
+            <artifactId>javax.json</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+        </dependency>                
+        <dependency>
+            <groupId>javax.ws.rs</groupId>
+            <artifactId>javax.ws.rs-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-webapp</artifactId>
+        </dependency>
+    </dependencies>
+    
+     <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+                        <Import-Package>
+                            javax.ws.rs,
+                            javax.ws.rs.core,
+                            javax.ws.rs.container,
+                            org.apache.cxf.jaxrs.provider,
+                            org.apache.cxf.tracing.brave.jaxrs,
+                            org.osgi.service.blueprint,
+                            javax.annotation;version="[1.2,2)",
+                            *
+                        </Import-Package>
+                        <Export-Package>
+                        </Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/Catalog.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/Catalog.java
b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/Catalog.java
new file mode 100644
index 0000000..35110b2
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/Catalog.java
@@ -0,0 +1,135 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package demo.jaxrs.tracing.server;
+
+
+import java.io.IOException;
+import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import javax.json.Json;
+import javax.json.JsonObject;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.NotFoundException;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.cxf.tracing.Traceable;
+import org.apache.cxf.tracing.TracerContext;
+
+@Path("/catalog")
+public class Catalog {
+    private final ExecutorService executor = Executors.newFixedThreadPool(2);
+    private final CatalogStore store;
+    
+    public Catalog() {
+        store = new CatalogStore();
+    }
+    
+    @POST
+    @Produces(MediaType.APPLICATION_JSON)
+    public Response addBook(@Context final UriInfo uriInfo, @Context final TracerContext
tracing, 
+            @FormParam("title") final String title)  {
+        try {
+            final String id = UUID.randomUUID().toString();
+        
+            executor.submit(
+                tracing.wrap("Inserting New Book", 
+                    new Traceable<Void>() {
+                        public Void call(final TracerContext context) throws Exception {
+                            store.put(id, title);
+                            return null;
+                        }
+                    }
+                )
+            ).get(10, TimeUnit.SECONDS);
+            
+            return Response
+                .created(uriInfo.getRequestUriBuilder().path(id).build())
+                .build();
+        } catch (final Exception ex) {
+            return Response
+                .serverError()
+                .entity(Json
+                     .createObjectBuilder()
+                     .add("error", ex.getMessage())
+                     .build())
+                .build();
+        }
+    }
+    
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public void getBooks(@Suspended final AsyncResponse response, 
+            @Context final TracerContext tracing) throws Exception {
+        tracing.continueSpan(new Traceable<Void>() {
+            @Override
+            public Void call(final TracerContext context) throws Exception {
+                executor.submit(tracing.wrap("Looking for books", new Traceable<Void>()
{
+                    @Override
+                    public Void call(final TracerContext context) throws Exception {
+                        response.resume(store.scan());
+                        return null;
+                    }
+                }));
+                
+                return null;
+            }
+        });
+    }
+    
+    @GET
+    @Path("/{id}")
+    @Produces(MediaType.APPLICATION_JSON)
+    public JsonObject getBook(@PathParam("id") final String id) throws IOException {
+        final JsonObject book = store.get(id);
+        
+        if (book == null) {
+            throw new NotFoundException("Book with does not exists: " + id);
+        }
+        
+        return book;
+    }
+    
+    @DELETE
+    @Path("/{id}")
+    @Produces(MediaType.APPLICATION_JSON)
+    public Response delete(@PathParam("id") final String id) throws IOException {
+        if (!store.remove(id)) {
+            throw new NotFoundException("Book with does not exists: " + id);
+        }
+        
+        return Response.ok().build();
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/CatalogStore.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/CatalogStore.java
b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/CatalogStore.java
new file mode 100644
index 0000000..c102dfc
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/java/demo/jaxrs/tracing/server/CatalogStore.java
@@ -0,0 +1,71 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package demo.jaxrs.tracing.server;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonArrayBuilder;
+import javax.json.JsonObject;
+
+public class CatalogStore {
+    private final Map<String, String> books = new ConcurrentHashMap<>();
+    
+    public CatalogStore() {
+    }
+    
+    public boolean remove(final String key) throws IOException {
+        return (books.remove(key) != null);
+    }
+    
+    public JsonObject get(final String key) throws IOException {
+        final String title = books.get(key);
+        
+        if (title != null) {
+            return Json.createObjectBuilder()
+                .add("id", key)
+                .add("title", title)
+                .build();
+        }
+
+        return null;
+    }
+    
+    public void put(final String key, final String title) throws IOException {
+        books.put(key, title);
+    }
+    
+    public JsonArray scan() throws IOException {
+        final JsonArrayBuilder builder = Json.createArrayBuilder();
+        
+        for (final Map.Entry<String, String> entry: books.entrySet()) {
+            builder.add(Json.createObjectBuilder()
+                .add("id", entry.getKey())
+                .add("title", entry.getValue())
+            );
+        }
+        
+        return builder.build();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/resources/OSGI-INF/blueprint/context.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/resources/OSGI-INF/blueprint/context.xml
b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/resources/OSGI-INF/blueprint/context.xml
new file mode 100644
index 0000000..194f96e
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/tracing_brave_osgi/src/main/resources/OSGI-INF/blueprint/context.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<!-- START SNIPPET: blueprint -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:cxf="http://cxf.apache.org/blueprint/core"
+       xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
+
+       xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+                           http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
+                           http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd">
+
+    <!-- JAXRS providers -->
+    <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.jsrjsonp.JsrJsonpProvider"
/>
+
+    <bean id="braveFeature" class="org.apache.cxf.tracing.brave.jaxrs.BraveFeature">
+        <argument index="0" value="catalog-service" />
+    </bean>
+    
+    <!-- Application resources -->
+    <bean id="catalogResource" class="demo.jaxrs.tracing.server.Catalog" />
+
+    <!-- CXF BraveFeature -->  
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging />
+        </cxf:features>
+    </cxf:bus>
+
+    <jaxrs:server id="catalogServer" address="/">
+        <jaxrs:serviceBeans>
+            <ref component-id="catalogResource" />
+        </jaxrs:serviceBeans>
+        <jaxrs:providers>
+            <ref component-id="jsonProvider" />
+            <ref component-id="braveFeature" />
+        </jaxrs:providers>
+    </jaxrs:server>
+
+</blueprint>
+<!-- END SNIPPET: blueprint -->

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/distribution/src/main/release/samples/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/pom.xml b/distribution/src/main/release/samples/pom.xml
index 45746a0..3ede014 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -124,6 +124,7 @@
         <module>jax_rs/sse_tomcat</module>
         <module>jax_rs/sse_spring</module>
         <module>jax_rs/tracing_brave</module>
+        <module>jax_rs/tracing_brave_osgi</module>
     </modules>
     <dependencyManagement>
         <dependencies>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/integration/tracing/tracing-brave/pom.xml
----------------------------------------------------------------------
diff --git a/integration/tracing/tracing-brave/pom.xml b/integration/tracing/tracing-brave/pom.xml
index 74363bd..281c5d4 100644
--- a/integration/tracing/tracing-brave/pom.xml
+++ b/integration/tracing/tracing-brave/pom.xml
@@ -20,7 +20,7 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <artifactId>cxf-integration-tracing-brave</artifactId>
-    <packaging>jar</packaging>
+    <packaging>bundle</packaging>
     <name>Apache CXF Distributed Tracing using OpenZipkin Brave</name>
     <description>Apache CXF Distributed using OpenZipkin Brave</description>
     <url>http://cxf.apache.org</url>
@@ -33,7 +33,9 @@
     
     <properties>
         <cxf.osgi.export>
-            org.apache.cxf.tracing
+            org.apache.cxf.tracing,
+            org.apache.cxf.tracing.brave,
+            org.apache.cxf.tracing.brave.jaxrs
         </cxf.osgi.export>
     </properties>
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
----------------------------------------------------------------------
diff --git a/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
b/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
index f3e4468..8fdc1da 100644
--- a/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
+++ b/integration/tracing/tracing-brave/src/main/java/org/apache/cxf/tracing/brave/jaxrs/BraveFeature.java
@@ -18,6 +18,8 @@
  */
 package org.apache.cxf.tracing.brave.jaxrs;
 
+import java.util.UUID;
+
 import javax.ws.rs.core.Feature;
 import javax.ws.rs.core.FeatureContext;
 
@@ -27,7 +29,7 @@ public class BraveFeature implements Feature {
     private final Brave brave;
     
     public BraveFeature() {
-        this("");
+        this("cxf-svc-" + UUID.randomUUID().toString());
     }
     
     public BraveFeature(final String name) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/e636c50b/osgi/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/osgi/karaf/features/src/main/resources/features.xml b/osgi/karaf/features/src/main/resources/features.xml
index 32fc76d..c9c4f99 100644
--- a/osgi/karaf/features/src/main/resources/features.xml
+++ b/osgi/karaf/features/src/main/resources/features.xml
@@ -276,6 +276,17 @@
         <bundle start-level="35">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/${cxf.jackson.version}</bundle>
         <bundle start-level="35">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${cxf.jackson.version}</bundle>
     </feature>
+    <feature name="cxf-jsr-json" version="${project.version}">
+        <bundle start-level="35">mvn:javax.json/javax.json-api/${cxf.json.api.version}</bundle>
+        <bundle start-level="35">mvn:org.glassfish/javax.json/${cxf.glassfish.json.version}</bundle>
+    </feature>
+    <feature name="cxf-tracing-brave" version="${project.version}">
+        <bundle start-level="35">mvn:io.zipkin.java/zipkin/1.16.2</bundle>
+        <bundle start-level="35">mvn:io.zipkin.reporter/zipkin-reporter/0.6.9</bundle>
+        <bundle start-level="35">mvn:io.zipkin.brave/brave-core/${cxf.brave.version}</bundle>
+        <bundle start-level="35">mvn:io.zipkin.brave/brave-http/${cxf.brave.version}</bundle>
+        <bundle start-level="40">mvn:org.apache.cxf/cxf-integration-tracing-brave/${project.version}</bundle>
+    </feature>
     <feature name="cxf-rs-description-swagger2" version="${project.version}">
         <feature version="${project.version}">cxf-jaxrs</feature>
         <feature version="${project.version}">cxf-jackson</feature>


Mime
View raw message