Pluggable cluster discovery
jbertram May 2, 2012 1:26 PMTomo (igarashitm in IRC) has done some work to make cluster discovery pluggable so that we can use e.g., JGroups. Using JGroups will allow us to cluster in environments like Amazon's AWS, among other things.
His work is in Git here.
It is a fairly large change so Clebert asked me to summarize what Tomo added/changed...
- Replace the existing ServerLocator implementation (org.hornetq.core.client.impl.ServerLocator) with an abstract version (org.hornetq.core.client.impl.AbstractServerLocator). This abstract version is now extended by these:
- org.hornetq.core.client.impl.StaticServerLocatorImpl
- org.hornetq.core.client.impl.UDPServerLocatorImpl
- org.hornetq.integration.discovery.jgroups.JGroupsServerLocatorImpl
- Added org.hornetq.core.server.cluster.impl.ClusterConnector which is implemented by these:
- org.hornetq.core.server.cluster.impl.StaticClusterConnectorImpl
- org.hornetq.core.server.cluster.impl.UDPDiscoveryClusterConnectorImpl
- org.hornetq.integration.discovery.jgroups.JGroupsDiscoveryClusterConnectorImpl
- Added a new Maven module: hornetq-jgroups-discovery (which includes everything in the org.hornetq.integration.discovery.jgroups package).
- The <broadcast-group> configuration element no longer accepts <local-bind-address>, <local-bind-port>, <group-address>, <group-port>, or <broadcast-period> directly. Instead one specifies <broadcast-type> and an arbitrary number of param elements. The broadcast-type can be either:
- UDP
- JGROUPS
- A UDP broadcast-type accepts params with these keys (same semantics as before):
- local-bind-address
- local-bind-port
- group-address
- group-port
- broadcast-period
- A JGROUPS broadcast-type accepts params with these keys:
- jgroups-configuration-file (defaults to null - user must supply this)
- broadcast-period (defaults to "5000")
- jgroups-channel-name (defaults to "hornetq-jgroups-channel")
- The <discovery-group> configuration element no longer accepts <local-bind-address>, <group-address>, <group-port>, <refresh-timeout>, or <initial-wait-timeout> directly. Instead one specifies discovery-type and an arbitrary number of <param> elements. The discovery-type can be either:
- STATIC
- UDP
- JGROUPS
- A STATIC discovery-group accepts params with these keys:
- static-connector-names (comma delimited list of connectors)
- A UDP discovery-group accepts params with these keys (same semantics as before):
- local-bind-address
- group-address
- group-port
- refresh-timeout
- initial-wait-timeout
- A JGROUPS discovery-group accepts params with these keys:
- jgroups-configuration-file (defaults to null - user must supply this)
- initial-wait-timeout (defaults to "10000")
- refresh-timeout (defaults to "10000")
- jgroups-channel-name (defaults to "hornetq-jgroups-channel")
- The <bridge> and <cluster-connection> have changed in that they don't take <static-connectors> (since the <discovery-group> itself now can be STATIC). It simply takes a <discovery-group-ref>.
What's left?
- Real documentation.
- Actual configuration examples.
Does anybody see problems and/or gaps in the implementation?