Available starting with FlowX.AI 5.5.0The License service manages platform licensing, usage reporting, and connectivity between self-hosted deployments and the FlowX SaaS licensing infrastructure.
Dependencies
Before setting up the License service, ensure you have the following dependencies in place:- Organization Manager for organization lifecycle events and realm resolution
- PostgreSQL database for storing license and usage data
- Kafka for event-driven communication with other FlowX.AI services
- Redis for caching and master election
- Keycloak (or compatible OAuth2 provider) for authentication and authorization
- SpiceDB for fine-grained authorization
Infrastructure prerequisites
| Component | Description |
|---|---|
| PostgreSQL | Dedicated database for license data |
| Kafka | Message broker for inter-service communication |
| Redis | Caching layer and distributed lock for master election |
| Keycloak | Identity provider for service authentication |
| SpiceDB | Authorization service for fine-grained access control |
Configuration
Authorization configuration
| Environment Variable | Description | Default Value |
|---|---|---|
SECURITY_TYPE | Security type (JWT public key validation) | jwt-public-key |
SECURITY_OAUTH2_BASE_SERVER_URL | Base URL of the Keycloak server | |
SECURITY_OAUTH2_SAREALM | Service accounts realm ID | 00000002-0002-4002-8002-000000000002 |
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_ID | Service account client ID | flowx-license-sa |
SECURITY_OAUTH2_SERVICE_ACCOUNT_ADMIN_CLIENT_SECRET | Service account client secret | |
FLOWX_LIB_SECURITY_SERVICES_ORGANIZATIONMANAGER_BASEURL | Organization manager URL | http://organization-manager:80 |
PostgreSQL configuration
The License service uses its own dedicated PostgreSQL database.| Environment Variable | Description | Default Value |
|---|---|---|
SPRING_DATASOURCE_URL | JDBC connection URL for PostgreSQL | jdbc:postgresql://flowxlicensedb:5432/license |
SPRING_DATASOURCE_USERNAME | Database username | postgres |
SPRING_DATASOURCE_PASSWORD | Database password | - |
Redis configuration
The License service includes Redis in its configuration for caching and master election. Configure Redis connection using the standard Redis environment variables. Quick reference:| Environment Variable | Description | Example Value | Status |
|---|---|---|---|
SPRING_DATA_REDIS_HOST | Redis server hostname | localhost | Recommended |
SPRING_DATA_REDIS_PORT | Redis server port | 6379 | Recommended |
SPRING_DATA_REDIS_PASSWORD | Redis authentication password | - | Recommended |
REDIS_TTL | Cache TTL in milliseconds | 5000000 | Optional |
Both
SPRING_DATA_REDIS_* and SPRING_REDIS_* variable prefixes are supported. The SPRING_DATA_REDIS_* prefix is the modern Spring Boot standard and is recommended for new deployments.For advanced Redis deployment modes (Sentinel, Cluster) and SSL/TLS setup, see the Redis Configuration guide. Note that Sentinel and Cluster modes are only supported by the Events Gateway service.
Redis is configured but not actively used by the License service at this time. It is included as part of the standard Spring service setup and may be used in future versions.
Kafka configuration
Core Kafka settings
| Environment Variable | Description | Default Value |
|---|---|---|
SPRING_KAFKA_BOOTSTRAP_SERVERS | Address of the Kafka server(s) | localhost:9092 |
KAFKA_MESSAGE_MAX_BYTES | Maximum message size (bytes) | 52428800 (50 MB) |
Topic naming configuration
| Environment Variable | Description | Default Value |
|---|---|---|
KAFKA_TOPIC_NAMING_PACKAGE | Package prefix for topic names | ai.flowx. |
KAFKA_TOPIC_NAMING_ENVIRONMENT | Environment segment for topic names | |
KAFKA_TOPIC_NAMING_VERSION | Version suffix for topic names | .v1 |
KAFKA_TOPIC_NAMING_SEPARATOR | Primary separator for topic names | . |
KAFKA_TOPIC_NAMING_SEPARATOR2 | Secondary separator for topic names | - |
Kafka topics
The License service consumes events from the following topics:| Topic | Default Value | Description |
|---|---|---|
| License usage | ai.flowx.license.usage.v1 | Receives usage reporting events from other services |
| Organization events | ai.flowx.organization.events.v1 | Receives organization lifecycle events |
Kafka consumer threads
| Environment Variable | Description | Default Value |
|---|---|---|
KAFKA_CONSUMER_THREADS_LICENSE_USAGE | Thread count for license usage consumer | 6 |
KAFKA_CONSUMER_THREADS_ORGANIZATION_EVENTS | Thread count for organization events consumer | 2 |
KAFKA_AUTH_EXCEPTION_RETRY_INTERVAL | Retry interval after auth exception (seconds) | 10 |
CAS lib configuration (SpiceDB)
| Environment Variable | Description | Default Value |
|---|---|---|
FLOWX_LIB_CASCLIENT_SPICEDB_HOST | SpiceDB hostname | spicedb |
FLOWX_LIB_CASCLIENT_SPICEDB_PORT | SpiceDB gRPC port | 50051 |
FLOWX_LIB_CASCLIENT_SPICEDB_TOKEN | SpiceDB authentication token | - |
FlowX SaaS connection (self-hosted only)
Available starting with FlowX.AI 5.7.0Self-hosted (on-premises) deployments must configure the License service to connect to the FlowX SaaS licensing infrastructure for license validation and usage reporting.
| Environment Variable | Description | Default Value |
|---|---|---|
FLOWX_LICENSE_KEY | License key provided by FlowX (client secret from the SaaS license service account) | - |
FLOWX_LICENSE_AUTHSERVERURL | FlowX SaaS Keycloak authentication URL | - |
FLOWX_LICENSE_SERVERURL | FlowX SaaS license server API URL | - |
Logging configuration
| Environment Variable | Description | Default Value |
|---|---|---|
LOGGING_LEVEL_APP | Application-specific log level | INFO |
LOGGING_LEVEL_LIQUIBASE | Liquibase migration log level | INFO |
Secrets management
The License service requires several secrets to be configured. These should be stored securely and referenced via Kubernetes secrets or a secrets management solution.| Secret Name | Description |
|---|---|
SPRING_DATASOURCE_PASSWORD | PostgreSQL database password |
SPRING_REDIS_PASSWORD | Redis authentication password |
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_MAINIDENTITY_CLIENT_SECRET | Keycloak service account secret |
FLOWX_LIB_CASCLIENT_SPICEDB_TOKEN | SpiceDB authentication token |
Deployment
Helm values example
Below is an example Helm values configuration for deploying the License service:Network policies
The License service requires network access to the following services:| Service | Purpose | Pod Label |
|---|---|---|
| Kafka | Message broker communication | flowx.ai/egress-s-kafka |
| PostgreSQL | Primary data storage | flowx.ai/egress-s-postgresql |
| Redis | Caching and master election | flowx.ai/egress-s-redis |
| Keycloak | Authentication | flowx.ai/egress-s-keycloak |
| SpiceDB | Authorization | flowx.ai/egress-s-spicedb |
Monitoring
The License service exposes Prometheus metrics for monitoring. Turn on scraping by setting the pod label:Health endpoints
| Endpoint | Description |
|---|---|
/actuator/health | Health check endpoint |
/actuator/metrics | Prometheus metrics endpoint |
/actuator/info | App info endpoint |
Verify your setup
The License service pod is running and healthy:
kubectl get pods -l app=licenseThe health endpoint returns HTTP 200:
curl http://license:8080/actuator/healthDatabase migrations completed successfully — check pod logs for
Liquibase: Update has been successfulSpiceDB connection is established — check pod logs for successful CAS client initialization
Kafka topics
ai.flowx.license.usage.v1 and ai.flowx.organization.events.v1 exist and the service can consume from themTroubleshooting
Database connection failures
Database connection failures
Symptoms: Service fails to start with database connection errors.Solutions:
- Verify the
licensedatabase exists in PostgreSQL - Check that the database user has appropriate permissions
- Ensure network connectivity between the pod and PostgreSQL service
- Verify the JDBC URL format is correct
SpiceDB connection failures
SpiceDB connection failures
Symptoms: Authorization errors or service fails to initialize CAS client.Solutions:
- Verify SpiceDB is running and reachable at the configured host and port
- Check that the SpiceDB token is correct
- Ensure network policies allow gRPC traffic to SpiceDB on port
50051 - Review pod logs for specific CAS client error messages
Kafka consumer issues
Kafka consumer issues
Symptoms: License usage events or organization events not being processed.Solutions:
- Verify Kafka bootstrap servers are reachable
- Check that the
ai.flowx.license.usage.v1andai.flowx.organization.events.v1topics exist - Ensure the service has consumer permissions on the topics
- Check consumer group offsets for lag
Service account authentication errors
Service account authentication errors
Symptoms: 401/403 errors when communicating with other FlowX services.Solutions:
- Verify the Keycloak service account
flowx-license-sais properly configured - Check that client secrets match between configuration and Keycloak
- Ensure the service account has the
view-usersclient role assigned - Verify the service account realm UUID is correct
Related resources
Redis Configuration
Complete Redis setup including Sentinel and Cluster modes
Access Management
Configure roles and access rights
SpiceDB Configuration
Fine-grained authorization setup
IAM Configuration
Identity and access management setup including License service account

