You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Flink Agents project needs to support JDK 11 and above to ensure compatibility with the Apache Flink ecosystem. However, some external dependencies introduced in the project only support higher JDK versions, which presents challenges for multi-JDK support.
Taking the flink-agents-api module as an example, this module introduces the MCP (Model Context Protocol) SDK to support the MCP protocol, and MCP SDK only supports JDK 17+. This means:
If the released jar is compiled with JDK 17 and includes MCP code, JDK 11 users won't be able to use it due to class version incompatibility
If the released jar is compiled with JDK 11 and excludes MCP code, JDK 17+ users won't be able to use MCP features
Module-Specific Designs
flink-agents-api
Since users depend on flink-agents-api via Maven, and this module as a framework API is not suitable for shading external dependencies, the Maven Classifier approach is adopted:
flink-agents-api-{version}-jdk11.jar # JDK 11 version, without JDK 17+ features
flink-agents-api-{version}.jar # Default version, includes MCP and other JDK 17+ features
Design Principles
Default version ensures complete functionality: The default jar (no classifier) is compiled with JDK 17, ensuring all JDK 17+ users can use it directly with JDK 17+ features
Lower JDK compatibility provided via classifier: Users needing JDK versions below 17 explicitly specify the classifier
Unified dependency for the same module: Users only need to depend on the same artifactId, differentiating versions via classifier
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
The Flink Agents project needs to support JDK 11 and above to ensure compatibility with the Apache Flink ecosystem. However, some external dependencies introduced in the project only support higher JDK versions, which presents challenges for multi-JDK support.
Taking the
flink-agents-apimodule as an example, this module introduces the MCP (Model Context Protocol) SDK to support the MCP protocol, and MCP SDK only supports JDK 17+. This means:Module-Specific Designs
flink-agents-api
Since users depend on
flink-agents-apivia Maven, and this module as a framework API is not suitable for shading external dependencies, the Maven Classifier approach is adopted:Design Principles
User Usage
JDK 11+ users (without MCP features)
JDK 17+ users (need MCP features):
Version Contents
flink-agents-dist
flink-agents-distis an uber jar distributed with the Python package; users need to deploy it to the Flink cluster's lib directory. Because:The Multi-release JAR approach is adopted, where the JVM automatically selects the correct classes based on version at runtime:
JAR Structure
Runtime Behavior
META-INF/versions/17/, MCP features are availableAdvantages
flink-agents-plan / flink-agents-runtime
These two modules don't need multi-JDK support:
Other Modules
integrations/*and other modules currently have no JDK 17+ specific dependencies and don't need multi-version support for now.Summary
Beta Was this translation helpful? Give feedback.
All reactions