Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/sql.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,41 @@ Or add the coordinates to your existing project:

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

If you are using SQL Aggregator in native mode, you have to register several classes for serialization using GraalVM
feature. Serialization support since GraalVM 21.0 allows developers to configure classes for serialization via
the serialization configuration file `-H:SerializationConfigurationResources=/path-to/serialization-config.json` option.
For more information see https://github.com/oracle/graal/pull/2730[pull request with feature].

Several classes has to be registered for serialization every time to make SQL Aggregator work in native.
Here is a template of `serialization-config.json` with all mandatory classes:

```
[
{
"name" : "java.lang.Integer"
},
{
"name" : "java.lang.Number"
},
{
"name" : "java.lang.String"
},
{
"name" : "java.util.HashMap"
},
{
"name" : "java.util.LinkedHashMap"
},
{
"name" : "org.apache.camel.support.DefaultExchangeHolder"
}
]
```



== Additional Camel Quarkus configuration

=== Configuring a DataSource
Expand Down
31 changes: 31 additions & 0 deletions extensions/sql/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
If you are using SQL Aggregator in native mode, you have to register several classes for serialization using GraalVM
feature. Serialization support since GraalVM 21.0 allows developers to configure classes for serialization via
the serialization configuration file `-H:SerializationConfigurationResources=/path-to/serialization-config.json` option.
For more information see https://github.com/oracle/graal/pull/2730[pull request with feature].

Several classes has to be registered for serialization every time to make SQL Aggregator work in native.
Here is a template of `serialization-config.json` with all mandatory classes:

```
[
{
"name" : "java.lang.Integer"
},
{
"name" : "java.lang.Number"
},
{
"name" : "java.lang.String"
},
{
"name" : "java.util.HashMap"
},
{
"name" : "java.util.LinkedHashMap"
},
{
"name" : "org.apache.camel.support.DefaultExchangeHolder"
}
]
```

Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
# Camel Quarkus SQL
#
quarkus.camel.sql.script-files=sql/get-camels.sql,sql/initDb.sql,sql/selectProjects.sql

#Serialization-config.json is a workaround until serilazation support makes it into Quarkus (see https://github.com/quarkusio/quarkus/pull/15380)
quarkus.native.additional-build-args=-H:SerializationConfigurationResources=serialization-config.json
20 changes: 20 additions & 0 deletions integration-tests/sql/src/main/resources/serialization-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"name" : "java.lang.Integer"
},
{
"name" : "java.lang.Number"
},
{
"name" : "java.lang.String"
},
{
"name" : "java.util.HashMap"
},
{
"name" : "java.util.LinkedHashMap"
},
{
"name" : "org.apache.camel.support.DefaultExchangeHolder"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.restassured.specification.RequestSpecification;
import org.apache.camel.component.sql.SqlConstants;
import org.apache.camel.util.CollectionHelper;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.given;
Expand Down Expand Up @@ -189,7 +188,6 @@ public void testIdempotentRepository() {
}

@Test
@Disabled //see https://github.com/apache/camel-quarkus/issues/2693
public void testAggregationRepository() {
postMapWithParam("/sql/toDirect/aggregation", "body", "A", CollectionHelper.mapOf("messageId", "123"))
.statusCode(200);
Expand Down