arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Configuration

hashtag
Overview

By default, Cronus and its sub-components have good default settings. However, not everything can be auto-configured, such as connection strings to databases or endpoints to various services.

hashtag
Cronus

hashtag
Cronus:BoundedContext

Cronus uses this setting to personalize your application. This setting is used for naming the following components:

  • RabbiMQ exchange and queue names

  • Cassandra EventStore names

  • Cassandra Projection store names

Allowed Characters: Cronus:BoundedContext must be an alphanumeric character or underscore only: ^\b([\w\d_]+$)'

hashtag
Cronus:Tenants

List of tenants allowed to use the system. Cronus is designed with multitenancy in mind from the beginning and requires at least one tenant to be configured in order to work properly. The multitenancy aspects are applied to many components and to give you a feel about this here is an incomplete list of different parts of the system using this setting:

  • Message - every message which is sent through Cronus is bound to a specific tenant

  • RabbitMQ exchanges and queues are tenant-aware

  • Event Store - every tenant has a separate storage

Each value you provide in the array is converted and used further to lower.

Allowed Characters: Cronus:Tenants must be an alphanumeric character or underscore only: ^\b([\w\d_]+$)'

Example value: ["tenant1","tenant2","tenant3"]

Once set you could use object via Dependency Injection for other purposes.

hashtag
Cronus:ApplicationServicesEnabled

Specifies whether to start a consumer for the Application Services

hashtag
Cronus:ProjectionsEnabled

Specifies whether to start a consumer for the Projections

hashtag
Cronus:PortsEnabled

Specifies whether to start a consumer for the Ports

hashtag
Cronus:SagasEnabled

Specifies whether to start a consumer for the Sagas

hashtag
Cronus:GatewaysEnabled

Specifies whether to start a consumer for the Gateways

hashtag
Cronus.Api

hashtag
Hosting

The API is hosted with Kestrel.

By default, the API is hosted on port 7477.

A configuration could be provided by . You can supply them directly in the DI or through a configuration file.

hashtag
Cronus:Api:Kestrel

hashtag
Authentication

The API could be protected using a JWT bearer authentication.

The configuration is provided by . You can supply them directly in the DI or through a configuration file.

hashtag
Cronus:Api:JwtAuthentication

Remarks:

hashtag
Cronus.Persistence.Cassandra

hashtag
Cronus:Persistence:Cassandra:ConnectionString

The connection to the Cassandra database server

hashtag
Cronus:Persistence:Cassandra:ReplicationStrategy

Configures Cassandra replication strategy. This setting has effect only in the first run when creating the database.

Valid values:

  • simple

  • network_topology - when using this setting you need to specify Cronus:Persistence:Cassandra:ReplicationFactor and Cronus:Persistence:Cassandra:Datacenters as well

hashtag
Cronus.Projections.Cassandra

hashtag
Cronus:Projections:Cassandra:ConnectionString

The connection to the Cassandra database server

hashtag
Cronus:Projections:Cassandra:ReplicationStrategy

Configures Cassandra replication strategy. This setting has effect only in the first run when creating the database.

Valid values:

  • simple

  • network_topology - when using this setting you need to specify Cronus:Projections:Cassandra:ReplicationFactor and Cronus:Projections:Cassandra:Datacenters as well

hashtag
Cronus:Projections:Cassandra:ReplicationFactor

hashtag
Cronus:Projections:Cassandra:Datacenters

hashtag
Cronus:Projections:Cassandra:TableRetention:DeleteOldProjectionTables

Enables deletion of old projection tables

hashtag
Cronus:Projections:Cassandra:TableRetention:NumberOfOldProjectionTablesToRetain

Configures Cassandra number of old projection tables -> default: live table and 2 old tables

hashtag
Cronus.Transport.RabbitMq

hashtag
Cronus:Transport:RabbiMQ:ConsumerWorkersCount >> integer | Required: Yes | Default: 5

Configures the number of threads which will be dedicated to consuming messages from RabbitMQ for every consumer.

hashtag
Cronus:Transport:RabbiMQ:Server >> string | Required: Yes | Default: 127.0.0.1

DNS or IP to the RabbitMQ server

