HOCON Format
HOCON provides several advantages over plain JSON:- Comments: Use
#or//for comments - No quotes required: Keys and most string values don’t need quotes
- Trailing commas: Allowed in lists and objects
- Environment variable substitution: Reference environment variables with
${?ENV_VAR} - Value concatenation: Extend or merge configuration blocks
- Include directives: Reference other configuration files
Basic Syntax Example
Configuration Structure
A Lucille configuration file consists of four main sections:Connectors
Define data sources and how documents are ingested
Pipelines
Configure processing stages for document transformation
Indexers
Set up search engine destinations and indexing behavior
Kafka
Configure distributed mode with Kafka messaging
Environment Variable Substitution
Use${?ENV_VAR} to reference environment variables with optional fallback:
? makes the substitution optional - if the environment variable isn’t set, the previous value is used.
Configuration Merging
HOCON allows you to declare configuration blocks and extend them later:Including External Files
You can reference other configuration files to organize complex configurations:file-to-file-example.conf in the source for more examples.
Duration Formats
Many configuration options accept duration strings in HOCON format:3s- 3 seconds5m- 5 minutes1h- 1 hour2d- 2 days6h- 6 hours
Configuration Validation
Lucille validates all configuration using the Spec system. Each component (connector, stage, indexer) declares apublic static Spec SPEC that defines:
- Required and optional parameters
- Parameter types (string, boolean, number, list, nested config)
- Validation rules
name property for easy debugging.
Validation Example
Thevalidation-example.conf file shows intentional configuration errors:
ConfigUtils Utility
Lucille providesConfigUtils for working with configurations:
Get a configuration value with a fallback default:
Create HTTP headers from a configuration block:
Best Practices
Use meaningful names
Use meaningful names
Always provide descriptive
name properties for connectors, pipelines, and stages. These names appear in logs and error messages.Externalize sensitive values
Externalize sensitive values
Never hardcode credentials. Use environment variables:
Organize complex configs with includes
Organize complex configs with includes
Split large configurations into logical files:
Comment your configurations
Comment your configurations
Document why specific settings are used:
Test configurations incrementally
Test configurations incrementally
When building complex pipelines, test with minimal configurations first, then add complexity:
- Start with one connector and empty pipeline
- Add stages one at a time
- Enable indexing last
IDE Support
For better HOCON editing in IntelliJ IDEA, install the HOCON plugin for syntax highlighting and formatting.Next Steps
Configure Connectors
Set up data sources to ingest documents
Build Pipelines
Create processing stages for document transformation
Set Up Indexers
Configure search engine destinations
Enable Kafka
Run Lucille in distributed mode