<?xml version='1.0' encoding='UTF-8'?>
<!-- See src/resources/configuration/ReadMe.txt for how the configuration assembly works -->
<config default-supplement="default">
    <extension-module>org.jgroups.extension</extension-module>
    <subsystem xmlns="urn:infinispan:server:jgroups:${infinispan.core.schema.version}">
        <channels default="cluster">
            <channel name="cluster" />
            <?CHANNELS?>
        </channels>
        <stacks default="${jboss.default.jgroups.stack:tcp-gossip}">
            <stack name="tcp-gossip">
                <?TCP-TRANSPORT?>
                <protocol type="TCPGOSSIP">
                   <property name="initial_hosts">${jgroups.gossip.initial_hosts:}</property>
                </protocol>
                <protocol type="MERGE3" />
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd" />
                <protocol type="FD_ALL" />
                <protocol type="VERIFY_SUSPECT" />
                <protocol type="pbcast.NAKACK2">
                   <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3" />
                <protocol type="pbcast.STABLE" />
                <protocol type="pbcast.GMS" />
                <protocol type="MFC" />
                <?AUTH?>
            </stack>
            <stack name="azure">
                <?TCP-TRANSPORT?>
                <protocol type="azure.AZURE_PING">
                    <property name="storage_account_name">${jgroups.azure.storage_account_name:}</property>
                    <property name="storage_access_key">${jgroups.azure.storage_access_key:}</property>
                    <property name="container">${jgroups.azure.container:}</property>
                </protocol>
                <protocol type="MERGE3" />
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd" />
                <protocol type="FD_ALL" />
                <protocol type="VERIFY_SUSPECT" />
                <protocol type="pbcast.NAKACK2">
                    <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3" />
                <protocol type="pbcast.STABLE" />
                <protocol type="pbcast.GMS" />
                <protocol type="MFC" />
                <protocol type="FRAG3" />
            </stack>
            <stack name="s3-private">
                <?TCP-TRANSPORT?>
                <protocol type="S3_PING">
                    <property name="location">${jgroups.s3.bucket:}</property>
                    <property name="access_key">${jgroups.s3.access_key:}</property>
                    <property name="secret_access_key">${jgroups.s3.secret_access_key:}</property>
                </protocol>
                <protocol type="MERGE3" />
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd" />
                <protocol type="FD_ALL" />
                <protocol type="VERIFY_SUSPECT" />
                <protocol type="pbcast.NAKACK2">
                    <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3" />
                <protocol type="pbcast.STABLE" />
                <protocol type="pbcast.GMS" />
                <protocol type="MFC" />
                <protocol type="FRAG3" />
            </stack>
            <stack name="s3-presigned">
                <?TCP-TRANSPORT?>
                <protocol type="S3_PING">
                    <property name="pre_signed_delete_url">${jgroups.s3.pre_signed_delete_url:}</property>
                    <property name="pre_signed_put_url">${jgroups.s3.pre_signed_put_url:}</property>
                </protocol>
                <protocol type="MERGE3" />
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd" />
                <protocol type="FD_ALL" />
                <protocol type="VERIFY_SUSPECT" />
                <protocol type="pbcast.NAKACK2">
                    <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3" />
                <protocol type="pbcast.STABLE" />
                <protocol type="pbcast.GMS" />
                <protocol type="MFC" />
                <protocol type="FRAG3" />
            </stack>
            <stack name="s3-public">
                <?TCP-TRANSPORT?>
                <protocol type="S3_PING">
                    <property name="location">${jgroups.s3.bucket:}</property>
                </protocol>
                <protocol type="MERGE3" />
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd" />
                <protocol type="FD_ALL" />
                <protocol type="VERIFY_SUSPECT" />
                <protocol type="pbcast.NAKACK2">
                    <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3" />
                <protocol type="pbcast.STABLE" />
                <protocol type="pbcast.GMS" />
                <protocol type="MFC" />
                <protocol type="FRAG3" />
            </stack>
            <stack name="google">
                <?TCP-TRANSPORT?>
                <protocol type="GOOGLE_PING">
                    <property name="location">${jgroups.google.bucket:}</property>
                    <property name="access_key">${jgroups.google.access_key:}</property>
                    <property name="secret_access_key">${jgroups.google.secret_access_key:}</property>
                </protocol>
                <protocol type="MERGE3" />
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd" />
                <protocol type="FD_ALL" />
                <protocol type="VERIFY_SUSPECT" />
                <protocol type="pbcast.NAKACK2">
                    <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3" />
                <protocol type="pbcast.STABLE" />
                <protocol type="pbcast.GMS" />
                <protocol type="MFC" />
                <protocol type="FRAG3" />
            </stack>
            <stack name="kubernetes">
                <transport type="TCP" socket-binding="jgroups-tcp" >
                    <property name="logical_addr_cache_expiration">360000</property>
                </transport>
                <protocol type="kubernetes.KUBE_PING" />
                <protocol type="MERGE3" />
                <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd" />
                <protocol type="FD_ALL" />
                <protocol type="VERIFY_SUSPECT" />
                <protocol type="pbcast.NAKACK2">
                    <property name="use_mcast_xmit">false</property>
                </protocol>
                <protocol type="UNICAST3" />
                <protocol type="pbcast.STABLE" />
                <protocol type="pbcast.GMS" />
                <protocol type="MFC" />
                <protocol type="FRAG3" />
            </stack>
        </stacks>
    </subsystem>

    <supplement name="default">
        <replacement placeholder="UDP-TRANSPORT">
            <transport type="UDP" socket-binding="jgroups-udp" />
        </replacement>
        <replacement placeholder="TCP-TRANSPORT">
            <transport type="TCP" socket-binding="jgroups-tcp" />
        </replacement>
    </supplement>

    <!-- Examples -->
    <supplement name="topology">
        <replacement placeholder="UDP-TRANSPORT">
            <transport type="UDP" socket-binding="jgroups-udp" site="${jboss.jgroups.topology.site:s1}" rack="${jboss.jgroups.topology.rack:r1}"
                machine="${jboss.jgroups.topology.machine:m1}" />
        </replacement>
        <replacement placeholder="TCP-TRANSPORT">
            <transport type="TCP" socket-binding="jgroups-tcp" site="${jboss.jgroups.topology.site:s1}" rack="${jboss.jgroups.topology.rack:r1}"
                machine="${jboss.jgroups.topology.machine:m1}" />
        </replacement>
    </supplement>

    <supplement name="xsite">
        <replacement placeholder="CHANNELS">
            <channel name="xsite" stack="tcp"/>
        </replacement>
        <replacement placeholder="UDP-TRANSPORT">
            <transport type="UDP" socket-binding="jgroups-udp" />
        </replacement>
        <replacement placeholder="TCP-TRANSPORT">
            <transport type="TCP" socket-binding="jgroups-tcp" />
        </replacement>
        <replacement placeholder="RELAY">
            <relay site="LON">
                <remote-site name="NYC" channel="xsite" />
                <remote-site name="SFO" channel="xsite" />
                <!-- property name="can_become_site_master">true</property> 
                <property name="max_site_masters">2</property -->
            </relay>
        </replacement>
    </supplement>

    <supplement name="auth">
        <replacement placeholder="AUTH">
            <sasl security-realm="ApplicationRealm" mech="DIGEST-MD5" cluster-role="cluster">
                <property name="client_password">${VAULT::cluster::password::1}</property>
            </sasl>
        </replacement>
    </supplement>

    <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:234.99.54.14}" multicast-port="45700" />
    <socket-binding name="jgroups-tcp" port="7600" />
    <socket-binding name="jgroups-tcp-fd" port="57600" />
    <socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:234.99.54.14}" multicast-port="45688" />
    <socket-binding name="jgroups-udp-fd" port="54200" />
</config>
