All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.hazelcast-java-client.5.5.0-BETA.source-code.hazelcast-client-full.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2008-2024, Hazelcast, Inc. All Rights Reserved.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!--
  This is a full example hazelcast-client.xml that includes all the
  configuration elements and attributes of a Hazelcast client.

  To use this, rename it to hazelcast-client.xml and place it in
  the directory where you start your Hazelcast client.

  To learn how to configure Hazelcast, please see the schema at
  https://hazelcast.com/schema/client-config/hazelcast-client-config-5.3.xsd
  or the Reference Manual at https://docs.hazelcast.com/
-->

<!--suppress XmlDefaultAttributeValue -->
<hazelcast-client xmlns="http://www.hazelcast.com/schema/client-config"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://www.hazelcast.com/schema/client-config
                  http://www.hazelcast.com/schema/client-config/hazelcast-client-config-5.3.xsd">

    <config-replacers fail-if-value-missing="false">
        <replacer class-name="com.hazelcast.config.replacer.EncryptionReplacer">
            <properties>
                <property name="passwordFile">password.txt</property>
                <property name="passwordUserProperties">false</property>
                <property name="cipherAlgorithm">DES</property>
                <property name="keyLengthBits">64</property>
                <property name="secretKeyAlgorithm">DES</property>
                <property name="secretKeyFactoryAlgorithm">PBKDF2WithHmacSHA1</property>
            </properties>
        </replacer>
    </config-replacers>

    <cluster-name>my-cluster</cluster-name>

    <instance-name>CLIENT_NAME</instance-name>
    <properties>
        <property name="hazelcast.client.shuffle.member.list">true</property>
        <property name="hazelcast.client.heartbeat.timeout">60000</property>
        <property name="hazelcast.client.heartbeat.interval">5000</property>
        <property name="hazelcast.client.event.thread.count">5</property>
        <property name="hazelcast.client.event.queue.capacity">1000000</property>
        <property name="hazelcast.client.invocation.timeout.seconds">120</property>
    </properties>
    <client-labels>
        <label>admin</label>
        <label>foo</label>
    </client-labels>

    <backup-ack-to-client-enabled>false</backup-ack-to-client-enabled>

    <network>
        <cluster-members>
            <address>127.0.0.1</address>
            <address>127.0.0.2</address>
        </cluster-members>
        <outbound-ports>
            <ports>34600</ports>
            <ports>34700-34710</ports>
        </outbound-ports>
        <smart-routing>true</smart-routing>
        <redo-operation>true</redo-operation>
        <connection-timeout>60000</connection-timeout>
        <socket-options>
            <tcp-no-delay>false</tcp-no-delay>
            <keep-alive>true</keep-alive>
            <reuse-address>true</reuse-address>
            <linger-seconds>3</linger-seconds>
            <buffer-size>128</buffer-size>
        </socket-options>
        <socket-interceptor enabled="true">
            <class-name>com.hazelcast.examples.MySocketInterceptor</class-name>
            <properties>
                <property name="foo">bar</property>
            </properties>
        </socket-interceptor>

        <ssl enabled="false">
            <factory-class-name>com.hazelcast.nio.ssl.BasicSSLContextFactory</factory-class-name>
            <properties>
                <property name="protocol">TLS</property>

                <property name="trustStore">/opt/hazelcast-client.truststore</property>
                <property name="trustStorePassword">secret.123456</property>
                <property name="trustStoreType">JKS</property>

                <property name="keyStore">/opt/hazelcast-client.keystore</property>
                <property name="keyStorePassword">keystorePassword123</property>
                <property name="keyStoreType">JKS</property>
            </properties>
        </ssl>
        <auto-detection enabled="false"/>
        <aws enabled="true" connection-timeout-seconds="11">
            <inside-aws>true</inside-aws>
            <access-key>TEST_ACCESS_KEY</access-key>
            <secret-key>TEST_SECRET_KEY</secret-key>
            <region>us-east-1</region>
            <host-header>ec2.amazonaws.com</host-header>
            <security-group-name>hazelcast-sg</security-group-name>
            <tag-key>type</tag-key>
            <tag-value>hz-nodes</tag-value>
        </aws>
        <gcp enabled="false">
            <zones>us-east1-b,us-east1-c</zones>
        </gcp>
        <azure enabled="false">
            <instance-metadata-available>false</instance-metadata-available>
            <client-id>CLIENT_ID</client-id>
            <client-secret>CLIENT_SECRET</client-secret>
            <tenant-id>TENANT_ID</tenant-id>
            <subscription-id>SUB_ID</subscription-id>
            <resource-group>RESOURCE-GROUP-NAME</resource-group>
            <scale-set>SCALE-SET-NAME</scale-set>
            <tag>TAG-NAME=HZLCAST001</tag>
        </azure>
        <kubernetes enabled="false">
            <namespace>MY-KUBERNETES-NAMESPACE</namespace>
            <service-name>MY-SERVICE-NAME</service-name>
            <service-label-name>MY-SERVICE-LABEL-NAME</service-label-name>
            <service-label-value>MY-SERVICE-LABEL-VALUE</service-label-value>
        </kubernetes>
        <eureka enabled="false">
            <self-registration>true</self-registration>
            <namespace>hazelcast</namespace>
        </eureka>
        <icmp-ping enabled="false">
            <timeout-milliseconds>2000</timeout-milliseconds>
            <interval-milliseconds>3000</interval-milliseconds>
            <ttl>100</ttl>
            <max-attempts>5</max-attempts>
            <echo-fail-fast-on-startup>false</echo-fail-fast-on-startup>
        </icmp-ping>
        <hazelcast-cloud enabled="false">
            <discovery-token>EXAMPLE_TOKEN</discovery-token>
        </hazelcast-cloud>
        <discovery-strategies>
            <node-filter class="DummyFilterClass"/>
            <discovery-strategy class="DummyDiscoveryStrategy1" enabled="true">
                <properties>
                    <property name="key-string">foo</property>
                    <property name="key-int">123</property>
                    <property name="key-boolean">true</property>
                </properties>
            </discovery-strategy>
        </discovery-strategies>
    </network>

    <security>
        <credentials-factory class-name="com.hazelcast.examples.MyCredentialsFactory">
            <properties>
                <property name="property">value</property>
            </properties>
        </credentials-factory>
        <realms>
            <realm name="krb5Initiator">
                <authentication>
                    <jaas>
                        <login-module class-name="com.sun.security.auth.module.Krb5LoginModule" usage="REQUIRED">
                            <properties>
                                <property name="isInitiator">true</property>
                                <property name="useTicketCache">false</property>
                                <property name="doNotPrompt">true</property>
                                <property name="useKeyTab">true</property>
                                <property name="storeKey">true</property>
                                <property name="principal">[email protected]</property>
                                <property name="keyTab">/opt/jduke.keytab</property>
                            </properties>
                        </login-module>
                    </jaas>
                </authentication>
            </realm>
        </realms>
    </security>

    <listeners>
        <listener>com.hazelcast.examples.MembershipListener</listener>
        <listener>com.hazelcast.examples.MigrationListener</listener>
    </listeners>

    <serialization>
        <portable-version>3</portable-version>
        <use-native-byte-order>true</use-native-byte-order>
        <byte-order>BIG_ENDIAN</byte-order>
        <enable-compression>false</enable-compression>
        <enable-shared-object>true</enable-shared-object>
        <allow-unsafe>false</allow-unsafe>
        <allow-override-default-serializers>false</allow-override-default-serializers>
        <data-serializable-factories>
            <data-serializable-factory factory-id="1">com.hazelcast.examples.DataSerializableFactory
            </data-serializable-factory>
        </data-serializable-factories>
        <portable-factories>
            <portable-factory factory-id="2">com.hazelcast.examples.PortableFactory</portable-factory>
        </portable-factories>
        <serializers>
            <global-serializer override-java-serialization="true">com.hazelcast.examples.GlobalSerializerFactory
            </global-serializer>
            <serializer type-class="com.hazelcast.examples.DummyType"
                        class-name="com.hazelcast.examples.SerializerFactory"/>
        </serializers>
        <check-class-def-errors>true</check-class-def-errors>
        <java-serialization-filter>
            <blacklist>
                <class>com.acme.app.BeanComparator</class>
            </blacklist>
            <whitelist>
                <class>java.lang.String</class>
                <class>example.Foo</class>
                <package>com.acme.app</package>
                <package>com.acme.app.subpkg</package>
                <prefix>java</prefix>
                <prefix>[</prefix>
                <prefix>com.</prefix>
            </whitelist>
        </java-serialization-filter>
        <compact-serialization>
            <serializers>
                <serializer>com.hazelcast.examples.DummyTypeSerializer</serializer>
            </serializers>
            <classes>
                <class>com.hazelcast.examples.DummyType</class>
            </classes>
        </compact-serialization>
    </serialization>

    <native-memory enabled="false" allocator-type="POOLED">
        <size unit="MEGABYTES" value="128"/>
        <min-block-size>1</min-block-size>
        <page-size>1</page-size>
        <metadata-space-percentage>40.5</metadata-space-percentage>
        <persistent-memory>
            <directories>
                <directory numa-node="0">/mnt/pmem0</directory>
                <directory numa-node="1">/mnt/pmem1</directory>
            </directories>
        </persistent-memory>
    </native-memory>

    <proxy-factories>
        <proxy-factory class-name="com.hazelcast.examples.ProxyXYZ1" service="sampleService1"/>
        <proxy-factory class-name="com.hazelcast.examples.ProxyXYZ2" service="sampleService1"/>
        <proxy-factory class-name="com.hazelcast.examples.ProxyXYZ3" service="sampleService3"/>
    </proxy-factories>

    <load-balancer type="random"/>

    <!--
        Note that the Near Cache eviction configuration is different for NATIVE in-memory format.
        Proper eviction configuration example for NATIVE in-memory format :
           `<eviction max-size-policy="USED_NATIVE_MEMORY_SIZE" eviction-policy="LFU" size="60"/>`
    -->
    <near-cache name="default">
        <time-to-live-seconds>90</time-to-live-seconds>
        <max-idle-seconds>100</max-idle-seconds>
        <invalidate-on-change>true</invalidate-on-change>
        <in-memory-format>OBJECT</in-memory-format>
        <serialize-keys>true</serialize-keys>
        <local-update-policy>INVALIDATE</local-update-policy>
        <eviction size="2000" eviction-policy="LFU"/>
    </near-cache>

    <near-cache name="NearCacheEvictionConfigExample">
        <eviction eviction-policy="LRU" max-size-policy="ENTRY_COUNT" size="10000"
                  comparator-class-name="com.hazelcast.examples.MyEvictionComparator"/>
    </near-cache>

    <flake-id-generator name="default">
        <prefetch-count>100</prefetch-count>
        <prefetch-validity-millis>600000</prefetch-validity-millis>
    </flake-id-generator>

    <query-caches>
        <query-cache name="query-cache-class-name-predicate" mapName="map-name">
            <predicate type="class-name">com.hazelcast.examples.ExamplePredicate</predicate>
            <entry-listeners>
                <entry-listener include-value="true" local="false">com.hazelcast.examples.EntryListener</entry-listener>
            </entry-listeners>
            <include-value>true</include-value>
            <batch-size>1</batch-size>
            <buffer-size>16</buffer-size>
            <delay-seconds>0</delay-seconds>
            <in-memory-format>BINARY</in-memory-format>
            <coalesce>false</coalesce>
            <populate>true</populate>
            <serialize-keys>false</serialize-keys>
            <eviction eviction-policy="LRU" max-size-policy="ENTRY_COUNT" size="10000"
                      comparator-class-name="com.hazelcast.examples.MyEvictionComparator"/>
            <indexes>
                <index type="HASH">
                    <attributes>
                        <attribute>name</attribute>
                    </attributes>
                </index>
            </indexes>
        </query-cache>
        <query-cache name="query-cache-sql-predicate" mapName="map-name">
            <predicate type="sql">%age=40</predicate>
        </query-cache>
    </query-caches>

    <connection-strategy async-start="true" reconnect-mode="ASYNC">
        <connection-retry>
            <initial-backoff-millis>2000</initial-backoff-millis>
            <max-backoff-millis>60000</max-backoff-millis>
            <multiplier>3</multiplier>
            <cluster-connect-timeout-millis>5000</cluster-connect-timeout-millis>
            <jitter>0.5</jitter>
        </connection-retry>
    </connection-strategy>

    <reliable-topic name="rel-topic">
        <read-batch-size>100</read-batch-size>
        <topic-overload-policy>DISCARD_NEWEST</topic-overload-policy>
    </reliable-topic>

    <user-code-deployment enabled="true">
        <jarPaths>
            <jarPath>/User/test/sample.jar</jarPath>
            <jarPath>https://hazelcast.com/</jarPath>
            <jarPath>file://User/test/sample.jar</jarPath>
        </jarPaths>
        <classNames>
            <className>test.sampleClassName</className>
        </classNames>
    </user-code-deployment>

    <metrics enabled="false">
        <jmx enabled="false"/>
        <collection-frequency-seconds>42</collection-frequency-seconds>
    </metrics>

    <instance-tracking enabled="false">

    </instance-tracking>

    <sql>
        <resubmission-mode>RETRY_SELECTS</resubmission-mode>
    </sql>

    <tpc enabled="true"/>
</hazelcast-client>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy