This is an automated email from the ASF dual-hosted git repository. apupier pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 49664c859c1995029b1b8f88efeb76327dabbf1d Author: Aurélien Pupier <[email protected]> AuthorDate: Mon Aug 24 13:24:59 2026 +0200 Remove langchain4j SSE transport type support after upgrade to langchain4j 1.19.0, the SSE support has been removed https://github.com/langchain4j/langchain4j/commit/7f4e99fd637137ab9d3bf116eb62047ac757a818 Signed-off-by: Aurélien Pupier <[email protected]> --- .../catalog/components/langchain4j-agent.json | 4 ++-- .../camel/catalog/docs/langchain4j-agent-mcp.adoc | 4 ++-- .../langchain4j/agent/langchain4j-agent.json | 4 ++-- .../src/main/docs/langchain4j-agent-mcp.adoc | 4 ++-- .../agent/LangChain4jAgentConfiguration.java | 4 ++-- .../agent/LangChain4jMcpServerDefinition.java | 16 +-------------- .../ROOT/pages/camel-4x-upgrade-guide-4_23.adoc | 5 +++++ .../Langchain4jAgentComponentBuilderFactory.java | 12 +++++------ .../LangChain4jAgentEndpointBuilderFactory.java | 24 +++++++++++----------- 9 files changed, 34 insertions(+), 43 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json index 16f246407456..a9a55884f1d5 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json @@ -34,7 +34,7 @@ "tags": { "index": 7, "kind": "property", "displayName": "Tags", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Tags for discovering and calling Camel route tools" }, "autowiredEnabled": { "index": 8, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] "mcpClients": { "index": 9, "kind": "property", "displayName": "Mcp Clients", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List<dev.langchain4j.mcp.client.McpClient>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Pre-built MCP (Model Context Protocol) client insta [...] - "mcpServer": { "index": 10, "kind": "property", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] + "mcpServer": { "index": 10, "kind": "property", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] }, "headers": { "CamelLangChain4jAgentSystemMessage": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The system prompt.", "constantName": "org.apache.camel.component.langchain4j.agent.api.Headers#SYSTEM_MESSAGE" }, @@ -62,6 +62,6 @@ "tags": { "index": 6, "kind": "parameter", "displayName": "Tags", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Tags for discovering and calling Camel route tools" }, "lazyStartProducer": { "index": 7, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] "mcpClients": { "index": 8, "kind": "parameter", "displayName": "Mcp Clients", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List<dev.langchain4j.mcp.client.McpClient>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Pre-built MCP (Model Context Protocol) client inst [...] - "mcpServer": { "index": 9, "kind": "parameter", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] + "mcpServer": { "index": 9, "kind": "parameter", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-mcp.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-mcp.adoc index 0271864965c1..8411ec98fa4e 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-mcp.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/langchain4j-agent-mcp.adoc @@ -204,9 +204,9 @@ Supported properties: |=== | Property | Default | Description -| `transportType` | `stdio` | Transport type: `stdio`, `http` or `streamableHttp` (Streamable HTTP), or `sse` (legacy SSE) +| `transportType` | `stdio` | Transport type: `stdio`, `http` or `streamableHttp` (Streamable HTTP) | `command` | | Comma-separated command for stdio transport (e.g., `docker,run,-i,--rm,mcp/time`) -| `url` | | Server URL for `http` or `sse` transport +| `url` | | Server URL for `http` or `streamableHttp` transport | `environment.<key>` | | Environment variables for stdio transport | `timeout` | `60` | Timeout in seconds | `logRequests` | `false` | Log requests sent to the MCP server diff --git a/components/camel-ai/camel-langchain4j-agent/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/agent/langchain4j-agent.json b/components/camel-ai/camel-langchain4j-agent/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/agent/langchain4j-agent.json index 16f246407456..a9a55884f1d5 100644 --- a/components/camel-ai/camel-langchain4j-agent/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/agent/langchain4j-agent.json +++ b/components/camel-ai/camel-langchain4j-agent/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/agent/langchain4j-agent.json @@ -34,7 +34,7 @@ "tags": { "index": 7, "kind": "property", "displayName": "Tags", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Tags for discovering and calling Camel route tools" }, "autowiredEnabled": { "index": 8, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching t [...] "mcpClients": { "index": 9, "kind": "property", "displayName": "Mcp Clients", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List<dev.langchain4j.mcp.client.McpClient>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Pre-built MCP (Model Context Protocol) client insta [...] - "mcpServer": { "index": 10, "kind": "property", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] + "mcpServer": { "index": 10, "kind": "property", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] }, "headers": { "CamelLangChain4jAgentSystemMessage": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The system prompt.", "constantName": "org.apache.camel.component.langchain4j.agent.api.Headers#SYSTEM_MESSAGE" }, @@ -62,6 +62,6 @@ "tags": { "index": 6, "kind": "parameter", "displayName": "Tags", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Tags for discovering and calling Camel route tools" }, "lazyStartProducer": { "index": 7, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...] "mcpClients": { "index": 8, "kind": "parameter", "displayName": "Mcp Clients", "group": "advanced", "label": "advanced", "required": false, "type": "array", "javaType": "java.util.List<dev.langchain4j.mcp.client.McpClient>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Pre-built MCP (Model Context Protocol) client inst [...] - "mcpServer": { "index": 9, "kind": "parameter", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] + "mcpServer": { "index": 9, "kind": "parameter", "displayName": "Mcp Server", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "mcpServer.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "MCP server [...] } } diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/docs/langchain4j-agent-mcp.adoc b/components/camel-ai/camel-langchain4j-agent/src/main/docs/langchain4j-agent-mcp.adoc index 0271864965c1..8411ec98fa4e 100644 --- a/components/camel-ai/camel-langchain4j-agent/src/main/docs/langchain4j-agent-mcp.adoc +++ b/components/camel-ai/camel-langchain4j-agent/src/main/docs/langchain4j-agent-mcp.adoc @@ -204,9 +204,9 @@ Supported properties: |=== | Property | Default | Description -| `transportType` | `stdio` | Transport type: `stdio`, `http` or `streamableHttp` (Streamable HTTP), or `sse` (legacy SSE) +| `transportType` | `stdio` | Transport type: `stdio`, `http` or `streamableHttp` (Streamable HTTP) | `command` | | Comma-separated command for stdio transport (e.g., `docker,run,-i,--rm,mcp/time`) -| `url` | | Server URL for `http` or `sse` transport +| `url` | | Server URL for `http` or `streamableHttp` transport | `environment.<key>` | | Environment variables for stdio transport | `timeout` | `60` | Timeout in seconds | `logRequests` | `false` | Log requests sent to the MCP server diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jAgentConfiguration.java b/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jAgentConfiguration.java index 107d513d21c8..a8f0b0101239 100644 --- a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jAgentConfiguration.java +++ b/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jAgentConfiguration.java @@ -72,8 +72,8 @@ public class LangChain4jAgentConfiguration implements Cloneable { private Class<?> outputClass; @UriParam(description = "MCP server definitions in the form of mcpServer.<name>.<property>=<value>." - + " Supported properties: transportType (stdio, http, streamableHttp, or sse, default: stdio)," - + " command (comma-separated, for stdio), url (for http/sse)," + + " Supported properties: transportType (stdio, http or streamableHttp, default: stdio)," + + " command (comma-separated, for stdio), url (for http/streamableHttp)," + " environment.<key>=<value> (for stdio), timeout (in seconds, default: 60)," + " logRequests, logResponses," + " oauthProfile (OAuth profile for HTTP auth, requires camel-oauth).", diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jMcpServerDefinition.java b/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jMcpServerDefinition.java index a963c6ec06df..1b61474006fd 100644 --- a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jMcpServerDefinition.java +++ b/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/LangChain4jMcpServerDefinition.java @@ -23,7 +23,6 @@ import java.util.Map; import dev.langchain4j.mcp.client.DefaultMcpClient; import dev.langchain4j.mcp.client.McpClient; import dev.langchain4j.mcp.client.transport.McpTransport; -import dev.langchain4j.mcp.client.transport.http.HttpMcpTransport; import dev.langchain4j.mcp.client.transport.http.StreamableHttpMcpTransport; import dev.langchain4j.mcp.client.transport.stdio.StdioMcpTransport; import org.apache.camel.CamelContext; @@ -240,19 +239,6 @@ public class LangChain4jMcpServerDefinition { builder.customHeaders(authHeaders); } return builder.build(); - } else if ("sse".equalsIgnoreCase(transportType)) { - if (url == null || url.trim().isEmpty()) { - throw new IllegalArgumentException("URL is required for SSE MCP transport"); - } - HttpMcpTransport.Builder builder = new HttpMcpTransport.Builder() - .sseUrl(url) - .logRequests(logRequests) - .logResponses(logResponses) - .timeout(timeout); - if (authHeaders != null) { - builder.customHeaders(authHeaders); - } - return builder.build(); } else if ("stdio".equalsIgnoreCase(transportType)) { if (command == null || command.isEmpty()) { throw new IllegalArgumentException("Command is required for stdio MCP transport"); @@ -267,7 +253,7 @@ public class LangChain4jMcpServerDefinition { } else { throw new IllegalArgumentException( "Unsupported MCP transport type: " + transportType - + ". Supported values: stdio, http, streamableHttp, sse"); + + ". Supported values: stdio, http, streamableHttp"); } } } diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc index ee297b9db3c3..724529180b82 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc @@ -156,3 +156,8 @@ being dispatched to the route. Requests that differ from the configured context-path only by case are therefore now subject to the same constraint as the exact-case form. Deployments that relied on the previous behaviour to reach a route without a challenge will now receive `401`. + +=== camel-langchain4j + +The legacy `sse` `transportType` has been removed. It follows the support removal in +https://github.com/langchain4j/langchain4j/commit/7f4e99fd637137ab9d3bf116eb62047ac757a818[langchain4j-core 1.19.0]. diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java index 5521d8788833..5b02e643e350 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java @@ -242,12 +242,12 @@ public interface Langchain4jAgentComponentBuilderFactory { /** * MCP server definitions in the form of mcpServer..=. Supported - * properties: transportType (stdio, http, streamableHttp, or sse, - * default: stdio), command (comma-separated, for stdio), url (for - * http/sse), environment.= (for stdio), timeout (in seconds, default: - * 60), logRequests, logResponses, oauthProfile (OAuth profile for HTTP - * auth, requires camel-oauth). This is a multi-value option with - * prefix: mcpServer. + * properties: transportType (stdio, http or streamableHttp, default: + * stdio), command (comma-separated, for stdio), url (for + * http/streamableHttp), environment.= (for stdio), timeout (in seconds, + * default: 60), logRequests, logResponses, oauthProfile (OAuth profile + * for HTTP auth, requires camel-oauth). This is a multi-value option + * with prefix: mcpServer. * * The option is a: <code>java.util.Map&lt;java.lang.String, * java.lang.Object&gt;</code> type. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java index 64e161328b75..a0e6ad818223 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java @@ -312,12 +312,12 @@ public interface LangChain4jAgentEndpointBuilderFactory { } /** * MCP server definitions in the form of mcpServer..=. Supported - * properties: transportType (stdio, http, streamableHttp, or sse, - * default: stdio), command (comma-separated, for stdio), url (for - * http/sse), environment.= (for stdio), timeout (in seconds, default: - * 60), logRequests, logResponses, oauthProfile (OAuth profile for HTTP - * auth, requires camel-oauth). This is a multi-value option with - * prefix: mcpServer. + * properties: transportType (stdio, http or streamableHttp, default: + * stdio), command (comma-separated, for stdio), url (for + * http/streamableHttp), environment.= (for stdio), timeout (in seconds, + * default: 60), logRequests, logResponses, oauthProfile (OAuth profile + * for HTTP auth, requires camel-oauth). This is a multi-value option + * with prefix: mcpServer. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.Object></code> type. @@ -337,12 +337,12 @@ public interface LangChain4jAgentEndpointBuilderFactory { } /** * MCP server definitions in the form of mcpServer..=. Supported - * properties: transportType (stdio, http, streamableHttp, or sse, - * default: stdio), command (comma-separated, for stdio), url (for - * http/sse), environment.= (for stdio), timeout (in seconds, default: - * 60), logRequests, logResponses, oauthProfile (OAuth profile for HTTP - * auth, requires camel-oauth). This is a multi-value option with - * prefix: mcpServer. + * properties: transportType (stdio, http or streamableHttp, default: + * stdio), command (comma-separated, for stdio), url (for + * http/streamableHttp), environment.= (for stdio), timeout (in seconds, + * default: 60), logRequests, logResponses, oauthProfile (OAuth profile + * for HTTP auth, requires camel-oauth). This is a multi-value option + * with prefix: mcpServer. * * The option is a: <code>java.util.Map<java.lang.String, * java.lang.Object></code> type.
