Camel JBang¶
The Forage plugin for Camel JBang provides dependency resolution, property validation, hot reload, and export to production runtimes.
Installation¶
Running Routes¶
The * glob picks up all route files and properties in the current directory. You can also specify files explicitly:
With the Forage plugin installed, the standard camel run command automatically resolves all required Forage dependencies based on your configuration — no --dep flags needed.
Property Validation¶
The plugin validates your Forage properties against the catalog before running. This catches configuration errors early.
Typo Detection¶
[UNKNOWN_PROPERTY] in application.properties
Property: forage.myDb.jdbc.usernam
Unknown property 'usernam' for factory 'jdbc'. Did you mean 'username'?
Invalid Bean Values¶
[INVALID_BEAN_VALUE] in application.properties
Property: forage.myDb.jdbc.db.kind
Unknown database 'postgresqll'. Did you mean 'postgresql'?
Valid options: postgresql, mysql, mariadb, db2, h2, oracle
Unknown Properties¶
[UNKNOWN_PROPERTY] in application.properties
Property: forage.myDb.jdbc.invalid.property
Unknown property 'invalid.property' for factory 'jdbc'
Hot Reload¶
In dev mode, Forage watches .properties files for changes and automatically recreates beans without restarting:
When you edit a properties file, Forage:
- Clears the configuration cache
- Destroys old beans
- Creates new beans with updated configuration
- Resets Camel components so routes pick up the new beans
What Can Be Hot-Reloaded¶
- API keys, connection URLs, model names
- Connection pool sizes, timeouts
- Any
forage.*property value
What Requires a Restart¶
- Provider type changes — e.g., changing
db.kindfrompostgresqltomysql(requires different JARs) - Adding new factory types — e.g., adding JDBC when only AI was configured
- Environment variable changes — the file watcher monitors
.propertiesfiles only
Exporting to Production¶
Export your project to Spring Boot or Quarkus with all Forage dependencies included:
Testing Connections¶
Verify datasource connectivity without starting routes:
Configuration Commands¶
Read Forage configuration and output bean definitions as JSON:
Write configuration from JSON input: