Properties

Properties you can use to configure FactCast

Schemaregistry

PropertyDescriptionDefault
factcast.store.schemaRegistryUrlif a schemaRegistryUrl is defined, FactCast goes into validating mode. The only protocols allowed here are “http”, “https”, “classpath” and “file”. Note that http(s) and file always require two slashes after the colon, e.g. “https://someserver/…” or “file:///root/folder/…”.
factcast.store.validationEnabledCan be used for disabling Fact validation if a schemaRegistryUrl is defined. Useful for mass data ingestion.true
factcast.store.persistentRegistryif fetched Schema and Transformation Documents are persisted into Postgresfalse
factcast.store.allowUnvalidatedPublishIf validation is enabled, this controls if publishing facts, that are not validatable (due to missing meta-data or due to missing schema in the registry) are allowed to be published or should be rejected.false
factcast.store.schemaStoreRefreshCrondefines the cron schedule for refreshing the SchemaRegistry by querying for the latest remote changes*/60 * * * * * (every minute)
factcast.store.allowSchemaReplaceIf a schema can be replaced by an updated version from the registry (not a good idea in production environments)false

Transformation-Registry

PropertyDescriptionDefault
factcast.store.persistentTransformationCacheif Transformed Fact payloads are persistently cached into Postgresfalse
factcast.store.inMemTransformationCacheCapacitywhen using the inmem impl of the transformation cache, this is the max number of entries cached. The minimum value here is 100.100
factcast.store.deleteTransformationsStaleForDayswhen using the persistent impl of the transformation cache, this is the min number of days a transformation result is not read in order to be considered stale. This should free some space in a regular cleanup job. Must be a positive number.14
factcast.store.transformationCacheCompactCrondefines the cron schedule for compacting the transformation result cache0 0 0 * * * (at midnight)

Performance / Reliability

PropertyDescriptionDefault
factcast.store.factNotificationBlockingWaitTimeInMillisControls how long to block waiting for new notifications from the database (Postgres LISTEN/ NOTIFY mechanism). When this time exceeds the notifications is repeated. Minimum value is 5000.15000 (15sec)
factcast.store.factNotificationMaxRoundTripLatencyInMillisWhen FactCast did not receive any notifications after factNotificationBlockingWaitTimeInMillis milliseconds it validates the health of the database connection. For this purpose it sends an internal notification to the database and waits for the given time to receive back an answer. If the time is exceeded the database connection is renewed. Minimum value is 50.200
factcast.store.factNotificationNewConnectionWaitTimeInMillishow much time to wait between invalidating and acquiring a new connection. note: This parameter is only applied in the part of FactCast which deals with receiving and forwarding database notifications. Minimum value is 10.100
factcast.store.page-sizeHow many Facts to fetch from the database in one go. Higher values mean more memory usage. Must be positive.50
factcast.store.indexCheckCronCron expression defining a routine check for index validity0 0 3 * * * (3 am)
factcast.store.tailIndexingEnabledenable/ disable tail indexingfalse
factcast.store.tailManagementCroncron schedule when tail rotation should be carried out0 0 0 * * * (at midnight)
factcast.store.tailGenerationsToKeepthe number of tail indexes to keep. The higher the number, the slower the inserts. Probably 2 or 3 is a good value unless you have a very high tail rebuild frequency and not permanently connected applications (like offline clients for instance). Must be a positive number, maximum is 128.3
factcast.store.minimumTailAgeminimum age of the youngest tail index, before a new one is created7 days
factcast.store.tailCreationTimeoutIndex creation can hang for a long time in case of many open transactions. To avoid this, you can specify a timeout.
We will subtract 5 seconds from the given duration before applying it to setTimeout.
1d
factcast.store.transformationCachePageSizeDefines the max number of Facts being scheduled for transformation in one go. Must be positive and not exceed 32000.100
factcast.store.sizeOfThreadPoolForSubscriptionsThis is the number of threads we create for handling new subscriptions requests. It’s implemented via a fixed thread pool. As soon as the subscription request finishes or enters phase 3 (follow) the thread is freed up again. In earlier versions we used the common FJP which limits the parallelism to the number of cores - 1. If you ever encounter too much database load or too high waiting time for subscriptions this can be an option.100
factcast.store.sizeOfThreadPoolForBufferedTransformationsThis is the number of threads we create for handling buffered transformations. It’s implemented via work stealing thread pool. In early versions we used the common FJP which limits the parallelism to the number of cores - 1.25
factcast.store.readOnlyModeEnabledConfigures FactCast to work in read-only mode. You cannot publish any events in this mode and certain functionality like tail index generation or state token generation is disabled. You can still use a persistent schema store or transformation cache, however they will work in read-only mode. Additionally, liquibase is disabled.false
factcast.store.enumerationDirectModeEnabledDespite of a Schema-Registry being defined or not, if set to true, enumeration of types or namespace will examine the data in the store directly, so that you only see data from already published facts.false

