Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
// Configure the spans transport sender
final Sender sender = ...; 

/**
 * For example:
 *
 * final Sender sender = LibthriftSender.create("localhost");; 
 */
        
final BraveTracing brave = new Brave.Builder Tracing
    .newBuilder()
    .localServiceName("tracer")
    .reporter(AsyncReporter.builder(sender).build())
    .traceSampler(Sampler.ALWAYS_SAMPLE) /* or any other Sampler */ 
    .build();
             
final JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean();
...
sf.getFeatures().add(new BraveClientFeature(brave));
...
sf.create();

...

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<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:jaxws="http://cxf.apache.org/blueprint/jaxws"

       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/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd">

    <!-- CXF BraveFeature -->
    <bean id="braveFeature" class="org.apache.cxf.tracing.brave.BraveFeature">
        <argument index="0" ref="brave" />
    </bean>
    
    <cxf:bus>
        <cxf:features>
            <cxf:logging />
        </cxf:features>
    </cxf:bus>
    
    <bean id="catalogServiceImpl" class="demo.jaxws.tracing.server.impl.CatalogServiceImpl">
        <argument index="0" ref="brave" />
    </bean>
    
    <bean id="braveBuilder" class="com.github.kristofa.brave.Brave.Builderbrave.Tracing" factory-method="newBuilder" />
   
    <bean id="braveCatalogBuilder" factory-ref="braveBuilder" factory-method="localServiceName">
        <argument index="0" value="catalog-service" />
    </bean>
    
    <bean id="brave" factory-ref="braveBuilderbraveCatalogBuilder" factory-method="build" />
    
    <jaxws <jaxws:endpoint
        implementor="#catalogServiceImpl"
        address="/catalog"
        implementorClass="demo.jaxws.tracing.server.impl.CatalogServiceImpl">
        <jaxws:features>
            <ref component-id="braveFeature" />
        </jaxws:features>
    </jaxws:endpoint>
</blueprint>

...