cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache CXF Documentation > FailoverFeature
Date Thu, 01 Aug 2013 11:15:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/1/_/styles/combined.css?spaceKey=CXF20DOC&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CXF20DOC/FailoverFeature">FailoverFeature</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~sergey_beryozkin">Sergey
Beryozkin</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <p><span style="font-size:2em;font-weight:bold"> Failover and Load Distributor
Features </span></p>

<div>
<ul>
    <li><a href='#FailoverFeature-Failover'>Failover</a></li>
    <li><a href='#FailoverFeature-LoadDistribution'>Load Distribution</a></li>
    <li><a href='#FailoverFeature-ConfiguringJAXRSclients'>Configuring JAX-RS
clients</a></li>
<ul>
    <li><a href='#FailoverFeature-JAXRS'>JAX-RS</a></li>
</ul>
</ul></div>

<h1><a name="FailoverFeature-Failover"></a>Failover </h1>

<p>The CXF Failover feature allows to configure CXF frontend clients to retry a call
when the target endpoint becomes unavailable.<br/>
A number of retry strategies available: a client can iterate sequentially over the alternative
addresses or chose them randomly.  </p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">

&lt;beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:clustering="http://cxf.apache.org/clustering"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"&gt;
    &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
    
    &lt;util:list id="addressList"&gt;
        &lt;value&gt;http://localhost:${testutil.ports.Server.1}/services1&lt;/value&gt;
        &lt;value&gt;http://localhost:${testutil.ports.Server.2}/services2&lt;/value&gt;
        &lt;value&gt;http://localhost:${testutil.ports.Server.3}/services3&lt;/value&gt;
    &lt;/util:list&gt;

    &lt;bean id="SequentialAddresses" class="org.apache.cxf.clustering.SequentialStrategy"&gt;
        &lt;property name="alternateAddresses"&gt;
            &lt;ref bean="addressList"/&gt;
        &lt;/property&gt;
    &lt;/bean&gt;

    &lt;bean id="RandomAddresses" class="org.apache.cxf.clustering.RandomStrategy"&gt;
        &lt;property name="alternateAddresses"&gt;
            &lt;ref bean="addressList"/&gt;
        &lt;/property&gt;
    &lt;/bean&gt;

    &lt;!-- other jaxws:client attributes and elements are omitted for brewity --&gt;
    
    &lt;jaxws:client id="clientWithSeqFailoverSupport" address="http://localhost:8080/services"&gt;
       &lt;jaxws:features&gt;
           &lt;clustering:failover&gt;
                &lt;clustering:strategy&gt;
                    &lt;ref bean="SequentialAddresses"/&gt;
                &lt;/clustering:strategy&gt;
            &lt;/clustering:failover&gt;
       &lt;/jaxws:features&gt;
    &lt;/jaxws:client&gt;

    &lt;!-- other jaxws:client attributes and elements are omitted for brewity --&gt;

    &lt;jaxws:client id="clientWithRandomFailoverSupport" address="http://localhost:8080/initialAddress"&gt;
       &lt;jaxws:features&gt;
           &lt;clustering:failover&gt;
                &lt;clustering:strategy&gt;
                    &lt;ref bean="RandomAddresses"/&gt;
                &lt;/clustering:strategy&gt;
            &lt;/clustering:failover&gt;
       &lt;/jaxws:features&gt;
    &lt;/jaxws:client&gt;

&lt;/beans&gt;
</pre>
</div></div>

<h1><a name="FailoverFeature-LoadDistribution"></a>Load Distribution</h1>

<p>Load Distributor Feature is a Failover feature which can allow the clients to iterate
over alternative addresses on every new call, irrespectively of whether the last call has
reached its target or not. It can help with the controlling the traffic originating from CXF
clients at individual servers. </p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family:
ConfluenceInstalledFont,monospace;">

&lt;beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:clustering="http://cxf.apache.org/clustering"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"&gt;
    &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
    
    &lt;util:list id="addressList"&gt;
        &lt;value&gt;http://localhost:${testutil.ports.Server.1}/services1&lt;/value&gt;
        &lt;value&gt;http://localhost:${testutil.ports.Server.2}/services2&lt;/value&gt;
        &lt;value&gt;http://localhost:${testutil.ports.Server.3}/services3&lt;/value&gt;
    &lt;/util:list&gt;

    &lt;bean id="SequentialAddresses" class="org.apache.cxf.clustering.SequentialStrategy"&gt;
        &lt;property name="alternateAddresses"&gt;
            &lt;ref bean="addressList"/&gt;
        &lt;/property&gt;
    &lt;/bean&gt;

    &lt;!-- other jaxws:client attributes and elements are omitted for brewity --&gt;
    
    &lt;jaxws:client id="clientWithLoadDistributor" address="http://localhost:8080/services"&gt;
       &lt;jaxws:features&gt;
           &lt;clustering:loadDistributor&gt;
                &lt;clustering:strategy&gt;
                    &lt;ref bean="SequentialAddresses"/&gt;
                &lt;/clustering:strategy&gt;
            &lt;/clustering:loadDistributor&gt;
       &lt;/jaxws:features&gt;
    &lt;/jaxws:client&gt;
&lt;/beans&gt;
</pre>
</div></div>

<h1><a name="FailoverFeature-ConfiguringJAXRSclients"></a>Configuring JAX-RS
clients</h1>

<h2><a name="FailoverFeature-JAXRS"></a>JAX-RS</h2>

<p>JAX-RS clients are configured exactly as JAX-WS clients are, please see <a href="/confluence/pages/createpage.action?spaceKey=CXF20DOC&amp;title=JAX-RS%2BFailover&amp;linkCreation=true&amp;fromPageId=33298616"
class="createlink">this page</a> for more info.</p>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CXF20DOC">Stop
watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change
email notification preferences</a>
</div>
       <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/FailoverFeature">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/FailoverFeature?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message