Quarkus Chicory integrates the Chicory WebAssembly runtime with Quarkus, enabling seamless execution of WebAssembly modules within Java applications.
The extension provides environment-aware WebAssembly module management through CDI injection, with automatic optimization for development, production, and native image deployments.
- Injectable WebAssembly Context - Access WASM context via CDI with
@Injectand@Named - Environment-Optimized Execution - Automatic selection of interpreter, runtime compiler, or build-time compilation based on execution context
- Multi-Module Support - Configure and manage multiple independent WASM modules
- Build-Time Code Generation - Build-time compilation of WASM to JVM bytecode for optimal performance
- Live Reload - Automatic module recompilation in development mode when WASM files change
- WASI Support - Integrates Chicory WebAssembly System Interface implementation
- Native Image Compatible - First-class support for GraalVM native images
Add the extension to your project:
<dependency>
<groupId>io.quarkiverse.chicory</groupId>
<artifactId>quarkus-chicory</artifactId>
<version>${quarkus-chicory.version}</version>
</dependency>Configure a WASM module in application.properties:
quarkus.chicory.modules.my-module.wasm-file=src/main/resources/my-module.wasmInject and use in your application:
@Inject
@Named("my-module")
WasmQuarkusContext wasmContext;
@PostConstruct
void init() {
Instance instance = Instance.builder(wasmContext.getWasmModule())
.withMachineFactory(wasmContext.getMachineFactory())
.build();
ExportFunction add = instance.export("add");
long[] result = add.apply(40, 2);
}For comprehensive documentation, configuration options, and advanced usage examples, see the full documentation.
Contributions are welcome! Please refer to the Quarkiverse contribution guidelines for more information.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
