CXF Clustering and Failover feature in EAP
Issue
- We are trying to implement auto fail over and fail back of CXF SOAP calls from a primary to a secondary URL and would like to use the built in CXF failover with a custom circuit switcher written on top of CXF fali over.
JBoss EAP 6 does bundles a version of CXF 2.7.14 a module org.apache.cxf.impl. It seems to be missing jar cxf-rt-features-clustering-2.7.14.jar which allows for auto fail over of SOAP calls from primary to secondary URLs. So we have added a custom module for the feature clustering jar (enclosed) as:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.cxf.cxf-rt-features-clustering">
<resources>
<resource-root path="cxf-rt-features-clustering-2.7.14.jar"></resource>
</resources>
<!--<dependencies>
<module name="javax.api" ></module>
</dependencies>-->
</module>
- Also we want to have auto fail back to a primary URL. This is not supported in CXF feature clustering as it only supports fail over. So we also have added another jar
cxf-circuit-switcher-1.0.jarto implement a Circuit breaker model with fail back to primary. This module (enclosed) is setup as:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.github.jaceko.cxf.cxf-circuit-switcher">
<resources>
<resource-root path="cxf-circuit-switcher-1.0.jar"></resource>
</resources>
<dependencies>
<module name="org.apache.cxf" ></module>
<module name="org.apache.cxf.cxf-rt-features-clustering" ></module>
<module name="org.slf4j" ></module>
</dependencies>
</module>
- The ear we deploy which references these has a
jboss-deployment-description.xmlfile (enclosed) that references the JBoss CXF as well as the circuit switcher.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
- JBossWS-CXF
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.