Application Definition

Example 7.2, “Application definition configuration” shows the application definition that is used by all of the topology examples. This configuration defines:

Both data distribution policies use a distributed hash data mapper to distribute the application data.

There is also a custom quorum notifier defined in the fragment. The behavior of this notifier is application specific and is not exposed in the configurable quorum policies.

Example 7.1. Fragment definition configuration

name = "com.tibco.ep.dtmexamples.javafragment.helloworld"
version = "1.0.0"
type = "com.tibco.ep.dtm.configuration.application"

configuration =
{
    FragmentDefinition =
    {
        description = "hello world fragment"
        customQuorumNotifiers =
        {
            "my-quorum-notifier" =
            {
                notifierClassName = "com.tibco.ep.dtmexamples.javafragment.helloworld.QuorumNotifier"
            }
        }
        dataMappers = 
        {
            "dynamic-data-mapper" =
            {
                distributedHashDataMappers =
                [
                    {
                        className = "com.tibco.ep.dtm.HelloWorld"
                        key = "ByName"
                    }
                ]
            },
            "dynamic-credit-data-mapper" =
            {
                roundRobinDataMappers =
                [
                    {
                        className = "com.tibco.ep.dtm.payments.Credit"
                     }
                ]
            },
            "dynamic-debit-data-mapper" =
            {
                roundRobinDataMappers =
                [
                    {
                        className = "com.tibco.ep.dtm.payments.Debit"
                     }
                ]
            },
            "static-data-mapper" =
            {
                distributedHashDataMappers =
                [
                    {
                        className = "com.tibco.ep.dtm.WorldHello"
                        field = "name"
                    }
                ]
            }
        }
    }
}

Example 7.2. Application definition configuration

name = "MyApplication"
version = "1.0.0"
type = "com.tibco.ep.dtm.configuration.application"

configuration =
{
    ApplicationDefinition =
    {
        dataDistributionPolicies =
        {
            "dynamic-data-distribution-policy" =
            {
                type = "DYNAMIC"
                dataMappers =
                [
                    "dynamic-data-mapper"
                ]
                customQuorumNotifiers =
                [
                    "my-quorum-notifier"
                ]
                dynamicDataDistributionPolicy =
                {
                    numberOfPartitions = 3
                    primaryDataRedundancy =
                    {
                        numberOfReplicas = 6
                        replicationType = SYNCHRONOUS
                    }
                    backupDataRedundancy =
                    {
                        numberOfReplicas = 4
                        replicationType = ASYNCHRONOUS
                    }
                }
            },

            "dynamic-credit-distribution-policy" =
            {
                type = "DYNAMIC"
                dataMappers =
                [
                    "dynamic-credit-data-mapper"
                ]
            },

            "dynamic-debit-distribution-policy" =
            {
                type = "DYNAMIC"
                dataMappers =
                [
                    "dynamic-debit-data-mapper"
                ]
            },

            "static-data-distribution-policy" =
            {
                type = "STATIC"
                dataMappers =
                [
                    "static-data-mapper"
                ]
                disableAction = "LEAVE_CLUSTER_FORCE"
                enableAction = "JOIN_CLUSTER"
                forceReplication = false
                numberOfThreads = 1
                objectsLockedPerTransaction = 1001
                remoteEnableAction = "ENABLE_PARTITION"
                staticDataDistributionPolicy =
                {
                    replicaAudit = "WAIT_ACTIVE"
                    sparseAudit = "VERIFY_NODE_LIST"
                }
            }
        }
    }
}