StackSaga Cassandra-Agent Configuration Properties

Stacksaga MYSQL 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. It is recommended to use this format: target-service-name-agent. For instance if deploying s agent service for order-service the agent service name will be order-service-agent.

server.port

5566

int

The port of the agent service.

NOTE: Due to StackSaga Mysql-Agent internally uses spring default datasource and HikariCP for managing the connection pool, It can be configured the datasource properties in the same way that spring boot provides.
The prefix is stacksaga.datasource

stacksaga.agent.keyspace

stacksaga_event_store

String

The keyspace(Database) name of the event-store.

stacksaga.agent.target-service-host

-

String

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

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.act-master-as-slave

true

boolean

Whether the master service acts as the slave or not. If the cluster is small, you can run one instance and run as the master and as well as the slave.

stacksaga.agent.IOPool.core-pool-size

available processors * 10

int

core number of threads in the IOPool.

stacksaga.agent.IOPool.maximum-pool-size

available processors * 30

int

maximum number of threads in the IOPool.

stacksaga.agent.IOPool.keep-alive-time

60000(ms)

long

the time limit for which threads may remain idle before being terminated.

stacksaga.agent.IOPool.queue-capacity

Integer.MAX_VALUE

int

the capacity of the queue.

stacksaga.agent.IOPool.await-termination-period

10000(ms)

int

the maximum time the executor is supposed to block on shutdown.

stacksaga.agent.retry-pool.pool-size

available processors * 1

int

core number of threads in the IOPool.

stacksaga.agent.retry-pool.keep-alive-time

60000(MILLIS)

long

the time limit for which threads may remain idle before being terminated.

stacksaga.agent.retry-pool.queue-capacity

Integer.MAX_VALUE

int

the capacity of the queue.

stacksaga.agent.retry-pool.await-termination-period

10000(ms)

int

the maximum time the executor is supposed to block on shutdown.

stacksaga.agent.retry-initial-delay

60000(ms)

long

how long to wait before retrying the transaction at the beginning of the application.

stacksaga.agent.retry-fixed-rate

60000(ms)

long

the fixed rate for retrying the transaction. As per the default value, the transaction retry process is repeated every 60 seconds. The executions are not overlapped even the old execution exceeds the interval

stacksaga.agent.retry-batch-size

1000

int

The name of the target service. The number of transactions that should be fetched from the event-store for each batch.

Eureka profile’s 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.eureka.instance-type

-

InstanceType[Enum]

The type of this agent. Whether this agent is master or slave. in the cluster, it should have at least one master node.

stacksaga.agent.eureka.token-range-update-delay

-

300_000

if the instance is a master instance, the delay time to update the token range. (Master will send the token range to the slave agent in withing this delay time.)

stacksaga.agent.eureka.token-range-update-initial-delay

-

300_000

if the instance is a master instance, the initial delay for updating the token range by the master.

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

-

420_000

How long time the token range should be valid. This valid time is sent to the slave instance, and its executions are based on this time. The default value is tokenRangeUpdateDelay + 2 minutes = 7 minutes. The extra 5 minutes are added to avoid the network delay. The tokenRangeValidDuration should be greater than tokenRangeUpdateDelay all the time.

Kubernetes profile’s Configuration Properties

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

Property Name

Default Value

Type

Description

stacksaga.agent.k8s.zone-topology-name

topology.kubernetes.io/zone

String

the topology name of the zone in the kubernetes cluster.

stacksaga.agent.k8s.region-topology-name

topology.kubernetes.io/region

String

the topology name of the region in the kubernetes cluster.

stacksaga.agent.k8s.namespace

default

String

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