Snapshots

InMem-Snapshots

PropertyDescriptionDefault
factcast.snapshot.local.mem.deleteSnapshotStaleForDaysmin number of days a snapshot is kept even though it is not read anymore. Must be a positive number.90

InMemAndDisk-Snapshots

PropertyDescriptionDefault
factcast.snapshot.local.disk.pathToSnapshotspath to store the snapshots in the file system.java.io.tmpdir
factcast.snapshot.local.disk.maxDiskSpacemax disk space to be used by the SnapshotDiskRepository. The oldest Snapshots will start to be removed after reaching 90% of the allocated space, never reaching 100%. Use 0 for unlimited disk space0

RedisSnapshots

PropertyDescriptionDefault
factcast.snapshot.redis.deleteSnapshotStaleForDaysmin number of days a snapshot is kept even though it is not read anymore. Must be a positive number.90
factcast.snapshot.redis.snapshotCacheRedissonCodecoptional configuration of the codec used for serializing objects from and into the snapshot. When set to RedissonDefault no codec is specified and Redisson will use its current default.MarshallingCodec

gRPC

Properties you can use to configure gRPC:

gRPC Client

PropertyDescriptionDefaultExample
grpc.client.factstore.credentialsDeprecated. Please use factcast.grpc.client.user and factcast.grpc.client.password insteadnonemyUserName:mySecretPassword
grpc.client.factstore.addressthe address(es) fo the factcast servernonestatic://localhost:9090
grpc.client.factstore.negotiationTypeUsage of TLS or Plaintext?TLSPLAINTEXT
grpc.client.factstore.enable-keep-aliveConfigures whether keepAlive should be enabled. Recommended for long running (follow) subscriptionsfalsetrue
grpc.client.factstore.keep-alive-timeThe default delay before sending keepAlives. Defaults to 60s. Please note that shorter intervals increase the network burden for the server.300
grpc.client.factstore.keep-alive-without-callsConfigures whether keepAlive will be performed when there are no outstanding RPCs on a connection.falsetrue
grpc.client.factstore.enable-keep-alive=true
grpc.client.factstore.keep-alive-time=300
grpc.client.factstore.keep-alive-without-calls=true

Further details can be found here : net.devh.boot.grpc.client.config.GrpcChannelProperties.

FactCast client specific

