This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 355b5a1b3495 Regen
355b5a1b3495 is described below
commit 355b5a1b3495fc46b982a79cbe492ead8abbcbf4
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Jul 22 10:23:30 2026 +0200
Regen
---
.../catalog/docs/langchain4j-agent-component.adoc | 28 +++++---
.../org/apache/camel/catalog/docs/main.adoc | 3 +-
.../org/apache/camel/catalog/docs/openai-mcp.adoc | 8 +++
.../camel/catalog/docs/resilience4j-eip.adoc | 81 ++++++++++++++++++++++
4 files changed, 109 insertions(+), 11 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-component.adoc
index af39c1b8079e..143a168fd3d4 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-component.adoc
@@ -21,7 +21,7 @@ The LangChain4j Agent component provides comprehensive AI
agent capabilities by
The LangChain4j Agent component offers the following key features:
* **Agent-Based Architecture**: Flexible agent creation using the `Agent` API
interface
-* **Tool Integration**: Seamless integration with Camel routes via the
`langchain4j-tools` component
+* **Tool Integration**: Seamless integration with Camel routes via the
`ai-tool` component
* **MCP Tools**: Integration with Model Context Protocol (MCP) tools for
external system access
* **Conversation Memory**: Persistent chat memory for maintaining conversation
context
* **RAG Support**: Integration with retrieval systems for naive and advanced
RAG
@@ -502,7 +502,7 @@ String response = template.requestBody("direct:chat", body,
String.class);
=== Chat with Tools
-Integrate with Camel routes as tools. The LangChain4j Agent component
integrates with Camel Routes defined using the Camel LangChain4j Tools
component via the `tags` parameter.
+Integrate with Camel routes as tools. The LangChain4j Agent component
integrates with Camel Routes defined using the `ai-tool` component via the
`tags` parameter.
[tabs]
====
@@ -511,10 +511,10 @@ Java::
[source,java]
----
// Define tool routes
-from("langchain4j-tools:userDb?tags=users&description=Query user
database¶meter.userId=string")
+from("ai-tool:userDb?tags=users&description=Query user
database¶meter.userId=string")
.setBody(constant("{\"name\": \"John Doe\", \"id\": \"123\"}"));
-from("langchain4j-tools:weather?tags=weather&description=Get weather
information¶meter.city=string")
+from("ai-tool:weather?tags=weather&description=Get weather
information¶meter.city=string")
.setBody(constant("{\"weather\": \"sunny\", \"temperature\": \"22°C\"}"));
// Agent with tools (using the created agent)
@@ -528,14 +528,14 @@ XML::
----
<!-- Define tool routes -->
<route>
- <from uri="langchain4j-tools:userDb?tags=users&description=Query user
database&parameter.userId=string"/>
+ <from uri="ai-tool:userDb?tags=users&description=Query user
database&parameter.userId=string"/>
<setBody>
<constant>{"name": "John Doe", "id": "123"}</constant>
</setBody>
</route>
<route>
- <from uri="langchain4j-tools:weather?tags=weather&description=Get
weather information&parameter.city=string"/>
+ <from uri="ai-tool:weather?tags=weather&description=Get weather
information&parameter.city=string"/>
<setBody>
<constant>{"weather": "sunny", "temperature": "22°C"}</constant>
</setBody>
@@ -555,7 +555,7 @@ YAML::
# Define tool routes
- route:
from:
- uri: langchain4j-tools:userDb
+ uri: ai-tool:userDb
parameters:
tags: users
description: Query user database
@@ -566,7 +566,7 @@ YAML::
- route:
from:
- uri: langchain4j-tools:weather
+ uri: ai-tool:weather
parameters:
tags: weather
description: Get weather information
@@ -602,7 +602,15 @@ String response =
template.requestBodyAndHeader("direct:chat",
[NOTE]
====
-There's no need to add Camel LangChain4j Tools component as a dependency when
using the tools with LangChain4j Agent component.
+Add the `camel-ai-tool` dependency to use Camel route tools with the
LangChain4j Agent component:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-ai-tool</artifactId>
+</dependency>
+----
====
=== Custom LangChain4j Tools
@@ -726,7 +734,7 @@ You can combine both Camel route tools (via `tags`) and
custom LangChain4j tools
[source,java]
----
// Define Camel route tools
-from("langchain4j-tools:weatherService?tags=weather&description=Get current
weather information¶meter.location=string")
+from("ai-tool:weatherService?tags=weather&description=Get current weather
information¶meter.location=string")
.setBody(constant("{\"weather\": \"sunny\", \"location\": \"Current
Location\"}"));
// Create custom tool instances
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
index 3cd4bcc174eb..cfd34759d89d 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/main.adoc
@@ -678,11 +678,12 @@ The camel.faulttolerance supports 12 options, which are
listed below.
=== Resilience4j EIP Circuit Breaker configurations
-The camel.resilience4j supports 24 options, which are listed below.
+The camel.resilience4j supports 25 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
+| *camel.resilience4j.asynchronous* | Whether to use asynchronous
(non-blocking) processing using Resilience4j's CompletionStage-based
decorators. When enabled, the caller thread is released immediately and
processing completes asynchronously. | false | Boolean
| *camel.resilience4j.automaticTransitionFromOpenToHalfOpenEnabled* | Enables
automatic transition from OPEN to HALF_OPEN state once the
waitDurationInOpenState has passed. | false | Boolean
| *camel.resilience4j.bulkheadEnabled* | Whether bulkhead is enabled or not on
the circuit breaker. | false | Boolean
| *camel.resilience4j.bulkheadFairCallHandlingEnabled* | Configures whether
the bulkhead uses a fair calling strategy. When enabled (default), a fair
strategy guarantees the order of incoming requests (FIFO). When disabled, no
ordering is guaranteed and may improve throughput. | true | Boolean
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openai-mcp.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openai-mcp.adoc
index c5ee338255da..866621a92f51 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openai-mcp.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openai-mcp.adoc
@@ -187,6 +187,14 @@ When the model responds with tool calls, the component
automatically:
The `maxToolIterations` option (default: 50) prevents infinite loops. If
exceeded, an `IllegalStateException` is thrown.
+The `maxAgenticTokens` option (default: `0`, unlimited) caps cumulative prompt
plus completion tokens across the agentic loop.
+When the budget is exceeded after an API call that requests further tool
execution, an `IllegalStateException` is thrown and no additional API calls are
made.
+Enforcement is post-call, so actual spend may exceed the configured budget by
up to one API call.
+A final text response is still returned when cumulative usage exceeds the
budget, because no further spend occurs after that point.
+
+During the agentic loop, `CamelOpenAIAgenticPromptTokens`,
`CamelOpenAIAgenticCompletionTokens`, and `CamelOpenAIAgenticTotalTokens`
expose cumulative usage across all iterations.
+The per-call headers `CamelOpenAIPromptTokens`, `CamelOpenAICompletionTokens`,
and `CamelOpenAITotalTokens` reflect only the latest API call.
+
Set `autoToolExecution=false` to disable the agentic loop and receive raw tool
calls in the message body instead:
[tabs]
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
index aa84fc1eb53c..f7e90244e5ea 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
@@ -154,6 +154,87 @@ YAML::
In this example if calling the downstream service does not return a response
within 2 seconds,
a timeout is triggered, and the exchange will fail with a `TimeoutException`.
+=== Asynchronous (non-blocking) processing
+
+By default, the Resilience4j circuit breaker processes exchanges synchronously,
+blocking the caller thread until the protected operation completes.
+When `asynchronous` is enabled, the circuit breaker uses Resilience4j's
CompletionStage-based
+decorators, which release the caller thread immediately and complete
processing asynchronously.
+
+This is most valuable when the downstream processor supports asynchronous
processing
+(e.g., Netty HTTP, Kafka), as it avoids blocking threads while waiting for
responses.
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("direct:start")
+ .circuitBreaker()
+ .resilience4jConfiguration()
+ .asynchronous(true)
+ .timeoutEnabled(true)
+ .timeoutDuration(2000)
+ .end()
+ .to("http://fooservice.com/faulty")
+ .onFallback()
+ .transform().constant("Fallback message")
+ .end()
+ .to("mock:result");
+----
+
+XML::
++
+[source,xml]
+----
+<route>
+ <from uri="direct:start"/>
+ <circuitBreaker>
+ <resilience4jConfiguration asynchronous="true" timeoutEnabled="true"
timeoutDuration="2000"/>
+ <to uri="http://fooservice.com/faulty"/>
+ <onFallback>
+ <transform>
+ <constant>Fallback message</constant>
+ </transform>
+ </onFallback>
+ </circuitBreaker>
+ <to uri="mock:result"/>
+</route>
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:start
+ steps:
+ - circuitBreaker:
+ steps:
+ - resilience4jConfiguration:
+ asynchronous: "true"
+ timeoutDuration: 2000
+ timeoutEnabled: "true"
+ - to:
+ uri: http://fooservice.com/faulty
+ - onFallback:
+ steps:
+ - transform:
+ expression:
+ constant:
+ expression: Fallback message
+ - to:
+ uri: mock:result
+----
+====
+
+NOTE: When using asynchronous mode with timeout, the `timeoutExecutorService`
must be
+a `ScheduledExecutorService`. If not provided, Camel will automatically create
one.
+If a custom executor is provided that is not a `ScheduledExecutorService`, the
route will
+fail to start with an `IllegalArgumentException`.
+
=== Camel's Error Handler and Circuit Breaker EIP
By default, the xref:circuitBreaker-eip.adoc[Circuit Breaker] EIP handles
errors by itself.