hashtag
Cronus:Transport:RabbiMQ:Port >> integer | Required: Yes | Default: 5672

The port number on which the RabbitMQ server is running

hashtag
Cronus:Transport:RabbiMQ:VHost >> string | Required: Yes | Default: /

The name of the virtual host. It is a good practice to not use the default / vhost. For more details see the . Cronus is not using this for managing multitenancy.

hashtag
Cronus:Transport:RabbiMQ:Username >> string | Required: Yes | Default: guest

The RabbitMQ username

hashtag
Cronus:Transport:RabbiMQ:Password >> string | Required: Yes | Default: guest

The RabbitMQ password

hashtag
Cronus:Transport:RabbiMQ:AdminPort >> integer | Required: Yes | Default: 5672

RabbitMQ admin port used to create, delete rabbitmq resources

hashtag
Cronus.AtomicAction.Redis

An implementation of Cronus.AtomicAction using distributed locks with Redis

(Source: )

hashtag
Cronus:AtomicAction:Redis:ConnectionString >> string | Required: Yes

Configures the connection string where Redis is located

hashtag
Cronus:AtomicAction:Redis:LockTtl >> TimeSpan | Required: No | Default: 00:00:01.000

hashtag
Cronus:AtomicAction:Redis:ShorTtl >> TimeSpan | Required: No | Default: 00:00:01.000

hashtag
Cronus:AtomicAction:Redis:LongTtl >> TimeSpan | Required: No | Default: 00:00:05.000

hashtag
Cronus:AtomicAction:Redis:LockRetryCount >> int | Required: No | Default: 3

hashtag
Cronus:AtomicAction:Redis:LockRetryDelay >> TimeSpan | Required: No | Default: 00:00:00.100

hashtag
Cronus:AtomicAction:Redis:ClockDriveFactor >> double | Required: No | Default: 0.01

no

true

bool

no

true

bool

no

true

bool

no

true

bool

no

true

Projection Store - every tenant has a separate storage

no

1

string[]

no

no

1

string[]

no

boolean

no

true

uint

no

2

Name

Type

Required

Default Value

Cronus:BoundedContext

string

yes

Cronus:Tenants

string[]

yes

Cronus:ApplicationServicesEnabled

Name

Type

Required

Default Value

Cronus:Api:Kestrel

configurationSection

no

Cronus:Api:JwtAuthentication

configurationSection

no

Name

Type

Required

Default Value

Cronus:Persistence:Cassandra:ConnectionString

string

yes

Cronus:Persistence:Cassandra:ReplicationStrategy

string

no

simple

Cronus:Persistence:Cassandra:ReplicationFactor

Name

Type

Required

Default Value

Cronus:Projections:Cassandra:ConnectionString

string

yes

Cronus:Pojections:Cassandra:ReplicationStrategy

string

no

simple

Cronus:Pojections:Cassandra:ReplicationFactor

TenantsOptionsarrow-up-right
KestrelOptionsarrow-up-right
JwtBearerOptionsarrow-up-right
https://stackoverflow.com/a/58736850/224667arrow-up-right
official docsarrow-up-right
https://redis.io/topics/distlockarrow-up-right

bool

int

int

{
    "Cronus": {
        "Api": {
            "Kestrel": {
                "Endpoints": {
                    "Https": {
                        "Url": "https://*:7477",
                        "Certificate": {
                            "Subject": "*.example.com",
                            "Store": "My",
                            "Location": "CurrentUser",
                            "AllowInvalid": "true"
                        }
                    }
                }
            }
        }
    }
}
{
    "Cronus": {
        "Api": {
            "JwtAuthentication": {
                "Authority": "https://example.com",
                "Audience": "https://example.com/resources"
            }
        }
    }
}
Cronus:ProjectionsEnabled
Cronus:PortsEnabled
Cronus:SagasEnabled
Cronus:GatewaysEnabled
Cronus:Persistence:Cassandra:Datacenters
Cronus:Pojections:Cassandra:Datacenters
Cronus:Pojections:Cassandra:TableRetention:DeleteOldProjectionTables
Cronus:Projections:Cassandra:TableRetention:NumberOfOldProjectionTablesToRetain