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/12/26 20:47:40 UTC
svn commit: r976445 - in /websites/production/cxf/content:
cache/docs.pageCache docs/using-cxf-and-failover-in-osgi-environment.html
Author: buildbot
Date: Sat Dec 26 19:47:40 2015
New Revision: 976445
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/using-cxf-and-failover-in-osgi-environment.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/using-cxf-and-failover-in-osgi-environment.html
==============================================================================
--- websites/production/cxf/content/docs/using-cxf-and-failover-in-osgi-environment.html (original)
+++ websites/production/cxf/content/docs/using-cxf-and-failover-in-osgi-environment.html Sat Dec 26 19:47:40 2015
@@ -28,6 +28,15 @@
<meta name="description" content="Apache CXF, Services Framework - Using CXF and Failover in OSGi environment">
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
+
+<script src='/resources/highlighter/scripts/shCore.js'></script>
+<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
+<script>
+ SyntaxHighlighter.defaults['toolbar'] = false;
+ SyntaxHighlighter.all();
+</script>
<title>
@@ -107,7 +116,50 @@ Apache CXF -- Using CXF and Failover in
<td height="100%">
<!-- Content -->
<div class="wiki-content">
-<div id="ConfluenceContent"></div>
+<div id="ConfluenceContent"><h1 id="UsingCXFandFailoverinOSGienvironment-Introduction">Introduction</h1><p>Apache CXF <a shape="rect" href="jax-rs-failover.html">JAX-RS</a> and <a shape="rect" href="failoverfeature.html">JAX-WS</a> clients can be configured to become failover-capable. Core CXF Failover and Load Distribution features are supported. It is also supported by OSGi blueprints, including the recent failover implementation based on circuit breakers. We are going to illustrate the typical example of using OSGi blueprint for registering failover-aware clients in Apache Karaf 4.0.x container.</p><h1 id="UsingCXFandFailoverinOSGienvironment-Prerequisites">Prerequisites</h1><p>As our example is going to be based on circuit breakers failover, there are a couple of features and additional bundles required to be installed.</p><div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>feature:install cxf-jaxws cxf-features-clustering
+
+install -s mvn:org.apache.cxf.samples/failover_server
+install -s mvn:org.apache.cxf.samples/failover_jaxws_osgi
+install -s wrap:mvn:org.codeartisans/org.json/20130213
+install -s mvn:joda-time/joda-time/2.8.1
+install -s mvn:org.qi4j.core/org.qi4j.core.functional/2.1
+install -s mvn:org.qi4j.core/org.qi4j.core.api/2.1
+install -s mvn:org.qi4j.core/org.qi4j.core.io/2.1
+install -s mvn:org.qi4j.core/org.qi4j.core.spi/2.1
+install -s mvn:org.qi4j.core/org.qi4j.core.bootstrap/2.1
+install -s mvn:org.qi4j.library/org.qi4j.library.jmx/2.1
+install -s mvn:org.qi4j.library/org.qi4j.library.circuitbreaker/2.1</pre>
+</div></div><h1 id="UsingCXFandFailoverinOSGienvironment-BlueprintConfiguration">Blueprint Configuration</h1><p>Once all prerequisites are installed, the configuration becomes really trivial, for example here is the OSGi blueprint snippet which registers <a shape="rect" href="failoverfeature.html">JAX-WS</a>  failover-aware client. Although it uses <strong>circuit-breaker-failover</strong>, the way to register regular <strong>failover</strong> and <strong>loadDistribution </strong>features is very similar.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
+ xmlns:clustering="http://cxf.apache.org/clustering"
+ 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">
+
+ <service ref="sampleServiceProxy"
+ interface="org.apache.cxf.samples.failover.jaxws.SampleService" />
+
+ <jaxws:client id="sampleServiceProxy" serviceClass="org.apache.cxf.samples.failover.jaxws.SampleService">
+ <jaxws:features>
+ <clustering:circuit-breaker-failover>
+ <clustering:strategy>
+ <bean id="strategy" class="org.apache.cxf.clustering.SequentialStrategy">
+ <property name="alternateAddresses">
+ <list id="alternateAddresses" value-type="java.lang.String">
+ <value>http://localhost:8181/cxf/sample</value>
+ <value>http://localhost:8282/cxf/sample</value>
+ </list>
+ </property>
+ </bean>
+ </clustering:strategy>
+ </clustering:circuit-breaker-failover>
+ </jaxws:features>
+ </jaxws:client>
+</blueprint></pre>
+</div></div><h1 id="UsingCXFandFailoverinOSGienvironment-Samples">Samples</h1><p>There are sample projects available: <strong>distribution\src\main\release\samples\clustering\failover_jaxws_osgi</strong></p></div>
</div>
<!-- Content -->
</td>