diff --git a/REFERENCE.md b/REFERENCE.md index 6f1dc2a..b557320 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -407,6 +407,7 @@ The following parameters are available in the `activemq::instance` defined type: * [`address_settings`](#-activemq--instance--address_settings) * [`addresses`](#-activemq--instance--addresses) * [`allow_failback`](#-activemq--instance--allow_failback) +* [`allow_direct_connections_only`](#-activemq--instance--allow_direct_connections_only) * [`bind`](#-activemq--instance--bind) * [`broadcast_groups`](#-activemq--instance--broadcast_groups) * [`broker_plugins`](#-activemq--instance--broker_plugins) @@ -478,6 +479,16 @@ Data type: `Boolean` Should stop backup on live restart. +##### `allow_direct_connections_only` + +Data type: `Optional[Boolean]` + +When using `static` for [`server_discovery`](#-activemq--server_discovery) +only make connections to the defined connectors and not any other +broker in the cluser. + +Default value: `true` + ##### `bind` Data type: `String` diff --git a/manifests/instance.pp b/manifests/instance.pp index f5ab554..4aa4ee9 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -20,6 +20,10 @@ # @param allow_failback # Should stop backup on live restart. # +# @param allow_direct_connections_only +# When using static server discovery only make connections to the +# defined connectors and not any other broker in the cluser. +# # @param bind # Configure which IP address to listen on. Should be either a FQDN # or an IP address. @@ -167,6 +171,7 @@ String $java_xms = $activemq::java_xms, String $java_xmx = $activemq::java_xmx, # Optional parameters + Optional[Boolean] $allow_direct_connections_only = true, Optional[Integer] $global_max_size_mb = undef, Optional[String] $group = undef, Optional[Boolean] $service_enable = undef, @@ -379,6 +384,7 @@ 'address_settings' => $address_settings, 'addresses' => $addresses, 'allow_failback' => $allow_failback, + 'allow_direct_connections_only' => $allow_direct_connections_only, 'bind' => $bind, 'broadcast_groups' => $broadcast_groups, 'broker_plugins' => $_broker_plugins, diff --git a/templates/broker.xml.epp b/templates/broker.xml.epp index 41a32d6..b3dcd16 100644 --- a/templates/broker.xml.epp +++ b/templates/broker.xml.epp @@ -148,9 +148,12 @@ under the License. <%= $message_load_balancing %> <%= $max_hops %> <% if $activemq::server_discovery == 'static' { -%> - + <% $connectors.each |$key, $value| { -%> +<%# # Do not add the connector that matches the name of this instance. -%> +<% if ($key != "artemis-${name}") { -%> <%= $key %> +<% } -%> <% } -%> <% } -%>