Forage¶
Opinionated bean factories for Apache Camel.
Forage eliminates manual Java bean instantiation by providing factory classes configurable through properties files, environment variables, or system properties. Write your Camel routes — Forage handles the wiring.
Why Forage?¶
Apache Camel components often require manually creating and registering Java beans — data sources, connection factories, AI models, transaction managers. Forage replaces that boilerplate with a configuration-driven approach:
# "ordersDb" becomes a named bean — use it in routes as #ordersDb
forage.ordersDb.jdbc.db.kind=postgresql
forage.ordersDb.jdbc.url=jdbc:postgresql://localhost:5432/orders
forage.ordersDb.jdbc.username=admin
forage.ordersDb.jdbc.password=secret
No Java code. No Spring @Bean methods. No Quarkus producers. Just properties. The name you choose (e.g. ordersDb) registers a bean in the Camel registry, ready to reference in your routes as #ordersDb.
Features¶
- JDBC — Auto-configured datasources with connection pooling
- JMS — Connection factories for ActiveMQ Artemis and more
- AI Agents — LangChain4j integration with tool use and memory
- Chat Models — OpenAI, Ollama, Gemini, Anthropic, and more
- Vector DBs — Qdrant, Milvus, PGVector, and more
- Transactions — XA distributed transactions with Narayana
Runtime Support¶
Forage works with all major Camel runtimes:
| Runtime | Support |
|---|---|
| Camel JBang | Run directly with camel run (Forage plugin auto-discovers dependencies) |
| Camel Spring Boot | Auto-configuration via starters |
| Camel Quarkus | Native compilation ready |
Quick Example¶
A complete AI agent with tool use in just two files:
Versions¶
Forage publishes release streams so you can match your Apache Camel version:
| Stream | Forage | Apache Camel | Description |
|---|---|---|---|
| LTS | 1.6.2 | 4.22.2 | Tracks the current Camel LTS line — recommended for production |
| Previous LTS | 1.4.2 | 4.18.5 | Maintenance releases for the previous Camel LTS line |
| Latest | 1.7.0 | 4.23.0 | Tracks the newest (non-LTS) Camel release |
All releases
Each Forage release is built against the exact Apache Camel version below. Install the release that matches your Camel CLI with camel plugin add forage --gav io.kaoto.forage:camel-jbang-plugin-forage:<forage-version>.
| Forage | Apache Camel |
|---|---|
| 1.7.0 | 4.23.0 |
| 1.6.2 | 4.22.2 |
| 1.6.1 | 4.22.1 |
| 1.6.0 | 4.22.0 |
| 1.5.0 | 4.20.0 |
| 1.4.2 | 4.18.5 |
| 1.4.1 | 4.18.4 |
| 1.4.0 | 4.18.3 |
| 1.3 | 4.18.2 |
| 1.2 | 4.18.2 |
| 1.1 | 4.18.1 |
| 1.0 | 4.17.0 |
Pick the stream that matches the Camel version you use, then follow the Getting Started guide.
Installing the plugin for your Camel version
camel plugin add forage without a version installs the newest Forage release, which belongs to the Latest stream. On a Camel LTS CLI, install the matching stream explicitly, for example camel plugin add forage --gav io.kaoto.forage:camel-jbang-plugin-forage:1.6.2. Since Forage 1.7.0, the plugin prints a warning when the Camel CLI is outside the range it supports.
Quarkus on the Latest stream
Camel Quarkus has no release built on Camel 4.23.0 yet, so Quarkus applications exported with Forage 1.7.0 use Camel Quarkus 3.40.x, which is built on Camel 4.22.x.
Getting Started¶
Ready to dive in? Head to the Getting Started guide.
Looking for working examples? Check out the Examples gallery.