Skip to content

Commit

Permalink
Add support for InfinispanRemoteAggregationRepository
Browse files Browse the repository at this point in the history
Fixes #3657
  • Loading branch information
jamesnetherton committed Jul 7, 2022
1 parent f87d9d6 commit 96fc274
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 68 deletions.
13 changes: 6 additions & 7 deletions docs/modules/ROOT/pages/reference/extensions/infinispan.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,14 @@ 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.

== Camel Quarkus limitations

=== InfinispanRemoteAggregationRepository is unsupported

At present the `InfinispanRemoteAggregationRepository` is not supported. The are some planned https://github.com/apache/camel-quarkus/issues/3657[future enhancements] to make this possible.


== Additional Camel Quarkus configuration

=== Infinispan Client Configuration

You can either configure the Infinispan client via the relevant Camel Infinispan component & endpoint options, or you
may use the https://quarkus.io/guides/infinispan-client#configuration-reference[Quarkus Infinispan extension configuration properties].

=== Camel Infinispan `InfinispanRemoteAggregationRepository` in native mode

If you chose to use the `InfinispanRemoteAggregationRepository` in native mode, then you must xref:extensions/core.adoc#quarkus.camel.native.reflection.serialization-enabled[enable native serialization support].

6 changes: 0 additions & 6 deletions extensions/infinispan/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-infinispan</artifactId>
</dependency>

<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
6 changes: 6 additions & 0 deletions extensions/infinispan/runtime/src/main/doc/configuration.adoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
=== Infinispan Client Configuration

You can either configure the Infinispan client via the relevant Camel Infinispan component & endpoint options, or you
may use the https://quarkus.io/guides/infinispan-client#configuration-reference[Quarkus Infinispan extension configuration properties].

=== Camel Infinispan `InfinispanRemoteAggregationRepository` in native mode

If you chose to use the `InfinispanRemoteAggregationRepository` in native mode, then you must xref:extensions/core.adoc#quarkus.camel.native.reflection.serialization-enabled[enable native serialization support].
3 changes: 0 additions & 3 deletions extensions/infinispan/runtime/src/main/doc/limitations.adoc

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,19 @@ public void configure() {
.autoStartup(false)
.to("mock:camelResultCreated");

// TODO: Reinstate aggregationRepository routes this https://github.com/apache/camel-quarkus/issues/3657
//from("direct:camelAggregation")
// .aggregate(header(CORRELATOR_HEADER))
// .aggregationRepository(createAggregationRepository("infinispan"))
// .aggregationStrategy(createAggregationStrategy())
// .completionSize(COMPLETION_SIZE)
// .to("mock:camelAggregationResult");

//from("direct:quarkusAggregation")
// .aggregate(header(CORRELATOR_HEADER))
// .aggregationRepository(createAggregationRepository("infinispan-quarkus"))
// .aggregationStrategy(createAggregationStrategy())
// .completionSize(COMPLETION_SIZE)
// .to("mock:quarkusAggregationResult");
from("direct:camelAggregation")
.aggregate(header(CORRELATOR_HEADER))
.aggregationRepository(createAggregationRepository("infinispan"))
.aggregationStrategy(createAggregationStrategy())
.completionSize(COMPLETION_SIZE)
.to("mock:camelAggregationResult");

from("direct:quarkusAggregation")
.aggregate(header(CORRELATOR_HEADER))
.aggregationRepository(createAggregationRepository("infinispan-quarkus"))
.aggregationStrategy(createAggregationStrategy())
.completionSize(COMPLETION_SIZE)
.to("mock:quarkusAggregationResult");

from("direct:camelIdempotent")
.idempotentConsumer(header("MessageID"), createIdempotentRepository("infinispan"))
Expand Down Expand Up @@ -247,11 +246,9 @@ private InfinispanRemoteConfiguration getConfiguration(String componentName) {
InfinispanRemoteComponent component = camelContext.getComponent(componentName, InfinispanRemoteComponent.class);
InfinispanRemoteConfiguration configuration = component.getConfiguration().clone();
configuration.setCacheContainerConfiguration(getConfigurationBuilder());
if (componentName.equals("infinispan-quarkus")) {
Set<RemoteCacheManager> beans = camelContext.getRegistry().findByType(RemoteCacheManager.class);
RemoteCacheManager cacheManager = beans.iterator().next();
configuration.setCacheContainer(cacheManager);
}
Set<RemoteCacheManager> beans = camelContext.getRegistry().findByType(RemoteCacheManager.class);
RemoteCacheManager cacheManager = beans.iterator().next();
configuration.setCacheContainer(cacheManager);
return configuration;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------
quarkus.infinispan-client.devservices.enabled=false

# Required by InfinispanRemoteAggregationRepository
quarkus.camel.native.reflection.serialization-enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand Down Expand Up @@ -52,7 +51,6 @@ public void afterEach() {
}
}

@Disabled("https://github.com/apache/camel-quarkus/issues/3657")
@ParameterizedTest
@MethodSource("componentNames")
public void aggregate(String componentName) {
Expand Down

0 comments on commit 96fc274

Please sign in to comment.