You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/04/27 13:49:12 UTC

[camel-quarkus] branch quarkus-main updated (255cf9c762 -> 86d82a4262)

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a change to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


 discard 255cf9c762 Add workaround for RemoteCacheManager bean discovery #4841
     new 86d82a4262 Add workaround for RemoteCacheManager bean discovery #4841

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (255cf9c762)
            \
             N -- N -- N   refs/heads/quarkus-main (86d82a4262)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/modules/ROOT/pages/reference/extensions/infinispan.adoc  | 2 +-
 extensions/infinispan/runtime/src/main/doc/configuration.adoc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


[camel-quarkus] 01/01: Add workaround for RemoteCacheManager bean discovery #4841

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch quarkus-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 86d82a426217dfc93438e27c4d166292f657d445
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Apr 27 11:03:48 2023 +0100

    Add workaround for RemoteCacheManager bean discovery #4841
---
 .../pages/reference/extensions/infinispan.adoc     | 23 ++++++++++++++++++++++
 .../runtime/src/main/doc/configuration.adoc        | 23 ++++++++++++++++++++++
 .../infinispan/InfinispanQuarkusClientRoutes.java  |  7 +++++++
 3 files changed, 53 insertions(+)

diff --git a/docs/modules/ROOT/pages/reference/extensions/infinispan.adoc b/docs/modules/ROOT/pages/reference/extensions/infinispan.adoc
index 20cfea3021..15eeabc4a4 100644
--- a/docs/modules/ROOT/pages/reference/extensions/infinispan.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/infinispan.adoc
@@ -54,6 +54,29 @@ endif::[]
 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].
 
+Note that if you choose to use Quarkus Infinispan configuration properties, you *must* add an injection point for the `RemoteCacheManager` in order for it to be discoverable by the Camel Infinispan component. For example:
+
+[source,java]
+----
+public class Routes extends RouteBuilder {
+    // Injects the default unnamed RemoteCacheManager
+    @Inject
+    RemoteCacheManager cacheManager;
+
+    // If configured, injects an optional named RemoteCacheManager
+    @Inject
+    @InfinispanClientName("myNamedClient")
+    RemoteCacheManager namedCacheManager;
+
+    @Override
+    public void configure() {
+        // Route configuration here...
+    }
+}
+
+----
+
+
 [id="extensions-infinispan-configuration-camel-infinispan-infinispanremoteaggregationrepository-in-native-mode"]
 === Camel Infinispan `InfinispanRemoteAggregationRepository` in native mode
 
diff --git a/extensions/infinispan/runtime/src/main/doc/configuration.adoc b/extensions/infinispan/runtime/src/main/doc/configuration.adoc
index f4bd4fac58..cdc779e832 100644
--- a/extensions/infinispan/runtime/src/main/doc/configuration.adoc
+++ b/extensions/infinispan/runtime/src/main/doc/configuration.adoc
@@ -3,6 +3,29 @@
 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].
 
+Note that if you choose to use Quarkus Infinispan configuration properties, you *must* add an injection point for the `RemoteCacheManager` in order for it to be discoverable by the Camel Infinispan component. For example:
+
+[source,java]
+----
+public class Routes extends RouteBuilder {
+    // Injects the default unnamed RemoteCacheManager
+    @Inject
+    RemoteCacheManager cacheManager;
+
+    // If configured, injects an optional named RemoteCacheManager
+    @Inject
+    @InfinispanClientName("myNamedClient")
+    RemoteCacheManager namedCacheManager;
+
+    @Override
+    public void configure() {
+        // Route configuration here...
+    }
+}
+
+----
+
+
 === 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].
diff --git a/integration-tests/infinispan-quarkus-client/src/main/java/org/apache/camel/quarkus/component/infinispan/InfinispanQuarkusClientRoutes.java b/integration-tests/infinispan-quarkus-client/src/main/java/org/apache/camel/quarkus/component/infinispan/InfinispanQuarkusClientRoutes.java
index 7f4c291606..4baa067bf7 100644
--- a/integration-tests/infinispan-quarkus-client/src/main/java/org/apache/camel/quarkus/component/infinispan/InfinispanQuarkusClientRoutes.java
+++ b/integration-tests/infinispan-quarkus-client/src/main/java/org/apache/camel/quarkus/component/infinispan/InfinispanQuarkusClientRoutes.java
@@ -18,6 +18,8 @@ package org.apache.camel.quarkus.component.infinispan;
 
 import java.util.Set;
 
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.infinispan.remote.InfinispanRemoteComponent;
 import org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration;
@@ -29,8 +31,13 @@ import org.infinispan.client.hotrod.configuration.Configuration;
 import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
 import org.infinispan.commons.marshall.ProtoStreamMarshaller;
 
+@ApplicationScoped
 public class InfinispanQuarkusClientRoutes extends InfinispanCommonRoutes {
 
+    // TODO: This should not be required: https://github.com/apache/camel-quarkus/issues/4841
+    @Inject
+    RemoteCacheManager cacheManager;
+
     @Override
     protected Configuration getConfigurationBuilder() {
         Config config = ConfigProvider.getConfig();