In order to accomplish this cluster singleton pattern, Broadleaf employs the use of Apache’s
CamelClusterService allowing you to configure a number of backing Cluster SPI implementations out-of-the-box (e.g.
Broadleaf provides example configuration and support for the following implementations:
See the following classes for more details:
Broadleaf services by default have the
FileLockClusterService implementation configured. This is suitable for LOCAL development outside the use of Kubernetes.
You may notice the following
WARNING emitted to your logs if the system is still configured to use
file on a non-local environment:
***** WARNING - broadleaf.messaging.cluster-service-implementation-type is set to `file`. This prevents cluster detection beyond a single node, which is only appropriate for local development. This value should be changed to `kubernetes` or `zookeeper` (usually `kubernetes` via manifest environment variable when deploying to k8s). *****
As of Broadleaf
1.5.x, we have deprecated the use of
org.apache.camel.component.jgroups.cluster.JGroupsLockClusterService as the default (in favor of the
JGroups might be an adequate solution for some setups, there is some significant configuration that would need to be done to fully support it.
JGroups utilizes UDP Multi-casting to achieve communication between the nodes. This mechanism is not fully supported in a lot of cloud environments without additional networking configuration and setup. Instead, we recommend configuring the
KubernetesClusterService or the
ZooKeeperClusterService for non-local deployments
As we provide the a lot of support for deploying the Microservices stack to a Kubernetes cluster, it makes sense to utilize Kubernetes’s built in APIs to co-ordinate
leader/member setups within replicas in a cluster using Apache’s default
In order to tell Broadleaf to change from a
File-based implementation to a
Kubernetes-based implementation, you can pass in the following
ENV overrides in your deployment:
<unique name for each deployment> (e.g.
supporting if deploying the
Balanced Flex Package Composition or
campaign, etc… if deploying the
WARN (optional, but helpful to debug any connectivity issues)
Our default Helm charts are already configured to supply the necessary
ENV overrides to switch the
CamelClusterService to use
Kubernetes instead of the default
File based implementation