StackSaga Cassandra-Agent Configuration Properties

Stacksaga Cassandra agent does support both eureka based and kubernetes based environments. There is a list of common configuration properties for both and as well as there are some configuration properties specific to eureka and kubernetes.

Common Configuration Properties

Property Name Default Value Type Description

spring.profiles.active

-

String

There are two profiles available as eureka and k8s. You can choose one of them based on the deployment environment.

spring.application.name

-

String

The name of the agent application.

server.port

8080

int

The port of the agent service.

NOTE: Due to Agent service internally uses default {data_source} for managing connection, It can be configured the datasource properties in the same way that spring boot provides.
The prefix is {data_source_prefix}.

stacksaga.agent.target-service

-

String

The name of the target service. (The transactions are fetched based on this name from the event-store)

stacksaga.agent.target-service-host

-

String

The host name of the target service that retry tasks should be submitted to.

Thread-Pool of Parallel Processing: Agent service uses a thread-pool to process the retry tasks in parallel. Each thread is responsible for processing one or more partitions (virtual nodes).

stacksaga.agent.local-partition-count

Runtime.getRuntime().availableProcessors()

int

how many local partitions (virtual nodes) should be created to process the retry in parallel. by default, it is set to the number of available processors. the entire token range is divided into these partitions, and each partition is assigned to one thread.

stacksaga.agent.buffer-size

1000

int

how many records should be fetched in one batch from the event-store when retrying the failed transactions.

stacksaga.agent.retry.delay-in-minutes

2

int

how often the retry task should be executed. every 2 minutes triggers the retry task based on UTC time.

stacksaga.agent.internal-communication.retry-delay

Duration

1s

the delay between each retry attempt for internal service communication failures.

stacksaga.agent.internal-communication.max-retry-attempts

3

int

the maximum number of retry attempts for internal service communication failures.

Eureka profile Based Configuration Properties

If you are in the Eureka environment, then you have to configure the following configuration properties.

Property Name

Default Value

Type

Description

stacksaga.agent.cassandra.eureka.instance-type

-

InstanceType[Enum]

What is the type of this agent? Whether this agent is leader or follower. As per the architecture, one leader instance per region should be deployed.

If the instance is deployed as leader, the following configuration properties should be provided.

eureka.instance.instance-id

-

If the instance is a leader one, the instance-id should be a static value. The recommended pattern is {service-name}-agent-{region-name}-leader.

stacksaga.agent.cassandra.eureka.leader.communication-pool.core-size

AvailableProcessors()

int

what is the core size of the thread-pool for communicating with other followers.

stacksaga.agent.cassandra.eureka.leader.communication-pool.max-size

AvailableProcessors()

int

what is the maximum size of the thread-pool for communicating with other followers.

stacksaga.agent.cassandra.eureka.leader.communication-pool.keep-alive

AvailableProcessors()

long

Time limit for which threads may remain idle before being terminated.

stacksaga.agent.cassandra.eureka.leader.token-range-update-interval

10 * 60 * 1000(10 minutes)

long

how long time the token range should be updated based on the available instance data by the leader. the default value is 10 minutes.

stacksaga.agent.cassandra.eureka.leader.token-range-valid-duration

10 * 60 * 1000(10 minutes)

long

How long time the token range should be remains valid. This valid time is sent to the follower instance along with the token range, and their executions will be based on this time. The default value is tokenRangeUpdateInterval + 5 minutes = 15 minutes. The extra 5 minutes are added to avoid a network delay that may occur. The tokenRangeValidDuration should be greater than tokenRangeUpdateInterval all the time.

If the instance is deployed as follower, the following configuration properties should be provided.

stacksaga.agent.cassandra.eureka.follower.leader-id

-

If the instance is a slave instance, it should be provided the master’s stick-id to identify their leader.

Kubernetes profile’s Configuration Properties

Property Name

Default Value

Type

Description

stacksaga.agent.cassandra.k8s.namespace

default

String

the namespace that the application is deployed in the kubernetes cluster.

stacksaga.agent.cassandra.k8s.zone-topology-name

topology.kubernetes.io/zone

String

the topology name of the zone in the kubernetes cluster.

stacksaga.agent.cassandra.k8s.region-topology-name

topology.kubernetes.io/region

String

the topology name of the region in the kubernetes cluster.