Infrastructure prerequisites

Before proceeding with the setup, ensure that the following components have been set up:
  • Redis
  • Kafka

Configuration

Configuring Kafka

Set the following Kafka-related configurations using environment variables:
  • SPRING_KAFKA_BOOTSTRAPSERVERS - the address of the Kafka server, it should be in the format “host:port”

Groupd IDs

The configuration parameters “KAFKA_CONSUMER_GROUPID_*” are used to set the consumer group name for Kafka consumers that consume messages from topics. Consumer groups in Kafka allow for parallel message processing by distributing the workload among multiple consumer instances. By configuring the consumer group ID, you can specify the logical grouping of consumers that work together to process messages from the same topic, enabling scalable and fault-tolerant message consumption in your Kafka application.
Configuration ParameterDefault valueDescription
KAFKA_CONSUMER_GROUPID_PROCESSENGINECOMMANDS_MESSAGEengine-commands-messageConsumer group ID for processing engine commands messages
KAFKA_CONSUMER_GROUPID_PROCESSENGINECOMMANDS_DISCONNECTengine-commands-disconnectConsumer group ID for processing engine commands disconnect messages
KAFKA_CONSUMER_GROUPID_PROCESSENGINECOMMANDS_CONNECTengine-commands-connectConsumer group ID for processing engine commands connect messages
KAFKA_CONSUMER_GROUPID_PROCESS_TASKCOMMANDS_MESSAGEtask-commands-messageConsumer group ID for processing task commands
KAFKA_CONSUMER_GROUPID_PROCESSVERSIONCOMMANDS_MESSAGEprocess-version-commands-messageConsumer group ID for processing process version commands messages
KAFKA_CONSUMER_GROUPID_GENERICCOMMANDSgeneric-commands-messageConsumer group ID for processing generic commands messages
KAFKA_CONSUMER_GROUPID_USERBROADCASTCOMMANDSuser-broadcast-commands-messageConsumer group ID for processing user broadcast commands messages

Threads

The configuration parameters “KAFKA_CONSUMER_THREADS_*” are utilized to specify the number of threads assigned to Kafka consumers for processing messages from topics. These parameters allow you to fine-tune the concurrency and parallelism of your Kafka consumer application, enabling efficient and scalable message consumption from Kafka topics.
Configuration ParameterDefault valueDescription
KAFKA_CONSUMER_THREADS_PROCESSENGINECOMMANDS_MESSAGE10Number of threads for processing engine commands messages
KAFKA_CONSUMER_THREADS_PROCESSENGINECOMMANDS_DISCONNECT5Number of threads for processing engine commands disconnect messages
KAFKA_CONSUMER_THREADS_PROCESSENGINECOMMANDS_CONNECT5Number of threads for processing engine commands connect messages
KAFKA_CONSUMER_THREADS_TASKCOMMANDS10Number of threads for task commands
KAFKA_CONSUMER_THREADS_PROCESSVERSIONCOMMANDS10Number of threads for processing process version commands messages
KAFKA_CONSUMER_THREADS_GENERICCOMMANDS10Number of threads for processing generic commands messages
KAFKA_CONSUMER_THREADS_USERBROADCASTCOMMANDS10Number of threads for processing user broadcast commands messages
Configuration ParameterDefault value
KAFKA_TOPIC_EVENTSGATEWAY_PROCESSINSTANCE_IN_MESSAGEai.flowx.dev.eventsgateway.engine.commands.message.v1
KAFKA_TOPIC_EVENTSGATEWAY_PROCESSINSTANCE_IN_DISCONNECTai.flowx.dev.eventsgateway.engine.commands.disconnect.v1
KAFKA_TOPIC_EVENTSGATEWAY_PROCESSINSTANCE_IN_CONNECTai.flowx.dev.eventsgateway.engine.commands.connect.v1
Configuration ParameterDefault value
KAFKA_TOPIC_EVENTSGATEWAY_PROCESSVERSION_IN_MESSAGEai.flowx.dev.eventsgateway.process-version-commands.message.v1
Configuration ParameterDefault value
KAFKA_TOPIC_EVENTSGATEWAY_USERMESSAGES_IN_MESSAGEai.flowx.dev.core.designer.notification.user.v1

Configuring authorization & access roles

Set the following environment variables to connect to the identity management platform:
Configuration ParameterDescription
SECURITY_OAUTH2_BASESERVERURLBase URL of the OAuth2 server
SECURITY_OAUTH2_CLIENT_CLIENTIDClient ID for OAuth2 authentication
SECURITY_OAUTH2_CLIENT_CLIENTSECRETClient secret for OAuth2 authentication
SECURITY_OAUTH2_REALMRealm for OAuth2 authentication

Redis configuration

FlowX Events Gateway supports three Redis deployment modes. The process engine sends messages to the events-gateway, which is responsible for sending them to Redis.

Standalone mode (default)

For single Redis instance deployments:
Configuration ParameterDescription
SPRING_DATA_REDIS_HOSTHostname of the Redis server
SPRING_DATA_REDIS_PASSWORDPassword for Redis server
SPRING_DATA_REDIS_PORTConnect to the Redis server

Sentinel mode

For high-availability Redis with automatic failover:
Configuration ParameterDescriptionExample Value
SPRING_DATA_REDIS_SENTINEL_MASTERName of the Redis master instancemymaster
SPRING_DATA_REDIS_SENTINEL_NODESComma-separated list of Sentinel nodeshost1:26379,host2:26379,host3:26379
SPRING_DATA_REDIS_PASSWORDPassword for Redis authentication

Cluster mode

For Redis cluster deployments with data sharding:
Configuration ParameterDescriptionExample Value
SPRING_DATA_REDIS_CLUSTER_NODESComma-separated list of cluster nodeshost1:6379,host2:6379,host3:6379
SPRING_DATA_REDIS_PASSWORDPassword for Redis authenticationyourpassword
Starting with FlowX 5.x, Master-Replica mode is no longer supported. Use Sentinel mode for high availability with automatic failover, or Cluster mode for horizontal scaling.
Redis Deployment Modes:
  • Standalone: Single Redis instance (suitable for development and low-traffic environments)
  • Sentinel: High availability with automatic failover (recommended for production)
  • Cluster: Horizontal scaling with data sharding (for high-throughput applications)
Choose the appropriate mode based on your availability and scalability requirements.

Events

This configuration helps manage how event data is stored and accessed in Redis.
Configuration ParameterDefaultDescription
EVENTS_REDIS_FREQUENCYMILLIS200Time interval (in milliseconds) between Redis queries by the events gateway to check for new messages
EVENTS_REDIS_TTLHOURS4Sets the time-to-live for events in Redis to 4 hours

Configuring logging

The following environment variables could be set in order to control log levels:
Configuration ParameterDescription
LOGGING_LEVEL_ROOTLogging level for the root Spring Boot microservice logs
LOGGING_LEVEL_APPLogging level for the application-level logs