apiVersion: v1
kind: ConfigMap
metadata:
  name: payment-service-config
data:
  application.properties: |
    service.name=Payment Service (OpenShift)
    processing.seconds=3
  hazelcast.xml: |
    <?xml version="1.0" encoding="UTF-8"?>
    <hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.8.xsd"
               xmlns="http://www.hazelcast.com/schema/config"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <properties>
            <!-- only necessary prior Hazelcast 3.8 -->
            <property name="hazelcast.discovery.enabled">true</property>
        </properties>
        <group>
            <name>payara</name>
            <password>payara-pass</password>
        </group>
        <network>
            <join>
                <!-- deactivate normal discovery -->
                <multicast enabled="false"/>
                <tcp-ip enabled="false"/>

                <!-- activate the Kubernetes plugin -->
                <discovery-strategies>
                    <discovery-strategy enabled="true"
                                        class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy">

                        <properties>
                            <!-- configure discovery service API lookup -->
                            <property name="service-dns">hazelcast</property>
                            <property name="service-dns-timeout">10</property>
                        </properties>
                    </discovery-strategy>
                </discovery-strategies>
            </join>
        </network>

        <cache name="default">
            <!--
                Number of backups. If 1 is set as the backup-count for example,
                then all entries of the map will be copied to another JVM for
                fail-safety. 0 means no backup.
            -->
            <backup-count>1</backup-count>

            <!--
                Number of async backups. 0 means no backup.
            -->
            <async-backup-count>0</async-backup-count>
        </cache>

        <cache name="processCache">
            <backup-count>1</backup-count>
            <async-backup-count>0</async-backup-count>
        </cache>

        <lite-member enabled="true"/>

    </hazelcast>
