Skip to content

Javascript-engine

This plugin allows execution of JavaScript code on streamed data using the GraalVM JavaScript engine.

JavaScript API

The JavaScript code can access the input data passed to the resource.

The JavaScript code should define a function named 'process' that takes the input data and returns the output data:

function process(input) {
  var output = ...
  return output;
}

Security Considerations

The JavaScript resource runs with limited permissions by default. In this configuration, it is granted access to public Java methods and fields, allowing interaction with host objects such as calling methods like Map.get() or accessing simple properties.

.configureResource(JavaScriptResourceConfigBuilder.builder()
)
resource:
  javascript-engine:

Java dependency management

Add this declaration to your dependency management system to access the configuration DSL for this plugin in Java.

<dependency>
    <groupId>org.voltdb</groupId>
    <artifactId>volt-stream-plugin-javascript-api</artifactId>
    <version>1.0-20250910-124207-release-1.5.3</version>
</dependency>
implementation group: 'org.voltdb', name: 'volt-stream-plugin-javascript-api', version: '1.0-20250910-124207-release-1.5.3'