PropertyDescriptionDefaultExample
factcast.grpc.client.idServer-side logging mentions this optional id if set in order to help with debugging. If this property is not set, it falls back to the value of spring.application.name${spring.application.name}myClient
factcast.grpc.client.userUser if factcast-security is enabled.myUser
factcast.grpc.client.passwordPassword if factcast-security is enabled.myPassword
factcast.grpc.client.enable-fast-forwardIf the server supports it, enables fast forwarding. This is supposed to speedup frequent queries that cluster around the end of the global Fact-Stream and thus can use dedicated temporary rolling indexes.truefalse
factcast.grpc.client.max-inbound-message-sizeThe GRPC server will chunk messages to not exceed this. Note that one message might contain up to 1000 facts. This value disregards compression. The maximum for this value is 32MB, the minimum is 2 MB. Note that this also limits the maximum transaction bulk size.8m16m
factcast.grpc.client.resilience.enabledEnables resilience mode for subscriptions. If enabled, subscriptions that fail due to networking errors will be transparently resubscribed. (since 0.5.5)truefalse
factcast.grpc.client.resilience.windowDefines the window in which a maximum of retries is defined. (since 0.5.5)PT30S (30 seconds)PT2M (2 Minutes)
factcast.grpc.client.resilience.attemptsDefines the maximum number of attempts that will be done (within a time window defined by resilience.window) before failing and escalating the last exception to the application. (since 0.5.5)1025
factcast.grpc.client.resilience.intervalDefines the wait time between two attempts. (since 0.5.5)PT0.1S (100 millis)PT0.5S
factcast.grpc.client.ignore-duplicate-factsIgnores and skips duplicate exceptions during publishing (does not include conditional publishing when using locks). This might be convenient in cases where you published to a factcast server and get a connection error back (you cannot possibly know if the publish on the server succeeded or not). If you have resilience enabled, the publish would be retried and might (if the first was successful) result in a DuplicateFactException. Setting this to true will make factcast just ignore the exception and go on. There might be a performance problem resulting from this: If you publish a batch of facts and a DuplicateFactException is recieved, factcast will fall back to publishing every single Fact from the batch one-by-one in order to make sure, that after your call, all Facts that are not duplicates will be published.falsetrue

grpc Server

PropertyDescriptionDefaultExample
grpc.server.permit-keep-alive-without-callsConfigures whether clients are allowed to send keep-alive HTTP/2 PINGs even if there are no outstanding RPCs on the connectionfalsetrue
grpc.server.permit-keep-alive-timeSpecifies the most aggressive keep-alive time in seconds clients are permitted to configure. Defaults to 5min.300100
factcast.grpc.bandwith.numberOfFollowRequestsAllowedPerClientPerMinuteafter the given number of follow requests from the same client per minute, subscriptions are rejected with RESOURCE_EXHAUSTED55
factcast.grpc.bandwith.initialNumberOfFollowRequestsAllowedPerClientramp-up to compensate for client startup5050
factcast.grpc.bandwith.numberOfCatchupRequestsAllowedPerClientPerMinuteafter the given number of catchup requests from the same client per minute, subscriptions are rejected with RESOURCE_EXHAUSTED60006000
factcast.grpc.bandwith.initialNumberOfCatchupRequestsAllowedPerClientramp-up to compensate for client startup3600036000
factcast.grpc.bandwith.disabledcompletely disables checking if set to truefalsetrue
grpc.server.permit-keep-alive-without-calls=true
grpc.server.permit-keep-alive-time=100

Blacklist

PropertyDescriptionDefaultExample
factcast.blacklist.typeConfigures where the list of blacklisted facts is retrieved from. One of [POSTGRES, RESOURCE].POSTGRES
factcast.blacklist.locationOnly required if type=RESOURCE. Specifies the URL where the JSON file containing the blacklist is located.classpath:blacklist.jsonfile:/some/path/blocked-facts.json

Testing

PropertyDescriptionDefault
factcast.store.integrationTestModewhen set to true, disables all non-essential memory-internal caches, timing might differ to production of course.false

UI

PropertyDescriptionDefault
vaadin.productionModeShould be set to true, otherwise vaadin tries to generate a dev bundle which is not necessary, and probably will fail.false

Further details can be found here : net.devh.boot.grpc.server.config.GrpcServerProperties.

Last modified October 23, 2024 : #3208: clarification (83c460fcf)