[id='ref_relay_custom-{context}']
= Custom JGroups RELAY2 Stacks

The following configuration adds a custom RELAY2 stack that extends the default TCP stack:

[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/jgroups_custom_relay_extends.xml[]
----

You can also reference externally defined JGroups stack files, for example:

[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/jgroups_custom_relay_external.xml[]
----

Where `jgroups-relay.xml` references a JGroups stack file such as:

[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/jgroups_custom_relay.xml[]
----

.Reference

* link:{server_docs}#setting_up_clusters[Setting Up {brandname} Clusters]
* link:{jgroups_docs}#RELAY2[JGroups RELAY2]
* link:{jgroups_docs}#Relay2Advanced[Relaying between multiple sites (RELAY2)]
