You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2015/09/16 02:47:34 UTC

svn commit: r965603 - in /websites/production/cxf/content: cache/docs.pageCache docs/using-apache-htrace.data/image2015-9-15-20:44:20.png docs/using-apache-htrace.html

Author: buildbot
Date: Wed Sep 16 00:47:34 2015
New Revision: 965603

Log:
Production update by buildbot for cxf

Added:
    websites/production/cxf/content/docs/using-apache-htrace.data/image2015-9-15-20:44:20.png   (with props)
Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/using-apache-htrace.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Added: websites/production/cxf/content/docs/using-apache-htrace.data/image2015-9-15-20:44:20.png
==============================================================================
Binary file - no diff available.

Propchange: websites/production/cxf/content/docs/using-apache-htrace.data/image2015-9-15-20:44:20.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Modified: websites/production/cxf/content/docs/using-apache-htrace.html
==============================================================================
--- websites/production/cxf/content/docs/using-apache-htrace.html (original)
+++ websites/production/cxf/content/docs/using-apache-htrace.html Wed Sep 16 00:47:34 2015
@@ -117,11 +117,11 @@ Apache CXF -- Using Apache HTrace
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1442281603294 {padding: 0px;}
-div.rbtoc1442281603294 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1442281603294 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1442364417969 {padding: 0px;}
+div.rbtoc1442364417969 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1442364417969 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1442281603294">
+/*]]>*/</style></p><div class="toc-macro rbtoc1442364417969">
 <ul class="toc-indentation"><li><a shape="rect" href="#UsingApacheHTrace-Overview">Overview</a></li><li><a shape="rect" href="#UsingApacheHTrace-DistributedTracinginNutshell">Distributed Tracing in Nutshell</a></li><li><a shape="rect" href="#UsingApacheHTrace-DistributedTracinginApacheCXF">Distributed Tracing in Apache CXF</a></li><li><a shape="rect" href="#UsingApacheHTrace-ConfiguringClientconfigure.client">Configuring Client</a></li><li><a shape="rect" href="#UsingApacheHTrace-ConfiguringServerconfigure.server">Configuring Server</a></li><li><a shape="rect" href="#UsingApacheHTrace-DistributedTracingInAction:UsageScenarios">Distributed Tracing In Action: Usage Scenarios</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#UsingApacheHTrace-Example#1:ClientandServerwithdefaultdistributedtracingconfigured">Example #1: Client and Server with default distributed tracing configured</a></li><li><a shape="rect" href="#UsingApacheHTrace-Example#2:ClientandServerwithnestedtrace">Example #2: Client and Server with nested trace</a></li><li><a shape="rect" href="#UsingApacheHTrace-Example#3:ClientandServertracewithtimeline">Example #3: Client and Server trace with timeline</a></li><li><a shape="rect" href="#UsingApacheHTrace-Example#4:ClientandServerwithannotatedtrace(key/value)">Example #4: Client and Server with annotated trace (key/value)</a></li><li><a shape="rect" href="#UsingApacheHTrace-Example#5:ClientandServerwithparalleltrace(involvingthreadpools)">Example #5: Client and Server with parallel trace (involving thread pools)</a></li><li><a shape="rect" href="#UsingApacheHTrace-Example#6:ClientandServerwithasynchronousJAX-RSservice(server-side)">Exampl
 e #6: Client and Server with asynchronous JAX-RS service (server-side)</a></li></ul>
 </li></ul>
@@ -223,7 +223,37 @@ public Collection&lt;Book&gt; getBooks(@
     tracer.annotate("# of books", Integer.toString(books.size()));
     return books;
 }</pre>
-</div></div><p>The actual invocation of the request by the client (with process name <strong><span class="label label-default service-filter-label service-tag-filtered">jaxrsclient/192.168.0.100</span></strong>) and consequent invocation of the service on the server side (process name<strong> <span class="label label-default service-filter-label">jaxrsserver/192.168.0.100</span></strong>) is going to generate the following sample server trace properties:</p><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="using-apache-htrace.data/image2015-9-14%2021:11:56.png"></span></p><h2 id="UsingApacheHTrace-Example#5:ClientandServerwithparalleltrace(involvingthreadpools)">Example #5: Client and Server with parallel trace (involving thread pools)</h2><p>TODO</p><h2 id="UsingApacheHTrace-Example#6:ClientandServerwithasynchronousJAX-RSservice(server-side)">Example #6: Client and Server with asynchronous JAX-
 RS service (server-side)</h2><p>TODO</p></div>
+</div></div><p>The actual invocation of the request by the client (with process name <strong><span class="label label-default service-filter-label service-tag-filtered">jaxrsclient/192.168.0.100</span></strong>) and consequent invocation of the service on the server side (process name<strong> <span class="label label-default service-filter-label">jaxrsserver/192.168.0.100</span></strong>) is going to generate the following sample server trace properties:</p><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="using-apache-htrace.data/image2015-9-14%2021:11:56.png"></span></p><h2 id="UsingApacheHTrace-Example#5:ClientandServerwithparalleltrace(involvingthreadpools)">Example #5: Client and Server with parallel trace (involving thread pools)</h2><p>In this example server-side implementation of the JAX-RS service is going to offload some work into thread pool and then return the response to the client,
  simulating parallel execution. The client-side code stays unchanged.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Produces( { MediaType.APPLICATION_JSON } )
+@GET
+public Collection&lt;Book&gt; getBooks(@Context final TracerContext tracer) throws Exception {
+    final Future&lt;Book&gt; book1 = executor.submit(
+        tracer.wrap("Getting Book 1", new Traceable&lt;Book&gt;() {
+            public Book call(final TracerContext context) throws Exception {
+                // Simulating a delay of 100ms required to call external system
+                Thread.sleep(100);
+                    
+                return new Book("Apache CXF Web Service Development", 
+                    "Naveen Balani, Rajeev Hathi");
+            }
+        })
+    );
+        
+    final Future&lt;Book&gt; book2 = executor.submit(
+        tracer.wrap("Getting Book 2", new Traceable&lt;Book&gt;() {
+            public Book call(final TracerContext context) throws Exception {
+                // Simulating a delay of 100ms required to call external system
+                Thread.sleep(200);
+                    
+                return new Book("Developing Web Services with Apache CXF and Axis2", 
+                    "Kent Ka Iok Tong");
+            }
+        })
+    );
+       
+    return Arrays.asList(book1.get(), book2.get());
+}</pre>
+</div></div><p>The actual invocation of the request by the client (with process name <strong><span class="label label-default service-filter-label service-tag-filtered">jaxrsclient/192.168.0.100</span></strong>) and consequent invocation of the service on the server side (process name<strong> <span class="label label-default service-filter-label">jaxrsserver/192.168.0.100</span></strong>) is going to generate the following sample traces:</p><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="using-apache-htrace.data/image2015-9-15%2020:44:20.png"></span></p><h2 id="UsingApacheHTrace-Example#6:ClientandServerwithasynchronousJAX-RSservice(server-side)">Example #6: Client and Server with asynchronous JAX-RS service (server-side)</h2><p>TODO</p></div>
            </div>
            <!-- Content -->
          </td>