Skip to main content

Worker-Java

The Worker-Java executes the provided Groovy/Java code at the remote worker. More information about the worker at: https://github.com/apioo/fusio-worker-java

Example

def connection = connector.getConnection("app");

def entries = [];
def query = "SELECT name, description FROM app_product_0";
try (def stmt = connection.createStatement()) {
def rs = stmt.executeQuery(query);
while (rs.next()) {
entries.add([
name: rs.getString("name"),
description: rs.getString("description")
]);
}
}

response.build(200, [:], [
foo: "bar",
entries: entries
]);

Types

This table contains an overview which connection types are implemented and which implementation is used:

TypeImplementation
Fusio.Adapter.Sql.Connection.Sqljava.sql.Connection
Fusio.Adapter.Sql.Connection.SqlAdvancedjava.sql.Connection
Fusio.Adapter.Http.Connection.Httporg.apache.http.client.HttpClient
Fusio.Adapter.Mongodb.Connection.MongoDBcom.mongodb.client.MongoDatabase
Fusio.Adapter.Elasticsearch.Connection.Elasticsearchorg.elasticsearch.client.RestHighLevelClient

Video