Repository navigation
CAMEL-25677: camel-wasm - remove the wasm language - #27929
Conversation
Since CAMEL-25531 the wasm endpoint runs WASI command modules. The wasm language still called a named exported function through the old alloc/dealloc and JSON envelope protocol. As decided on the review of CAMEL-25606, the language is removed instead of being moved to WASI; the module was experimental. Removed: - camel-wasm: WasmLanguage and WasmExpression, their generated language metadata, the language page, and the helpers only the language used (WasmFunction, WasmSupport, Wasm.FN_ALLOC, Wasm.FN_DEALLOC), with the Jackson dependencies, the language tests and the functions.wasm test module and its Rust sources. The endpoint test that used functions.wasm as a module without _start now builds that module from WAT. - core: the WasmExpression model, WasmExpressionReifier, wasm(...) in Builder, ExpressionClause, ExpressionClauseSupport and LanguageBuilderFactory, and the Java DSL writer support; the generated model metadata, XML, YAML and Java DSL parsers, writers and YAML schemas are regenerated, and so are the catalog (language, model and docs entries, the XML and YAML schemas), the language list of camel-main, ArtifactUtils and the endpoint DSL javadoc. - wasm in the language names of the language component, the camel-jbang checks and refactorings, and the YAML validator. The wasm endpoint is unchanged. The 4.24 upgrade guide says how to call a module with the endpoint instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. Clean, complete removal of the wasm expression language — all language classes, DSL integrations, service descriptors, catalog entries, generated files, and documentation are deleted. The wasm endpoint (WasmComponent, WasmEndpoint, WasmProducer, WasiCommand) is correctly preserved untouched. Upgrade guide accurately describes what was removed and provides a concrete migration example. No issues found.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
davsclaus
left a comment
There was a problem hiding this comment.
Claude Code on behalf of davsclaus
Thanks for the follow-up, this is a clean and complete removal of the wasm language as agreed on #27793. I checked for leftovers across the model, the builders, the XML/YAML/Java DSL parsers, writers and schemas, the catalog and the docs nav, and the generated files only drop wasm, consistent with their sources. The 4.24 upgrade guide documents the removed API and gives a migration path to the wasm endpoint.
Two small nits in camel-4x-upgrade-guide-4_24.adoc (outside the diff, so here):
- The new paragraph says the whole
WasmSupportclass is removed, so the bulletWasmSupport.deserialize(byte[], Exchange)further down, in "The following API ofcamel-wasmis removed or changed with the old ABI", is now redundant. Could you drop it so the class isn't listed twice? - Optional: the section heading
camel-wasm - the endpoint runs WASI command modules (Breaking change)now also covers the removal of thewasmlanguage, which is the bigger break for DSL users. Something likecamel-wasm - the endpoint runs WASI command modules and the wasm language is removed (Breaking change)would make it visible when scanning the guide.
FYI (no action needed here): camel-spring-boot's camel-wasm-starter has the generated WasmLanguageConfiguration / WasmLanguageAutoConfiguration, which will need to be removed when camel-spring-boot syncs to 4.24.
CI has not run on this head yet (the workflows are waiting for approval), so this approval assumes it goes green.
This review does not replace specialized AI review tools or static analysis such as SonarCloud.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔁 1 test passed only after a retry on JDK 17 (1 retried attempt) Recovered flaky tests on JDK 17 (1)
🔬 Scalpel shadow comparison — Scalpel: 581 of 705 tested, 0 compile-only — current: 581 all testedMaveniverse Scalpel detected 581 affected modules (current approach: 581). Skip-tests mode would test 581 modules (17 direct + 30 downstream), skip tests for 0 (generated code, meta-modules) Modules Scalpel would test (581)
💡 Manual integration tests recommended:
Build reactor — dependencies compiled but only changed modules were tested (17 modules, 4m 49s total)Total reactor time: 4m 49s
Top 20 slowest modules:
|
Description
CAMEL-25677
Part 3 of the camel-wasm redesign (part 1: #27678, part 2: #27793, both merged): remove the
wasmexpression language.Author: Shashank Mohan Jain (@allthingssecurity), working with Claude Code (Claude Opus 5.5).
Since CAMEL-25531 the
wasmendpoint runs WASI Preview 1 command modules: the message body is standard input and standard output becomes the new body. Thewasmlanguage still used the old protocol: it called a named exported function of the module through thealloc/deallocexports and a JSON envelope of the body and headers (WasmFunction,WasmSupport).On #27793 @davsclaus decided to remove the language rather than move it to WASI: "remove wasm language, this module was an experiment so its fine to do such changes", and "the removal can be in a follow up PR" (#27793 (comment)). This PR is that follow-up.
What is removed
org.apache.camel.language.wasm.WasmLanguageandWasmExpression, their generated language metadata and service files, and the language pagewasm-language.adoc(with its nav entry and the docs symlinks).org.apache.camel.wasm.WasmFunction,WasmSupport, and the constantsWasm.FN_ALLOCandWasm.FN_DEALLOC. The endpoint has not used them since CAMEL-25531.WasmSupportused them).functions.wasmtest module and its Rust sources.WasmComponentTestusedfunctions.wasmas an example of a module without_start; it now builds an equivalent module from WAT.org.apache.camel.model.language.WasmExpression,WasmExpressionReifier,wasm(...)inBuilder,ExpressionClause,ExpressionClauseSupportandLanguageBuilderFactory, the Java DSL writer support, and thewasmexpression of the XML and YAML DSLs (parsers, writers, schemas).wasmin the language names of thelanguagecomponent, of the camel-jbang AI bean-reference checks and route refactorings, and of the YAML validator's list of script languages.What stays
The
wasmendpoint (WasmComponent,WasmEndpoint,WasmProducer,WasiCommand,Wasm.SCHEME, theWasm.Headers) is unchanged, as is thecompileoption from #27793. camel-opa, which runs OPA policies with its own Wasm runtime, is not touched.Upgrade note
In the existing
=== camel-wasm - the endpoint runs WASI command modules (Breaking change)section of the 4.24 upgrade guide: the sentence "Thewasmlanguage is unchanged" is removed, the 4.23 note about a failed call discarding the instance now "no longer applies", and a new paragraph lists what is removed and says how to migrate: call the module with thewasmendpoint as a route step, for example.to("wasm:classpath:transform.wasm"), built as a WASI command module, and use its output (the new body) in the next steps. The 4.23 guide is not changed.Generated files
All generated files come from the project build; none was edited by hand.
languagecomponent and the YAML DSL: regenerated by building those modules.languages/wasm.json,models/wasm.jsonanddocs/wasm-language.adocdeleted; thewasmentries oflanguages.properties,models.propertiesanddocs.properties;wasmin theoneOfof 29 model JSON files and in the enum ofcomponents/language.json; the copies ofcamel-spring.xsd,camel-xml-io.xsdandcamelYamlDsl-model.json),camel-main'slanguages.properties, theLANGUAGEStable ofArtifactUtils(thewasmcomponent entry stays), and the language enum in the javadoc ofLanguageEndpointBuilderFactoryandStaticEndpointBuilders: produced by building camel-catalog (prepare-catalogand the helper goals) and camel-endpointdsl (generate-endpoint-dsl) after the core modules, camel-language, camel-wasm and camel-spring-xml (for the Spring XSD) were built from this branch.target/classes, or from the snapshot jar when the module was not built locally. I did not build all components, so the snapshot data of unrelated components produced unrelated changes in other generated files (other components' JSON, dev consoles,SecurityUtils,SensitiveUtils, other endpoint builders; in the YAML DSL schemas, anexpertproperty that is not in the core model ofmain). I discarded those unrelated generated changes and kept only the hunks that removewasm. I checked that every kept hunk only removeswasm, and that the kept model JSON,language.jsonand schema copies are byte-identical to the files of the modules they are copied from.mainafter the4.24.0-SNAPSHOTversion bump (Bump version to 4.24.0-SNAPSHOT #27901). The only conflicts were the three generatedwasmlanguage files that this PR deletes and thatmainchanged only in theirversion; they stay deleted. After the rebase, the diff againstmainis the same as before apart from that version, every changed line of the generated files only removeswasm, and rebuilding camel-wasm, camel-language, camel-core-model, camel-xml-io and camel-yaml-io (with their dependencies) leaves no changes. The catalog was not regenerated after the rebase: there are no4.24.0-SNAPSHOTsnapshot jars yet, so camel-catalog cannot be built without building every component.Tests
On the rebased commit:
WasmComponentTest58,WasmCompiledComponentTest58,WasiCommandTest8).MainHelperTest(camel-main, readslanguages.properties): 9 tests, 0 failures.languagecomponent and builder tests) 1345, 0 failures, 1 skipped; camel-xml-io 426, 0 failures, 2 skipped; camel-yaml-io 189, 0 failures; camel-java-io 187, 0 failures, 1 skipped; camel-core-model 10; camel-xml-io-util 8; camel-management 2.Before the rebase (on
4.23.0-SNAPSHOT), camel-catalog, the whole module: 1092 tests, 0 failures (includingCamelCatalogTest,CamelCatalogJsonSchemaTestand the doc examples tests). I could not run it again after the rebase, because its test dependencies need every component at4.24.0-SNAPSHOTand no snapshot jars of that version are published yet.Not run: camel-catalog after the rebase (see above), the camel-yaml-dsl validator tests (that module needs a build of every component), the camel-jbang tests, and the full root build.
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.(I built the modules listed above, with the formatter and import-sort plugins, and regenerated the catalog, camel-main and endpoint DSL files as described. I did not run the full root build.)
AI-assisted contributions
Co-authored-bytrailers) and the PR description identifies the AI tool used.This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a
Co-Authored-Bytrailer.Claude Code on behalf of allthingssecurity
🤖 Generated with Claude Code