apache / apache/camel-quarkus

Remove LangChain4jMcpServerDefinition substitution when Camel drops HttpMcpTransport usage

Open
#9,025 0 comments 0 reactions 0 assignees View on GitHub
area/housekeeping area/native housekeeping native
Dominant language
Java
Stars
302
Forks
232
Avg merge
1d 20h
Merged PRs (30d)
114

Description

`camel-langchain4j-agent` still references `dev.langchain4j.mcp.client.transport.http.HttpMcpTransport` for the deprecated `sse` MCP transport type. That class was removed in LangChain4j `1.19.0`, which Camel Quarkus picked up when aligning with Quarkus LangChain4j `1.13.0`.

Because Quarkus passes a bare `--link-at-build-time`, the unresolvable type fails native image analysis of `LangChain4jMcpServerDefinition.buildTransport`:

```
Error: Discovered unresolved type during parsing: dev.langchain4j.mcp.client.transport.http.HttpMcpTransport$Builder.
This error is reported at image build time because class
org.apache.camel.component.langchain4j.agent.LangChain4jMcpServerDefinition is registered for linking at image build time
by command line and command line.
Error encountered while parsing org.apache.camel.component.langchain4j.agent.LangChain4jMcpServerDefinition.buildClient(LangChain4jMcpServerDefinition.java:208)
```

As a workaround, `LangChain4jMcpServerDefinitionSubstitutions` in `camel-quarkus-support-langchain4j` substitutes `buildTransport` to drop the `sse` branch. The substitution duplicates the upstream method body for the remaining transports, so it will drift if Camel changes that code.

Note that in JVM mode the `sse` transport type fails with `NoClassDefFoundError`, since the substitution applies to native mode only.

Once Camel drops its usage of `HttpMcpTransport`, the following can be removed:

* `extensions-support/langchain4j/runtime/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/graal/LangChain4jMcpServerDefinitionSubstitutions.java`
* The `org.graalvm.sdk:nativeimage` dependency in `extensions-support/langchain4j/runtime/pom.xml`, if nothing else needs it
* `extensions/langchain4j-agent/runtime/src/main/doc/limitations.adoc`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by checking whether Camel has dropped its HttpMcpTransport usage, then inspect LangChain4jMcpServerDefinitionSubstitutions.java, extensions-support/langchain4j/runtime/pom.xml, and extensions/langchain4j-agent/runtime/src/main/doc/limitations.adoc. Done means the obsolete substitution and any now-unused nativeimage dependency or limitation text are removed, with no remaining references to the removed transport class.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, documentation
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.