Skip to content
Permalink
Browse files
Remove infinispan-core dependency for unsupported InfinispanRemoteAgg…
…regationRepository
  • Loading branch information
jamesnetherton committed May 4, 2022
1 parent 900e5e1 commit d912f95650396a65a30f37ad15c59b8e9374c2fa
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 62 deletions.
@@ -41,9 +41,9 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ

== Camel Quarkus limitations

=== InfinispanRemoteAggregationRepository in native mode
=== InfinispanRemoteAggregationRepository is unsupported

At present the `InfinispanRemoteAggregationRepository` is not supported in native mode.
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
@@ -47,29 +47,15 @@
<artifactId>quarkus-jaxb</artifactId>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.transaction</groupId>
<artifactId>jboss-transaction-api_1.2_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-infinispan</artifactId>
<exclusions>
<exclusion>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>

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

@@ -1,3 +1,3 @@
=== InfinispanRemoteAggregationRepository in native mode
=== InfinispanRemoteAggregationRepository is unsupported

At present the `InfinispanRemoteAggregationRepository` is not supported in native mode.
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.
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.component.infinispan.graal;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
import org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository;

// TODO: Remove this when https://github.com/apache/camel-quarkus/issues/3657 is solved
@TargetClass(InfinispanRemoteAggregationRepository.class)
final class InfinispanRemoteAggregationRepositorySubstitutions {

@Substitute
public void doStart() {
throw new UnsupportedOperationException("InfinispanRemoteAggregationRepository is not supported");
}
}
@@ -166,22 +166,20 @@ public void configure() {
.autoStartup(false)
.to("mock:camelResultCreated");

// Only start aggregation repository routes in JVM mode
if (!"executable".equals(System.getProperty("org.graalvm.nativeimage.kind"))) {
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");
}
// 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:camelIdempotent")
.idempotentConsumer(header("MessageID"), createIdempotentRepository("infinispan"))
@@ -19,11 +19,10 @@
import java.util.stream.Stream;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
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;
@@ -53,19 +52,10 @@ public void afterEach() {
}
}

@DisabledOnNativeImage("https://github.com/apache/camel-quarkus/issues/3657")
@Disabled("https://github.com/apache/camel-quarkus/issues/3657")
@ParameterizedTest
@MethodSource("componentNames")
public void aggregate(String componentName) {
// TODO: https://github.com/apache/camel-quarkus/issues/3657
//
// Enable testing InfinispanRemoteAggregationRepository with the Quarkus configured client.
// Technically it is possible with a custom META-INF/hotrod-client.properties and setting
// infinispan.client.hotrod.marshaller=org.infinispan.jboss.marshalling.core.JBossUserMarshaller
// However, it potentially impacts some of the Quarkus Infinispan extension functionality that relies on
// the default configured ProtoStreamMarshaller, thus we avoid doing it in this test suite
Assumptions.assumeTrue(componentName.equals("infinispan"));

RestAssured.with()
.queryParam("component", componentName)
.get("/infinispan/aggregate")
@@ -3015,16 +3015,30 @@
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-jboss-marshalling</artifactId>
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-marshaller-protostuff</artifactId>
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-infinispan-common</artifactId>
<version>${camel.version}</version>
<exclusions>
<exclusion>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
@@ -2961,16 +2961,30 @@
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-jboss-marshalling</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-marshaller-protostuff</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>jgroups</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-infinispan-common</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.16.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<exclusions>
<exclusion>
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -2961,16 +2961,30 @@
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-jboss-marshalling</artifactId>
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-marshaller-protostuff</artifactId>
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-infinispan-common</artifactId>
<version>3.16.0</version>
<exclusions>
<exclusion>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
@@ -10069,11 +10083,6 @@
<artifactId>js</artifactId>
<version>22.0.0.2</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-jboss-marshalling</artifactId>
<version>13.0.8.Final</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
@@ -2961,16 +2961,30 @@
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-jboss-marshalling</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-marshaller-protostuff</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
<exclusion>
<groupId>org.jgroups</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>jgroups</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-infinispan-common</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.16.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<exclusions>
<exclusion>
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -10069,11 +10083,6 @@
<artifactId>js</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>22.0.0.2</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
<dependency>
<groupId>org.infinispan</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>infinispan-jboss-marshalling</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>13.0.8.Final</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
<dependency>
<groupId>org.influxdb</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>influxdb-java</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->

0 comments on commit d912f95

Please sign in to comment.