Red Hat Training

A Red Hat training course is available for Red Hat Fuse

15.4. Enabling Clustering in your SwitchYard Application

To configure a cluster:
  • Start two or more instances on different nodes.
  • Indicate the services that are clustered in the switchyard.xml file.
Note
By default, SwitchYard uses the default cache in the cluster cache container which comes pre-defined in the standalone-ha.xml file.
You can control the services in the application that can be published in the cluster's runtime registry and the references that can be resolved by clustered services.
To enable a service to be published in the cluster's runtime registry, promote the service in the application and add a <binding.sca> with clustering enabled to it.
<sca:service name="Goodbye" promote="GoodbyeBean/Goodbye">   
  <sca:interface.java interface="com.example.Goodbye"/>
  <sca:binding.sca sy:clustered="true"/>
</sca:service>
To invoke a service in a cluster, promote the reference and add an SCA binding with clustering enabled.
<sca:reference name="Goodbye" multiplicity="0..1" promote="GreetingBean/Goodbye">
  <sca:interface.java interface="com.example.Goodbye"/>
  <sca:binding.sca sy:clustered="true"/>
</sca:reference>