You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2021/01/27 06:23:38 UTC
[camel] branch master updated (376ec61 -> 3f5fbd4)
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 376ec61 Regen for commit ae2c79dcd64424acc82a29c9a46620809ea6414c (#4934)
new 573ae84 CAMEL-12489 - camel-infinspan: split remote and embedded components
new 37f2ec4 CAMEL-12489 - camel-infinspan: split remote and embedded components (split)
new b334a5e CAMEL-12489 - camel-infinspan: split remote and embedded components (fix findings)
new c9cdc67 CAMEL-12489 - camel-infinspan: split remote and embedded components (docs)
new 8618eba CAMEL-12489 - camel-infinspan: split remote and embedded components (cleanup)
new 3f5fbd4 CAMEL-12489 - camel-infinspan: split remote and embedded components (migration guide)
The 6 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:
bom/camel-bom/pom.xml | 15 +
.../org/apache/camel/catalog/components.properties | 1 -
.../camel/catalog/components/infinispan.json | 87 --
.../org/apache/camel/catalog/docs.properties | 1 -
.../camel/catalog/docs/infinispan-component.adoc | 853 ++++----------
.../docs/infinispan-embedded-component.adoc | 490 ++++++++
.../camel-infinispan-common/pom.xml | 107 ++
.../InfinispanAggregationRepository.java} | 120 +-
.../component/infinispan/InfinispanComponent.java} | 14 +-
.../infinispan/InfinispanConfiguration.java | 136 +++
.../component/infinispan/InfinispanConstants.java | 5 +
.../component/infinispan/InfinispanConsumer.java | 80 ++
.../component/infinispan/InfinispanEndpoint.java} | 13 +-
.../infinispan/InfinispanEventListener.java | 38 +-
.../infinispan/InfinispanEventProcessor.java} | 8 +-
.../infinispan/InfinispanIdempotentRepository.java | 85 ++
.../component/infinispan/InfinispanManager.java | 55 +
.../component/infinispan/InfinispanOperation.java | 0
.../component/infinispan/InfinispanProducer.java | 335 ++----
.../infinispan/InfinispanQueryBuilder.java | 5 +
.../infinispan/InfinispanRoutePolicy.java | 246 ++++
.../camel/component/infinispan/InfinispanUtil.java | 69 ++
.../infinispan/InfinispanConsumerTestSupport.java} | 15 +-
.../InfinispanIdempotentRepositoryTestSupport.java | 103 ++
.../infinispan/InfinispanProducerTestSupport.java | 868 +++++++++++++++
.../InfinispanRoutePolicyTestSupport.java | 58 +
.../infinispan/InfinispanTestSupport.java} | 21 +-
.../camel-infinispan-embedded/pom.xml | 134 +++
.../InfinispanEmbeddedComponentConfigurer.java} | 82 +-
.../InfinispanEmbeddedEndpointConfigurer.java} | 74 +-
.../InfinispanEmbeddedEndpointUriFactory.java} | 39 +-
.../services/org/apache/camel/component.properties | 7 +
.../org/apache/camel/component/infinispan-embedded | 2 +
.../camel/configurer/infinispan-embedded-component | 2 +
.../camel/configurer/infinispan-embedded-endpoint | 2 +
.../camel/urifactory/infinispan-embedded-endpoint | 2 +
.../infinispan/embedded/infinispan-embedded.json | 69 ++
.../main/docs/infinispan-embedded-component.adoc | 490 ++++++++
.../InfinispanEmbeddedAggregationRepository.java | 81 ++
.../embedded/InfinispanEmbeddedComponent.java | 57 +
.../embedded/InfinispanEmbeddedConfiguration.java | 155 +++
.../embedded/InfinispanEmbeddedConsumer.java | 156 +++
.../InfinispanEmbeddedCustomListener.java} | 26 +-
.../embedded/InfinispanEmbeddedEndpoint.java} | 33 +-
.../embedded/InfinispanEmbeddedEventListener.java | 193 ++++
.../embedded/InfinispanEmbeddedEventListeners.java | 67 ++
.../InfinispanEmbeddedIdempotentRepository.java | 96 ++
.../embedded/InfinispanEmbeddedManager.java | 147 +++
.../embedded/InfinispanEmbeddedProducer.java | 57 +
.../embedded/InfinispanEmbeddedRoutePolicy.java | 150 +++
.../embedded/InfinispanEmbeddedUtil.java} | 40 +-
...beddedAggregationRepositoryOperationsTest.java} | 106 +-
...nfinispanEmbeddedAggregationRepositoryTest.java | 72 ++
.../InfinispanEmbeddedClusteredConsumerTest.java} | 36 +-
.../InfinispanEmbeddedClusteredTestSupport.java} | 67 +-
.../InfinispanEmbeddedConfigurationTest.java | 52 +
.../embedded/InfinispanEmbeddedConsumerTest.java | 192 ++++
.../InfinispanEmbeddedCustomListenerTest.java | 110 ++
...InfinispanEmbeddedIdempotentRepositoryTest.java | 79 ++
.../embedded/InfinispanEmbeddedProducerTest.java | 111 ++
.../InfinispanEmbeddedQueryConsumerTest.java | 130 +++
.../InfinispanEmbeddedQueryProducerTest.java} | 126 +--
.../InfinispanEmbeddedQueryTestSupport.java} | 9 +-
.../InfinispanEmbeddedRoutePolicyTest.java | 98 ++
.../embedded/InfinispanEmbeddedTestSupport.java | 83 ++
...spanEmbeddedIdempotentRepositoryCamelTest.java} | 20 +-
...panEmbeddedIdempotentRepositorySpringTest.java} | 20 +-
...anEmbeddedIdempotentRepositoryTestSupport.java} | 30 +-
.../src/test/resources/log4j2.properties | 10 +
...ispanEmbeddedIdempotentRepositoryCamelTest.xml} | 22 +-
...anEmbeddedIdempotentRepositoryConfiguration.xml | 32 +
...spanEmbeddedIdempotentRepositorySpringTest.xml} | 14 +-
.../{ => camel-infinispan}/pom.xml | 104 +-
.../InfinispanRemoteComponentConfigurer.java} | 46 +-
.../InfinispanRemoteEndpointConfigurer.java} | 38 +-
.../InfinispanRemoteEndpointUriFactory.java} | 9 +-
.../services/org/apache/camel/component.properties | 4 +-
.../services/org/apache/camel/component/infinispan | 2 +
.../apache/camel/configurer/infinispan-component | 2 +
.../apache/camel/configurer/infinispan-endpoint | 2 +
.../apache/camel/urifactory/infinispan-endpoint | 2 +
.../component/infinispan/remote}/infinispan.json | 98 +-
.../src/main/docs/infinispan-component.adoc | 495 +++++++++
.../InfinispanRemoteAggregationRepository.java | 104 ++
.../remote/InfinispanRemoteComponent.java | 57 +
.../remote/InfinispanRemoteConfiguration.java | 244 ++++
.../remote/InfinispanRemoteConsumer.java | 148 +++
.../remote/InfinispanRemoteCustomListener.java | 40 +-
.../remote/InfinispanRemoteEndpoint.java} | 30 +-
.../remote/InfinispanRemoteEventListener.java | 50 +-
.../InfinispanRemoteIdempotentRepository.java | 100 ++
.../remote/InfinispanRemoteManager.java} | 148 +--
.../remote/InfinispanRemoteProducer.java | 59 +
.../remote/InfinispanRemoteRoutePolicy.java | 174 +++
.../infinispan/remote/InfinispanRemoteUtil.java} | 34 +-
...RemoteAggregationRepositoryOperationsTest.java} | 101 +-
.../InfinispanRemoteAggregationRepositoryTest.java | 73 ++
.../remote/InfinispanRemoteConfigurationTest.java | 96 ++
.../remote/InfinispanRemoteConsumerTest.java | 75 ++
.../remote/InfinispanRemoteCustomListenerTest.java | 99 ++
.../InfinispanRemoteIdempotentRepositoryTest.java | 79 ++
.../remote/InfinispanRemoteProducerTest.java | 103 ++
.../remote/InfinispanRemoteQueryConsumerTest.java} | 132 +--
.../remote/InfinispanRemoteQueryProducerTest.java} | 136 ++-
.../remote/InfinispanRemoteQueryTestSupport.java} | 9 +-
.../remote/InfinispanRemoteRoutePolicyTest.java | 124 +++
.../remote/InfinispanRemoteTestSupport.java | 104 ++
...nispanRemoteIdempotentRepositoryCamelTest.java} | 19 +-
...ispanRemoteIdempotentRepositorySpringTest.java} | 19 +-
...spanRemoteIdempotentRepositoryTestSupport.java} | 43 +-
.../test/resources/infinispan/client.properties | 0
.../src/test/resources/log4j2.properties | 10 +
...inispanRemoteIdempotentRepositoryCamelTest.xml} | 26 +-
...nispanRemoteIdempotentRepositorySpringTest.xml} | 10 +-
components/camel-infinispan/pom.xml | 199 +---
.../services/org/apache/camel/component/infinispan | 2 -
.../apache/camel/configurer/infinispan-component | 2 -
.../apache/camel/configurer/infinispan-endpoint | 2 -
.../apache/camel/urifactory/infinispan-endpoint | 2 -
.../src/main/docs/infinispan-component.adoc | 864 ---------------
.../component/infinispan/InfinispanComponent.java | 107 --
.../infinispan/InfinispanConfiguration.java | 438 --------
.../component/infinispan/InfinispanConsumer.java | 152 ---
.../camel/component/infinispan/InfinispanUtil.java | 129 ---
.../InfinispanConsumerEmbeddedHandler.java | 62 --
.../embedded/InfinispanEmbeddedCustomListener.java | 47 -
.../InfinispanSyncClusteredEventListener.java | 48 -
.../embedded/InfinispanSyncLocalEventListener.java | 59 -
.../infinispan/policy/InfinispanRoutePolicy.java | 475 --------
.../InfinispanLocalAggregationRepository.java | 241 ----
.../idempotent/InfinispanIdempotentRepository.java | 146 ---
.../remote/InfinispanConsumerRemoteHandler.java | 56 -
.../infinispan/InfinispanConfigurationIT.java | 109 --
.../InfinispanConsumerEntryCreatedTest.java | 57 -
.../InfinispanConsumerEntryRemovedTest.java | 59 -
.../InfinispanConsumerEntryUpdatedTest.java | 59 -
.../InfinispanConsumerEntryVisitedTest.java | 59 -
.../InfinispanLocalConsumerCustomListenerIT.java | 58 -
.../infinispan/InfinispanLocalConsumerTest.java | 83 --
.../infinispan/InfinispanProducerTest.java | 1172 --------------------
.../infinispan/InfinispanRemoteProducerTest.java | 54 -
.../infinispan/InfinispanSyncConsumerTest.java | 49 -
.../infinispan/InfinispanTestSupport.java | 68 --
.../infinispan/MyEmbeddedCustomListener.java | 44 -
.../policy/InfinispanEmbeddedRoutePolicyTest.java | 32 -
.../policy/InfinispanRemoteRoutePolicyTest.java | 39 -
.../policy/InfinispanRoutePolicyTestBase.java | 90 --
.../InfinispanLocalAggregationRepositoryTest.java | 97 --
.../InfinispanRemoteAggregationRepositoryTest.java | 95 --
.../InfinispanDefaultIdempotentRepositoryTest.java | 65 --
.../InfinispanIdempotentRepositoryIT.java | 82 --
.../InfinispanIdempotentRepositoryTest.java | 108 --
.../InfinispanTestContainerSupport.java | 47 -
.../InfinispanTestContainersConsumerTest.java | 81 --
...ispanTestContainersContainsKeyProducerTest.java | 77 --
...spanTestContainersGetOrDefaultProducerTest.java | 86 --
...spanTestContainersIdempotentRepositoryTest.java | 78 --
.../InfinispanTestContainersProducerTest.java | 77 --
...ispanTestContainersPutIfAbsentProducerTest.java | 96 --
...InfinispanTestContainersRemoveProducerTest.java | 96 --
.../camel/component/infinispan/util/Wait.java | 55 -
core/camel-allcomponents/pom.xml | 8 +
.../component/ComponentsBuilderFactory.java | 14 +
.../dsl/InfinispanComponentBuilderFactory.java | 164 +--
...InfinispanEmbeddedComponentBuilderFactory.java} | 308 ++---
.../src/generated/resources/metadata.json | 24 +-
.../builder/endpoint/EndpointBuilderFactory.java | 3 +-
.../camel/builder/endpoint/EndpointBuilders.java | 3 +-
.../builder/endpoint/StaticEndpointBuilders.java | 57 +-
... InfinispanEmbeddedEndpointBuilderFactory.java} | 914 +++------------
...=> InfinispanRemoteEndpointBuilderFactory.java} | 589 ++++------
.../camel/support/HeaderSelectorProducer.java | 30 +-
docs/components/modules/ROOT/nav.adoc | 1 +
.../modules/ROOT/pages/infinispan-component.adoc | 855 ++++----------
.../ROOT/pages/infinispan-embedded-component.adoc | 492 ++++++++
.../ROOT/pages/camel-3x-upgrade-guide-3_8.adoc | 19 +
parent/pom.xml | 15 +
.../test/infra/common/services/TestService.java | 7 +-
.../services/InfinispanLocalContainerService.java | 32 +-
.../camel/maven/packaging/PrepareCatalogMojo.java | 113 +-
180 files changed, 10092 insertions(+), 10415 deletions(-)
delete mode 100644 catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan.json
create mode 100644 catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
create mode 100644 components/camel-infinispan/camel-infinispan-common/pom.xml
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanRemoteAggregationRepository.java => camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java} (67%)
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/util/Condition.java => camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java} (69%)
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
rename components/camel-infinispan/{ => camel-infinispan-common}/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java (87%)
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
copy components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanConsumerHandler.java => camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java} (70%)
rename components/camel-infinispan/{ => camel-infinispan-common}/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java (54%)
copy components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanConsumerHandler.java => camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java} (78%)
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
rename components/camel-infinispan/{ => camel-infinispan-common}/src/main/java/org/apache/camel/component/infinispan/InfinispanOperation.java (100%)
rename components/camel-infinispan/{ => camel-infinispan-common}/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java (55%)
copy components/camel-infinispan/{ => camel-infinispan-common}/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java (89%)
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanConsumerHandler.java => camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerTestSupport.java} (68%)
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepositoryTestSupport.java
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTestSupport.java
create mode 100644 components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanRoutePolicyTestSupport.java
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java => camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java} (58%)
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/pom.xml
copy components/camel-infinispan/{src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java => camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java} (64%)
copy components/camel-infinispan/{src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java => camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java} (65%)
copy components/camel-infinispan/{src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java => camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java} (73%)
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/component.properties
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanCustomListener.java => camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java} (59%)
copy components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java => camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java} (63%)
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java
copy components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteOperation.java => camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java} (52%)
copy components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanLocalAggregationRepositoryOperationsTest.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryOperationsTest.java} (60%)
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryTest.java
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/InfinispanClusteredConsumerTest.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredConsumerTest.java} (75%)
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/InfinispanClusterTestSupport.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredTestSupport.java} (67%)
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfigurationTest.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumerTest.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListenerTest.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepositoryTest.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryConsumerTest.java
copy components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/InfinispanRemoteQueryProducerIT.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryProducerTest.java} (54%)
copy components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/util/UserUtils.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryTestSupport.java} (94%)
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicyTest.java
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
copy components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanAsyncLocalEventListener.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.java} (54%)
copy components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanAsyncLocalEventListener.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.java} (54%)
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/InfinispanAsyncConsumerTest.java => camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryTestSupport.java} (55%)
copy components/camel-infinispan/{ => camel-infinispan-embedded}/src/test/resources/log4j2.properties (77%)
copy components/camel-infinispan/{src/test/resources/org/apache/camel/component/infinispan/processor/idempotent/SpringInfinispanIdempotentRepositoryIT.xml => camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.xml} (68%)
create mode 100644 components/camel-infinispan/camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryConfiguration.xml
copy components/camel-infinispan/{src/test/resources/org/apache/camel/component/infinispan/processor/idempotent/SpringInfinispanIdempotentRepositoryIT.xml => camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.xml} (74%)
copy components/camel-infinispan/{ => camel-infinispan}/pom.xml (79%)
rename components/camel-infinispan/{src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java => camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java} (82%)
rename components/camel-infinispan/{src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java => camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java} (84%)
rename components/camel-infinispan/{src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java => camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java} (88%)
rename components/camel-infinispan/{ => camel-infinispan}/src/generated/resources/META-INF/services/org/apache/camel/component.properties (62%)
create mode 100644 components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
create mode 100644 components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
create mode 100644 components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
create mode 100644 components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
rename components/camel-infinispan/{src/generated/resources/org/apache/camel/component/infinispan => camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote}/infinispan.json (57%)
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java
rename components/camel-infinispan/{ => camel-infinispan}/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java (67%)
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java => camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java} (68%)
rename components/camel-infinispan/{ => camel-infinispan}/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java (59%)
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java => camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java} (50%)
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducer.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicy.java
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteOperation.java => camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteUtil.java} (57%)
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanLocalAggregationRepositoryOperationsTest.java => camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryOperationsTest.java} (61%)
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryTest.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfigurationTest.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumerTest.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListenerTest.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepositoryTest.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/InfinispanContinuousQueryIT.java => camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryConsumerTest.java} (57%)
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/InfinispanRemoteQueryProducerIT.java => camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryProducerTest.java} (68%)
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/util/UserUtils.java => camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java} (94%)
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicyTest.java
create mode 100644 components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanAsyncLocalEventListener.java => camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java} (54%)
rename components/camel-infinispan/{src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanAsyncClusteredEventListener.java => camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java} (54%)
rename components/camel-infinispan/{src/test/java/org/apache/camel/component/infinispan/processor/idempotent/SpringInfinispanIdempotentRepositoryIT.java => camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java} (59%)
rename components/camel-infinispan/{ => camel-infinispan}/src/test/resources/infinispan/client.properties (100%)
rename components/camel-infinispan/{ => camel-infinispan}/src/test/resources/log4j2.properties (77%)
copy components/camel-infinispan/{src/test/resources/org/apache/camel/component/infinispan/processor/idempotent/SpringInfinispanIdempotentRepositoryIT.xml => camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.xml} (63%)
rename components/camel-infinispan/{src/test/resources/org/apache/camel/component/infinispan/processor/idempotent/SpringInfinispanIdempotentRepositoryIT.xml => camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.xml} (76%)
delete mode 100644 components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
delete mode 100644 components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
delete mode 100644 components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
delete mode 100644 components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
delete mode 100644 components/camel-infinispan/src/main/docs/infinispan-component.adoc
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanConsumerEmbeddedHandler.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncClusteredEventListener.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncLocalEventListener.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanLocalAggregationRepository.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/idempotent/InfinispanIdempotentRepository.java
delete mode 100644 components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanConsumerRemoteHandler.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanConfigurationIT.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerEntryCreatedTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerEntryRemovedTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerEntryUpdatedTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerEntryVisitedTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanLocalConsumerCustomListenerIT.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanLocalConsumerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanRemoteProducerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanSyncConsumerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/MyEmbeddedCustomListener.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/policy/InfinispanEmbeddedRoutePolicyTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/policy/InfinispanRemoteRoutePolicyTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicyTestBase.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanLocalAggregationRepositoryTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanRemoteAggregationRepositoryTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/processor/idempotent/InfinispanDefaultIdempotentRepositoryTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/processor/idempotent/InfinispanIdempotentRepositoryIT.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/processor/idempotent/InfinispanIdempotentRepositoryTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainerSupport.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainersConsumerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainersContainsKeyProducerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainersGetOrDefaultProducerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainersIdempotentRepositoryTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainersProducerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainersPutIfAbsentProducerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/testcontainers/InfinispanTestContainersRemoveProducerTest.java
delete mode 100644 components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/util/Wait.java
copy core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/{InfinispanComponentBuilderFactory.java => InfinispanEmbeddedComponentBuilderFactory.java} (52%)
copy core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/{InfinispanEndpointBuilderFactory.java => InfinispanEmbeddedEndpointBuilderFactory.java} (53%)
rename core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/{InfinispanEndpointBuilderFactory.java => InfinispanRemoteEndpointBuilderFactory.java} (68%)
create mode 100644 docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc
[camel] 06/06: CAMEL-12489 - camel-infinspan: split remote and
embedded components (migration guide)
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 3f5fbd4d5480c4f00d616d6db599c451e44fd414
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Tue Jan 26 17:39:15 2021 +0100
CAMEL-12489 - camel-infinspan: split remote and embedded components (migration guide)
---
.../ROOT/pages/camel-3x-upgrade-guide-3_8.adoc | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc
index 30ee669..b381567 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_8.adoc
@@ -75,3 +75,22 @@ Other information has been stored in headers declared in GitHubConstants class:
* GITHUB_EVENT_PAYLOAD - "CamelGitHubEventPayload" - The event payload
+
+=== camel-infinispan
+
+There are now two components for Infinispan:
+
+- *camel-infinispan* to integrate with remote caches through the Hot Rod protocol (scheme: *infinispan*).
+- *camel-infinispan-embedded* to integrate with local/embedded caches (scheme: *infinispan-embedded*).
+
+As conseguence of the refactor
+
+- the remote and embedded endpoints provide support the same capabilities, as example queries were only possible on a remote cache and now they are suported on both remote and local/embedded caches
+- the configuration options for the endpoint are now specific to the context which remove the possibility to mix unrelated propertis
+- some classes have been relocated, as example, indempotent and aggregation repositories have been moved from `org.apache.camel.component.infinispan.processor.*` to `org.apache.camel.component.infinispan.embedded` or `org.apache.camel.component.infinispan.remote`:
++
+org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedAggregationRepository
+org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedIdempotentRepository
+org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository
+org.apache.camel.component.infinispan.remote.InfinispanRemoteIdempotentRepository
+
[camel] 04/06: CAMEL-12489 - camel-infinspan: split remote and
embedded components (docs)
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit c9cdc676a77f38f687407b1a040818c3d5299576
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Tue Jan 26 10:56:09 2021 +0100
CAMEL-12489 - camel-infinspan: split remote and embedded components (docs)
---
.../camel/catalog/docs/infinispan-component.adoc | 8 +-
.../docs/infinispan-embedded-component.adoc | 801 ++++++---------------
.../infinispan/embedded/infinispan-embedded.json | 8 +-
.../main/docs/infinispan-embedded-component.adoc | 801 ++++++---------------
.../embedded/InfinispanEmbeddedConfiguration.java | 7 +-
.../component/infinispan/remote/infinispan.json | 8 +-
.../src/main/docs/infinispan-component.adoc | 8 +-
.../remote/InfinispanRemoteConfiguration.java | 7 +-
.../dsl/InfinispanComponentBuilderFactory.java | 12 +-
.../InfinispanEmbeddedComponentBuilderFactory.java | 12 +-
.../InfinispanEmbeddedEndpointBuilderFactory.java | 72 +-
.../InfinispanRemoteEndpointBuilderFactory.java | 72 +-
.../modules/ROOT/pages/infinispan-component.adoc | 8 +-
.../ROOT/pages/infinispan-embedded-component.adoc | 801 ++++++---------------
14 files changed, 752 insertions(+), 1873 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
index 0ba396c..46f03f9 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
@@ -69,10 +69,10 @@ The Infinispan component supports 26 options, which are listed below.
| *username* ( security) | Define the username to access the infinispan instance | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
@@ -126,10 +126,10 @@ with the following path and query parameters:
| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
| *username* ( security) | Define the username to access the infinispan instance | | String
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
index 3b2f7f3..164a7ae 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
@@ -19,7 +19,7 @@ store and data grid platform written in Java.
Infinispan requires at least Java 8.
-The `camel-infinispan` component includes the following features:
+The `camel-infinispan-embedded` component includes the following features:
* *Local Camel Consumer* - Receives cache change notifications and sends them to be processed.
This can be done synchronously or asynchronously, and is also supported with a replicated or distributed cache.
@@ -51,14 +51,11 @@ infinispan-embedded://cacheName?[options]
== URI Options
-The producer allows sending messages to a local infinispan cache
-configured in the registry, or to a remote cache using the HotRod
-protocol. The consumer allows listening for events from local infinispan cache
-accessible from the registry.
+The producer allows sending messages to a local infinispan cache.
+The consumer allows listening for events from local infinispan cache.
If no cache configuration is provided, embedded cacheContainer is created directly in the component.
-
// component options: START
The Infinispan Embedded component supports 20 options, which are listed below.
@@ -82,9 +79,9 @@ The Infinispan Embedded component supports 20 options, which are listed below.
| *value* (producer) | Set a specific value for producer operations | | Object
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
@@ -133,268 +130,169 @@ with the following path and query parameters:
| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
| *value* (producer) | Set a specific value for producer operations | | Object
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
+
== Camel Operations
This section lists all available operations, along with their header information.
.Put Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUT
-| *Context*: Embedded / Remote
-
-*Description*: Puts a key/value pair in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.PUTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENT
-| *Description*: Puts a key/value pair in the cache if it did not exist, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUT | Puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTASYNC | Asynchronously puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTIFABSENT | Puts a key/value pair in the cache if it did not exist, optionally with expiration
+| InfinispanOperation.PUTIFABSENTASYNC | Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Put All Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUTALL
-| *Context*: Embedded / Remote
-
-*Description*: Adds multiple entries to a cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanMap
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit
-
-*Result Header*: None
-
-| CamelInfinispanOperation.PUTALLASYNC
-| *Description*: Asynchronously adds multiple entries to a cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUTALL | Adds multiple entries to a cache, optionally with expiration
+| CamelInfinispanOperation.PUTALLASYNC | Asynchronously adds multiple entries to a cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanMap
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+
.Get Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-|Operation Name
-|Description
-
-| InfinispanOperation.GET
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.GETORDEFAULT
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value, or default value, associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
+|Operation Name |Description
+| InfinispanOperation.GET | Retrieves the value associated with a specific key from the cache
+| InfinispanOperation.GETORDEFAULT | Retrieves the value, or default value, associated with a specific key from the cache
|===
+* *Required Headers*:
+** CamelInfinispanKey
+
.Contains Key Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSKEY
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific key
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.CONTAINSKEY | Determines whether a cache contains a specific key
|===
+* *Required Headers*
+** CamelInfinispanKey
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Contains Value Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CONTAINSVALUE | Determines whether a cache contains a specific value
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSVALUE
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific value
-
-*Required Headers*: CamelInfinispanKey
-*Optional Headers*: None
+* *Required Headers*:
+** CamelInfinispanKey
-*Result Headers*: None
-|===
.Remove Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REMOVE
-| *Context*: Embedded / Remote
-
-*Description*: Removes an entry from a cache, optionally only if the value matches a given one
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: CamelInfinispanValue
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REMOVEASYNC
-| *Description*: Asynchronously removes an entry from a cache, optionally only if the value matches a given one
-
+| Operation Name | Description
+| InfinispanOperation.REMOVE | Removes an entry from a cache, optionally only if the value matches a given one
+| InfinispanOperation.REMOVEASYNC | Asynchronously removes an entry from a cache, optionally only if the value matches a given one
|===
+* *Required Headers*:
+** CamelInfinispanKey
+* *Optional Headers*:
+** CamelInfinispanValue
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Replace Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REPLACE
-| *Context*: Embedded / Remote
-
-*Description*: Conditionally replaces an entry in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue, CamelInfinispanOldValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REPLACEASYNC
-| *Description*: Asynchronously conditionally replaces an entry in the cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.REPLACE | Conditionally replaces an entry in the cache, optionally with expiration
+| InfinispanOperation.REPLACEASYNC | Asynchronously conditionally replaces an entry in the cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+** CamelInfinispanOldValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Clear Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CLEAR
-| *Context*: Embedded / Remote
-
-*Description*: Clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.CLEARASYNC
-| *Context*: Embedded / Remote
-
-*Description*: Asynchronously clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
+| Operation Name | Description
+| InfinispanOperation.CLEAR | Clears the cache
+| InfinispanOperation.CLEARASYNC | Asynchronously clears the cache
|===
.Size Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.SIZE
-| *Context*: Embedded / Remote
-
-*Description*: Returns the number of entries in the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.SIZE | Returns the number of entries in the cache
|===
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Stats Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.STATS
-| *Context*: Embedded / Remote
-
-*Description*: Returns statistics about the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.STATS | Returns statistics about the cache
|===
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Query Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.QUERY
-| *Context*: Remote
-
-*Description*: Executes a query on the cache
-
-*Required Headers*: CamelInfinispanQueryBuilder
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.QUERY | Executes a query on the cache
|===
+* *Required Headers*:
+** CamelInfinispanQueryBuilder
+* *Result Header*:
+** CamelInfinispanOperationResult
+
[NOTE]
====
-Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null result.
+Write methods like put(key, value) and remove(key) do not return the previous value by default.
====
-
-
== Message Headers
[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
@@ -405,439 +303,188 @@ Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null
|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
-|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event. Possible values defined here org.infinispan.notifications.cachelistener.event.Event.Type
-|CamelInfinispanIsPre |`null` |Boolean |Consumer |Infinispan fires two events for each operation: one before and one after the operation.
+|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event.
|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
-|CamelInfinispanIgnoreReturnValues |null |Boolean |Producer |If this header is set, the return value for cache operation returning something is ignored by the client application
|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
|=======================================================================
-== Examples
-
-* Retrieve a specific key from the default cache using a custom cache container:
-
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer");
-----
+== Examples
* Put a key/value into a named cache:
+
[source,java]
----
from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan:myCacheName");
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT) // <1>
+ .setHeader(InfinispanConstants.KEY).constant("123") // <2>
+ .to("infinispan:myCacheName&cacheContainer=#cacheContainer"); // <3>
----
-
-* Put a value with lifespan
-
-[source,java]
+<1> Set the operation to perform
+<2> Set the key used to identify the element in the cache
+<3> Use the configured cache manager `cacheContainer` from the registry to put an element to the cache named `myCacheName`
++
+It is possible to configure the lifetime and/or the idle time before the entry expires and gets evicted from the cache, as example:
++
+[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
.setHeader(InfinispanConstants.KEY).constant("123")
- .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L)
- .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString())
+ .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L) // <1>
+ .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString()) // <2>
.to("infinispan:myCacheName");
----
+<1> Set the lifespan of the entry
+<2> Set the time unit for the lifespan
-* Compute operation through a remapping function on the default cache using a custom cache container:
-
-[source,java]
-----
-@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer&remappingFunction=#mappingFunction");
-----
-
-This will return oldValue + "replay".
-
-This can be done also as async operation, with the `InfinispanOperation.COMPUTEASYNC` operation
-
-* Retrieve a specific key from the remote cache using a cache container configuration with additional parameters (host, port and protocol version):
-
-[source,java]
-----
-org.infinispan.client.hotrod.configuration.Configuration cacheContainerConfiguration = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
- .addServer()
- .host("localhost")
- .port(9999)
- .version(org.infinispan.client.hotrod.ProtocolVersion.PROTOCOL_VERSION_25)
- .build();
-...
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainerConfiguration=#cacheContainerConfiguration");
-----
-
-
-
-=== XML examples
-
-Routing can also be performed using XML configuration.
-The following example demonstrates `camel-infinispan` `local-camel-producer`, a camel route that sends data to an embedded cache created by the `local-cache` module.
-
-[source,java,options="nowrap"]
-----
-<camelContext id="local-producer" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="timer://local?fixedRate=true&period=5000"/>
- <setHeader headerName="CamelInfinispanKey">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanValue">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <to uri="infinispan://foo?cacheContainer=#cacheManager"/>
- <to uri="log:local-put?showAll=true"/>
- </route>
-</camelContext>
-----
-
-
-The provided example requires you to instantiate the [class]``cacheManager``.
-
-You can instantiate the [class]``cacheManager`` bean for Spring XML as follows:
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <constructor-arg type="java.lang.String" value="infinispan.xml"/>
-</bean>
-----
-
-
-The following demonstrates how to instantiate the [class]``cacheManager`` bean using Blueprint XML.
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-----
-
-[NOTE]
-====
-Both the Spring XML and Blueprint XML examples use the configuration file [path]_infinispan.xml_
- for configuration of the cache. This file must be present on the classpath.
-====
-
-
-== Remote Query
-
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
-
-.Using only Java
-====
+* Queries
++
[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
- .setHeader(InfinispanConstants.QUERY_BUILDER,
- new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class).having("name").like("%abc%")
- .build();
- }
- })
- .to("infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache") ;
-----
-====
-
-.Using Blueprint and Java
-====
-.Java [class]``RemoteCacheManagerFactory`` class:
-[source,java,options="nowrap"]
-----
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
- }
-}
-----
-.Java [class]``InfinispanQueryExample`` class:
-[source,java,options="nowrap"]
-----
-public class InfinispanQueryExample {
- public InfinispanQueryBuilder getBuilder() {
- return new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class)
- .having("name")
- .like("%abc%")
- .build();
- }
+ .setHeader(InfinispanConstants.QUERY_BUILDER, new InfinispanQueryBuilder() {
+ @Override
+ public Query build(QueryFactory<Query> qf) {
+ return qf.from(User.class).having("name").like("%abc%").build();
}
- }
-}
-----
-.blueprint.xml:
-[source,xml,options="nowrap"]
+ })
+ .to("infinispan:myCacheName?cacheContainer=#cacheManager") ;
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
-</bean>
-
-<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:start"/>
- <setHeader headerName="CamelInfinispanOperation">
- <constant>CamelInfinispanOperationQuery</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanQueryBuilder">
- <method ref="queryBuilder" method="getBuilder"/>
- </setHeader>
- <to uri="infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache"/>
- </route>
-</camelContext>
-----
-====
-
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-
-In addition, there are the following requirements:
-
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
-
-
-== Custom Listeners for Embedded Cache
-
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
-
-.Using Java
++
+* Custom Listeners
++
[source,java,options="nowrap"]
----
-from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener")
+from("infinispan://?cacheContainer=#cacheManager&customListener=#myCustomListener")
.to("mock:result");
----
-
-.Using Blueprint
-
-[source,xml,options="nowrap"]
-----
-<bean id="myCustomContainer" org.infinispan.manager.DefaultCacheManager"
- init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
- </route>
-</camelContext>
-----
-
-
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
-
-[NOTE]
-====
-Custom filters and converters for embedded caches are currently not supported.
-====
++
+The instance of `myCustomListener` must exist and Camel should be able to look it up from the `Registry`.
+Users are encouraged to extend the `org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener` class and annotate the resulting class with `@Listener` which can be found found in package `org.infinispan.notifications`.
-== Custom Listeners for Remote Cache
+== Using the Infinispan based idempotent repository
-Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
+In this section we will use the Infinispan based idempotent repository.
-.Using only Java
-====
-[source,java,options="nowrap"]
-----
-from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener")
- .to(mock:result);
+.Java Example
+[source,java]
----
-====
+InfinispanEmbeddedConfiguration conf = new InfinispanEmbeddedConfiguration(); // <1>
+conf.setConfigurationUri("classpath:infinispan.xml")
-.Using Blueprint and Java
-====
-.Java class:
-[source,java,options="nowrap"]
-----
+InfinispanEmbeddedIdempotentRepository repo = new InfinispanEmbeddedIdempotentRepository("idempotent"); // <2>
+repo.setConfiguration(conf);
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
+context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .idempotentConsumer(header("MessageID"), repo) // <3>
+ .to("mock:result");
}
-}
+});
----
-.blueprint.xml:
-[source,xml,options="nowrap"]
-----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
+<1> Configure the cache
+<2> Configure the repository bean
+<3> Set the repository to the route
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+.XML Example
+[source,xml]
+----
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedIdempotentRepository" destroy-method="stop">
+ <constructor-arg value="idempotent"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration">
+ <property name="configurationUrl" value="classpath:infinispan.xml"/>
+ </bean>
+ </property>
</bean>
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
- <from uri="infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
+ <from uri="direct:start" />
+ <idempotentConsumer messageIdRepositoryRef="infinispanRepo"> <3>
+ <header>MessageID</header>
+ <to uri="mock:result" />
+ </idempotentConsumer>
</route>
</camelContext>
----
-====
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
+== Using the Infinispan based aggregation repository
-Remote listeners may also be associated with custom filters and converters as shown below:
-[source,java,options="nowrap"]
-----
-@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
- private static class MyCustomListener extends InfinispanRemoteCustomListener {
-}
-----
+In this section we will use the Infinispan based aggregation repository.
-In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
-[source,java,options="nowrap"]
+.Java Example
+[source,java]
----
-import org.infinispan.notifications.cachelistener.filter;
-
-@NamedFactory(name = "static-converter-factory")
-public static class StaticConverterFactory implements CacheEventConverterFactory {
- @Override
- public CacheEventConverter<Integer, String, CustomEvent> getConverter(Object[] params) {
- ...
- }
-
- static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
- @Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
- }
- }
-}
+InfinispanEmbeddedConfiguration conf = new InfinispanEmbeddedConfiguration(); // <1>
+conf.setConfigurationUri("classpath:infinispan.xml")
-@NamedFactory(name = "static-filter-factory")
-public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
- @Override
- public CacheEventFilter<Integer, String> getFilter(final Object[] params) {
- ...
- }
+InfinispanEmbeddedAggregationRepository repo = new InfinispanEmbeddedAggregationRepository("aggregation"); // <2>
+repo.setConfiguration(conf);
- static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
+context.addRoutes(new RouteBuilder() {
@Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
+ public void configure() {
+ from("direct:start")
+ .aggregate(header("MessageID"))
+ .completionSize(3)
+ .aggregationRepository(repo) // <3>
+ .aggregationStrategyRef("myStrategy")
+ .to("mock:result");
}
- }
-}
-----
-
-Custom filters and converters must be registered with the server.
-.
-
-[NOTE]
-====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
-====
-
-[NOTE]
-====
-With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
-For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
-====
-
-== Using the Infinispan based idempotent repository
-
-In this section we will use the Infinispan based idempotent repository.
-
-First, we need to create a cacheManager and then configure our
-
-[source,java]
-----
-org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository:
+});
----
+<1> Configure the cache
+<2> Create the repository bean
+<3> Set the repository to the route
+.XML Example
[source,xml]
----
-<!-- set up the cache manager -->
-<bean id="cacheManager"
- class="org.infinispan.manager.DefaultCacheManager"
- init-method="start"
- destroy-method="stop"/>
-
-<!-- set up the repository -->
-<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.InfinispanIdempotentRepository"
- factory-method="infinispanIdempotentRepository">
- <argument ref="cacheManager"/>
- <argument value="idempotent"/>
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedAggregationRepository" destroy-method="stop">
+ <constructor-arg value="aggregation"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration">
+ <property name="configurationUrl" value="classpath:infinispan.xml"/>
+ </bean>
+ </property>
</bean>
-----
-
-Then we can create our Infinispan idempotent repository in the spring
-XML file as well:
-[source,xml]
-----
<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route id="JpaMessageIdRepositoryTest">
+ <route>
<from uri="direct:start" />
- <idempotentConsumer messageIdRepositoryRef="infinispanStore">
- <header>messageId</header>
- <to uri="mock:result" />
- </idempotentConsumer>
+ <aggregate strategyRef="myStrategy"
+ completionSize="3"
+ aggregationRepositoryRef="infinispanRepo"> <3>
+ <correlationExpression>
+ <header>MessageID</header>
+ </correlationExpression>
+ <to uri="mock:result"/>
+ </aggregate>
</route>
</camelContext>
----
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
+[NOTE]
+====
+With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
+For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
+====
-include::camel-spring-boot::page$infinispan-starter.adoc[]
+include::camel-spring-boot::page$infinispan-embedded-starter.adoc[]
diff --git a/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
index 63daf90..ee9887f 100644
--- a/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
@@ -37,9 +37,9 @@
"value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
"autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
"cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
- "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The C [...]
+ "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The C [...]
"configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remot [...]
+ "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation" },
"remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHead [...]
},
@@ -60,9 +60,9 @@
"operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
"value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
"cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to con [...]
- "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The [...]
+ "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The [...]
"configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remo [...]
+ "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation" },
"remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHea [...]
}
diff --git a/components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc b/components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
index 3b2f7f3..164a7ae 100644
--- a/components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
@@ -19,7 +19,7 @@ store and data grid platform written in Java.
Infinispan requires at least Java 8.
-The `camel-infinispan` component includes the following features:
+The `camel-infinispan-embedded` component includes the following features:
* *Local Camel Consumer* - Receives cache change notifications and sends them to be processed.
This can be done synchronously or asynchronously, and is also supported with a replicated or distributed cache.
@@ -51,14 +51,11 @@ infinispan-embedded://cacheName?[options]
== URI Options
-The producer allows sending messages to a local infinispan cache
-configured in the registry, or to a remote cache using the HotRod
-protocol. The consumer allows listening for events from local infinispan cache
-accessible from the registry.
+The producer allows sending messages to a local infinispan cache.
+The consumer allows listening for events from local infinispan cache.
If no cache configuration is provided, embedded cacheContainer is created directly in the component.
-
// component options: START
The Infinispan Embedded component supports 20 options, which are listed below.
@@ -82,9 +79,9 @@ The Infinispan Embedded component supports 20 options, which are listed below.
| *value* (producer) | Set a specific value for producer operations | | Object
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
@@ -133,268 +130,169 @@ with the following path and query parameters:
| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
| *value* (producer) | Set a specific value for producer operations | | Object
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
+
== Camel Operations
This section lists all available operations, along with their header information.
.Put Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUT
-| *Context*: Embedded / Remote
-
-*Description*: Puts a key/value pair in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.PUTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENT
-| *Description*: Puts a key/value pair in the cache if it did not exist, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUT | Puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTASYNC | Asynchronously puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTIFABSENT | Puts a key/value pair in the cache if it did not exist, optionally with expiration
+| InfinispanOperation.PUTIFABSENTASYNC | Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Put All Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUTALL
-| *Context*: Embedded / Remote
-
-*Description*: Adds multiple entries to a cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanMap
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit
-
-*Result Header*: None
-
-| CamelInfinispanOperation.PUTALLASYNC
-| *Description*: Asynchronously adds multiple entries to a cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUTALL | Adds multiple entries to a cache, optionally with expiration
+| CamelInfinispanOperation.PUTALLASYNC | Asynchronously adds multiple entries to a cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanMap
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+
.Get Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-|Operation Name
-|Description
-
-| InfinispanOperation.GET
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.GETORDEFAULT
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value, or default value, associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
+|Operation Name |Description
+| InfinispanOperation.GET | Retrieves the value associated with a specific key from the cache
+| InfinispanOperation.GETORDEFAULT | Retrieves the value, or default value, associated with a specific key from the cache
|===
+* *Required Headers*:
+** CamelInfinispanKey
+
.Contains Key Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSKEY
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific key
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.CONTAINSKEY | Determines whether a cache contains a specific key
|===
+* *Required Headers*
+** CamelInfinispanKey
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Contains Value Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CONTAINSVALUE | Determines whether a cache contains a specific value
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSVALUE
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific value
-
-*Required Headers*: CamelInfinispanKey
-*Optional Headers*: None
+* *Required Headers*:
+** CamelInfinispanKey
-*Result Headers*: None
-|===
.Remove Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REMOVE
-| *Context*: Embedded / Remote
-
-*Description*: Removes an entry from a cache, optionally only if the value matches a given one
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: CamelInfinispanValue
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REMOVEASYNC
-| *Description*: Asynchronously removes an entry from a cache, optionally only if the value matches a given one
-
+| Operation Name | Description
+| InfinispanOperation.REMOVE | Removes an entry from a cache, optionally only if the value matches a given one
+| InfinispanOperation.REMOVEASYNC | Asynchronously removes an entry from a cache, optionally only if the value matches a given one
|===
+* *Required Headers*:
+** CamelInfinispanKey
+* *Optional Headers*:
+** CamelInfinispanValue
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Replace Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REPLACE
-| *Context*: Embedded / Remote
-
-*Description*: Conditionally replaces an entry in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue, CamelInfinispanOldValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REPLACEASYNC
-| *Description*: Asynchronously conditionally replaces an entry in the cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.REPLACE | Conditionally replaces an entry in the cache, optionally with expiration
+| InfinispanOperation.REPLACEASYNC | Asynchronously conditionally replaces an entry in the cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+** CamelInfinispanOldValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Clear Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CLEAR
-| *Context*: Embedded / Remote
-
-*Description*: Clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.CLEARASYNC
-| *Context*: Embedded / Remote
-
-*Description*: Asynchronously clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
+| Operation Name | Description
+| InfinispanOperation.CLEAR | Clears the cache
+| InfinispanOperation.CLEARASYNC | Asynchronously clears the cache
|===
.Size Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.SIZE
-| *Context*: Embedded / Remote
-
-*Description*: Returns the number of entries in the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.SIZE | Returns the number of entries in the cache
|===
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Stats Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.STATS
-| *Context*: Embedded / Remote
-
-*Description*: Returns statistics about the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.STATS | Returns statistics about the cache
|===
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Query Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.QUERY
-| *Context*: Remote
-
-*Description*: Executes a query on the cache
-
-*Required Headers*: CamelInfinispanQueryBuilder
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.QUERY | Executes a query on the cache
|===
+* *Required Headers*:
+** CamelInfinispanQueryBuilder
+* *Result Header*:
+** CamelInfinispanOperationResult
+
[NOTE]
====
-Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null result.
+Write methods like put(key, value) and remove(key) do not return the previous value by default.
====
-
-
== Message Headers
[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
@@ -405,439 +303,188 @@ Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null
|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
-|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event. Possible values defined here org.infinispan.notifications.cachelistener.event.Event.Type
-|CamelInfinispanIsPre |`null` |Boolean |Consumer |Infinispan fires two events for each operation: one before and one after the operation.
+|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event.
|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
-|CamelInfinispanIgnoreReturnValues |null |Boolean |Producer |If this header is set, the return value for cache operation returning something is ignored by the client application
|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
|=======================================================================
-== Examples
-
-* Retrieve a specific key from the default cache using a custom cache container:
-
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer");
-----
+== Examples
* Put a key/value into a named cache:
+
[source,java]
----
from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan:myCacheName");
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT) // <1>
+ .setHeader(InfinispanConstants.KEY).constant("123") // <2>
+ .to("infinispan:myCacheName&cacheContainer=#cacheContainer"); // <3>
----
-
-* Put a value with lifespan
-
-[source,java]
+<1> Set the operation to perform
+<2> Set the key used to identify the element in the cache
+<3> Use the configured cache manager `cacheContainer` from the registry to put an element to the cache named `myCacheName`
++
+It is possible to configure the lifetime and/or the idle time before the entry expires and gets evicted from the cache, as example:
++
+[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
.setHeader(InfinispanConstants.KEY).constant("123")
- .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L)
- .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString())
+ .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L) // <1>
+ .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString()) // <2>
.to("infinispan:myCacheName");
----
+<1> Set the lifespan of the entry
+<2> Set the time unit for the lifespan
-* Compute operation through a remapping function on the default cache using a custom cache container:
-
-[source,java]
-----
-@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer&remappingFunction=#mappingFunction");
-----
-
-This will return oldValue + "replay".
-
-This can be done also as async operation, with the `InfinispanOperation.COMPUTEASYNC` operation
-
-* Retrieve a specific key from the remote cache using a cache container configuration with additional parameters (host, port and protocol version):
-
-[source,java]
-----
-org.infinispan.client.hotrod.configuration.Configuration cacheContainerConfiguration = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
- .addServer()
- .host("localhost")
- .port(9999)
- .version(org.infinispan.client.hotrod.ProtocolVersion.PROTOCOL_VERSION_25)
- .build();
-...
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainerConfiguration=#cacheContainerConfiguration");
-----
-
-
-
-=== XML examples
-
-Routing can also be performed using XML configuration.
-The following example demonstrates `camel-infinispan` `local-camel-producer`, a camel route that sends data to an embedded cache created by the `local-cache` module.
-
-[source,java,options="nowrap"]
-----
-<camelContext id="local-producer" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="timer://local?fixedRate=true&period=5000"/>
- <setHeader headerName="CamelInfinispanKey">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanValue">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <to uri="infinispan://foo?cacheContainer=#cacheManager"/>
- <to uri="log:local-put?showAll=true"/>
- </route>
-</camelContext>
-----
-
-
-The provided example requires you to instantiate the [class]``cacheManager``.
-
-You can instantiate the [class]``cacheManager`` bean for Spring XML as follows:
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <constructor-arg type="java.lang.String" value="infinispan.xml"/>
-</bean>
-----
-
-
-The following demonstrates how to instantiate the [class]``cacheManager`` bean using Blueprint XML.
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-----
-
-[NOTE]
-====
-Both the Spring XML and Blueprint XML examples use the configuration file [path]_infinispan.xml_
- for configuration of the cache. This file must be present on the classpath.
-====
-
-
-== Remote Query
-
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
-
-.Using only Java
-====
+* Queries
++
[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
- .setHeader(InfinispanConstants.QUERY_BUILDER,
- new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class).having("name").like("%abc%")
- .build();
- }
- })
- .to("infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache") ;
-----
-====
-
-.Using Blueprint and Java
-====
-.Java [class]``RemoteCacheManagerFactory`` class:
-[source,java,options="nowrap"]
-----
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
- }
-}
-----
-.Java [class]``InfinispanQueryExample`` class:
-[source,java,options="nowrap"]
-----
-public class InfinispanQueryExample {
- public InfinispanQueryBuilder getBuilder() {
- return new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class)
- .having("name")
- .like("%abc%")
- .build();
- }
+ .setHeader(InfinispanConstants.QUERY_BUILDER, new InfinispanQueryBuilder() {
+ @Override
+ public Query build(QueryFactory<Query> qf) {
+ return qf.from(User.class).having("name").like("%abc%").build();
}
- }
-}
-----
-.blueprint.xml:
-[source,xml,options="nowrap"]
+ })
+ .to("infinispan:myCacheName?cacheContainer=#cacheManager") ;
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
-</bean>
-
-<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:start"/>
- <setHeader headerName="CamelInfinispanOperation">
- <constant>CamelInfinispanOperationQuery</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanQueryBuilder">
- <method ref="queryBuilder" method="getBuilder"/>
- </setHeader>
- <to uri="infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache"/>
- </route>
-</camelContext>
-----
-====
-
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-
-In addition, there are the following requirements:
-
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
-
-
-== Custom Listeners for Embedded Cache
-
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
-
-.Using Java
++
+* Custom Listeners
++
[source,java,options="nowrap"]
----
-from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener")
+from("infinispan://?cacheContainer=#cacheManager&customListener=#myCustomListener")
.to("mock:result");
----
-
-.Using Blueprint
-
-[source,xml,options="nowrap"]
-----
-<bean id="myCustomContainer" org.infinispan.manager.DefaultCacheManager"
- init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
- </route>
-</camelContext>
-----
-
-
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
-
-[NOTE]
-====
-Custom filters and converters for embedded caches are currently not supported.
-====
++
+The instance of `myCustomListener` must exist and Camel should be able to look it up from the `Registry`.
+Users are encouraged to extend the `org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener` class and annotate the resulting class with `@Listener` which can be found found in package `org.infinispan.notifications`.
-== Custom Listeners for Remote Cache
+== Using the Infinispan based idempotent repository
-Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
+In this section we will use the Infinispan based idempotent repository.
-.Using only Java
-====
-[source,java,options="nowrap"]
-----
-from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener")
- .to(mock:result);
+.Java Example
+[source,java]
----
-====
+InfinispanEmbeddedConfiguration conf = new InfinispanEmbeddedConfiguration(); // <1>
+conf.setConfigurationUri("classpath:infinispan.xml")
-.Using Blueprint and Java
-====
-.Java class:
-[source,java,options="nowrap"]
-----
+InfinispanEmbeddedIdempotentRepository repo = new InfinispanEmbeddedIdempotentRepository("idempotent"); // <2>
+repo.setConfiguration(conf);
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
+context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .idempotentConsumer(header("MessageID"), repo) // <3>
+ .to("mock:result");
}
-}
+});
----
-.blueprint.xml:
-[source,xml,options="nowrap"]
-----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
+<1> Configure the cache
+<2> Configure the repository bean
+<3> Set the repository to the route
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+.XML Example
+[source,xml]
+----
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedIdempotentRepository" destroy-method="stop">
+ <constructor-arg value="idempotent"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration">
+ <property name="configurationUrl" value="classpath:infinispan.xml"/>
+ </bean>
+ </property>
</bean>
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
- <from uri="infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
+ <from uri="direct:start" />
+ <idempotentConsumer messageIdRepositoryRef="infinispanRepo"> <3>
+ <header>MessageID</header>
+ <to uri="mock:result" />
+ </idempotentConsumer>
</route>
</camelContext>
----
-====
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
+== Using the Infinispan based aggregation repository
-Remote listeners may also be associated with custom filters and converters as shown below:
-[source,java,options="nowrap"]
-----
-@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
- private static class MyCustomListener extends InfinispanRemoteCustomListener {
-}
-----
+In this section we will use the Infinispan based aggregation repository.
-In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
-[source,java,options="nowrap"]
+.Java Example
+[source,java]
----
-import org.infinispan.notifications.cachelistener.filter;
-
-@NamedFactory(name = "static-converter-factory")
-public static class StaticConverterFactory implements CacheEventConverterFactory {
- @Override
- public CacheEventConverter<Integer, String, CustomEvent> getConverter(Object[] params) {
- ...
- }
-
- static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
- @Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
- }
- }
-}
+InfinispanEmbeddedConfiguration conf = new InfinispanEmbeddedConfiguration(); // <1>
+conf.setConfigurationUri("classpath:infinispan.xml")
-@NamedFactory(name = "static-filter-factory")
-public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
- @Override
- public CacheEventFilter<Integer, String> getFilter(final Object[] params) {
- ...
- }
+InfinispanEmbeddedAggregationRepository repo = new InfinispanEmbeddedAggregationRepository("aggregation"); // <2>
+repo.setConfiguration(conf);
- static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
+context.addRoutes(new RouteBuilder() {
@Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
+ public void configure() {
+ from("direct:start")
+ .aggregate(header("MessageID"))
+ .completionSize(3)
+ .aggregationRepository(repo) // <3>
+ .aggregationStrategyRef("myStrategy")
+ .to("mock:result");
}
- }
-}
-----
-
-Custom filters and converters must be registered with the server.
-.
-
-[NOTE]
-====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
-====
-
-[NOTE]
-====
-With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
-For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
-====
-
-== Using the Infinispan based idempotent repository
-
-In this section we will use the Infinispan based idempotent repository.
-
-First, we need to create a cacheManager and then configure our
-
-[source,java]
-----
-org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository:
+});
----
+<1> Configure the cache
+<2> Create the repository bean
+<3> Set the repository to the route
+.XML Example
[source,xml]
----
-<!-- set up the cache manager -->
-<bean id="cacheManager"
- class="org.infinispan.manager.DefaultCacheManager"
- init-method="start"
- destroy-method="stop"/>
-
-<!-- set up the repository -->
-<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.InfinispanIdempotentRepository"
- factory-method="infinispanIdempotentRepository">
- <argument ref="cacheManager"/>
- <argument value="idempotent"/>
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedAggregationRepository" destroy-method="stop">
+ <constructor-arg value="aggregation"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration">
+ <property name="configurationUrl" value="classpath:infinispan.xml"/>
+ </bean>
+ </property>
</bean>
-----
-
-Then we can create our Infinispan idempotent repository in the spring
-XML file as well:
-[source,xml]
-----
<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route id="JpaMessageIdRepositoryTest">
+ <route>
<from uri="direct:start" />
- <idempotentConsumer messageIdRepositoryRef="infinispanStore">
- <header>messageId</header>
- <to uri="mock:result" />
- </idempotentConsumer>
+ <aggregate strategyRef="myStrategy"
+ completionSize="3"
+ aggregationRepositoryRef="infinispanRepo"> <3>
+ <correlationExpression>
+ <header>MessageID</header>
+ </correlationExpression>
+ <to uri="mock:result"/>
+ </aggregate>
</route>
</camelContext>
----
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
+[NOTE]
+====
+With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
+For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
+====
-include::camel-spring-boot::page$infinispan-starter.adoc[]
+include::camel-spring-boot::page$infinispan-embedded-starter.adoc[]
diff --git a/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
index e32a677..d8bb96f 100644
--- a/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
@@ -61,9 +61,7 @@ public class InfinispanEmbeddedConfiguration extends InfinispanConfiguration imp
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration;
+ * The CacheContainer configuration. Used if the cacheContainer is not defined.
*/
public void setCacheContainerConfiguration(Configuration cacheContainerConfiguration) {
this.cacheContainerConfiguration = cacheContainerConfiguration;
@@ -127,8 +125,7 @@ public class InfinispanEmbeddedConfiguration extends InfinispanConfiguration imp
}
/**
- * A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote
- * caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation
*/
public void setFlags(String flagsAsString) {
String[] flagsArray = flagsAsString.split(",");
diff --git a/components/camel-infinispan/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json b/components/camel-infinispan/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
index 3a299ce..6f45ca3 100644
--- a/components/camel-infinispan/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
+++ b/components/camel-infinispan/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
@@ -42,10 +42,10 @@
"username": { "kind": "property", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
"autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
"cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.RemoteCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
- "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.configuration.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "T [...]
+ "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.configuration.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "T [...]
"configurationProperties": { "kind": "property", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for [...]
"configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote ca [...]
+ "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation." },
"remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader = [...]
},
@@ -71,10 +71,10 @@
"securityServerName": { "kind": "parameter", "displayName": "Security Server Name", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the security server name to access the infinispan instance" },
"username": { "kind": "parameter", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
"cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.RemoteCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to con [...]
- "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.configuration.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": " [...]
+ "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.configuration.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": " [...]
"configurationProperties": { "kind": "parameter", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for [...]
"configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote c [...]
+ "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation." },
"remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader [...]
}
diff --git a/components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc b/components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
index 0ba396c..46f03f9 100644
--- a/components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
+++ b/components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
@@ -69,10 +69,10 @@ The Infinispan component supports 26 options, which are listed below.
| *username* ( security) | Define the username to access the infinispan instance | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
@@ -126,10 +126,10 @@ with the following path and query parameters:
| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
| *username* ( security) | Define the username to access the infinispan instance | | String
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
diff --git a/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
index b06debb..eaf387b 100644
--- a/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
+++ b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
@@ -64,9 +64,7 @@ public class InfinispanRemoteConfiguration extends InfinispanConfiguration imple
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration;
+ * The CacheContainer configuration. Used if the cacheContainer is not defined.
*/
public void setCacheContainerConfiguration(Configuration cacheContainerConfiguration) {
this.cacheContainerConfiguration = cacheContainerConfiguration;
@@ -216,8 +214,7 @@ public class InfinispanRemoteConfiguration extends InfinispanConfiguration imple
}
/**
- * A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote
- * caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation.
*/
public void setFlags(String flagsAsString) {
String[] flagsArray = flagsAsString.split(",");
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java
index 92f37dc..1bd7470 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java
@@ -378,12 +378,8 @@ public interface InfinispanComponentBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.client.hotrod.configuration.Configuration</code> type.
@@ -430,8 +426,8 @@ public interface InfinispanComponentBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be
+ * applied by default on each cache invocation.
*
* The option is a: <code>java.lang.String</code> type.
*
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java
index ab203d2..376f466 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java
@@ -312,12 +312,8 @@ public interface InfinispanEmbeddedComponentBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.configuration.cache.Configuration</code> type.
@@ -348,8 +344,8 @@ public interface InfinispanEmbeddedComponentBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied
+ * by default on each cache invocation.
*
* The option is a: <code>java.lang.String</code> type.
*
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java
index a8fe216..497fb6b 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java
@@ -354,12 +354,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.configuration.cache.Configuration</code> type.
@@ -375,12 +371,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option will be converted to a
* <code>org.infinispan.configuration.cache.Configuration</code> type.
@@ -411,8 +403,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied
+ * by default on each cache invocation.
*
* The option is a:
* <code>org.infinispan.context.Flag[]</code> type.
@@ -428,8 +420,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied
+ * by default on each cache invocation.
*
* The option will be converted to a
* <code>org.infinispan.context.Flag[]</code> type.
@@ -790,12 +782,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.configuration.cache.Configuration</code> type.
@@ -811,12 +799,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option will be converted to a
* <code>org.infinispan.configuration.cache.Configuration</code> type.
@@ -847,8 +831,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied
+ * by default on each cache invocation.
*
* The option is a:
* <code>org.infinispan.context.Flag[]</code> type.
@@ -864,8 +848,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied
+ * by default on each cache invocation.
*
* The option will be converted to a
* <code>org.infinispan.context.Flag[]</code> type.
@@ -1024,12 +1008,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.configuration.cache.Configuration</code> type.
@@ -1045,12 +1025,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option will be converted to a
* <code>org.infinispan.configuration.cache.Configuration</code> type.
@@ -1081,8 +1057,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied
+ * by default on each cache invocation.
*
* The option is a:
* <code>org.infinispan.context.Flag[]</code> type.
@@ -1097,8 +1073,8 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.context.Flag to be applied
+ * by default on each cache invocation.
*
* The option will be converted to a
* <code>org.infinispan.context.Flag[]</code> type.
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java
index 0b4f9ab..d33655f 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java
@@ -403,12 +403,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.client.hotrod.configuration.Configuration</code> type.
@@ -424,12 +420,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option will be converted to a
* <code>org.infinispan.client.hotrod.configuration.Configuration</code> type.
@@ -493,8 +485,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be
+ * applied by default on each cache invocation.
*
* The option is a:
* <code>org.infinispan.client.hotrod.Flag[]</code> type.
@@ -510,8 +502,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be
+ * applied by default on each cache invocation.
*
* The option will be converted to a
* <code>org.infinispan.client.hotrod.Flag[]</code> type.
@@ -985,12 +977,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.client.hotrod.configuration.Configuration</code> type.
@@ -1006,12 +994,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option will be converted to a
* <code>org.infinispan.client.hotrod.configuration.Configuration</code> type.
@@ -1075,8 +1059,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be
+ * applied by default on each cache invocation.
*
* The option is a:
* <code>org.infinispan.client.hotrod.Flag[]</code> type.
@@ -1092,8 +1076,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be
+ * applied by default on each cache invocation.
*
* The option will be converted to a
* <code>org.infinispan.client.hotrod.Flag[]</code> type.
@@ -1366,12 +1350,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option is a:
* <code>org.infinispan.client.hotrod.configuration.Configuration</code> type.
@@ -1387,12 +1367,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * The CacheContainer configuration. Uses if the cacheContainer is not
- * defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote
- * cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache
- * interaction configuration;.
+ * The CacheContainer configuration. Used if the cacheContainer is not
+ * defined.
*
* The option will be converted to a
* <code>org.infinispan.client.hotrod.configuration.Configuration</code> type.
@@ -1456,8 +1432,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be
+ * applied by default on each cache invocation.
*
* The option is a:
* <code>org.infinispan.client.hotrod.Flag[]</code> type.
@@ -1472,8 +1448,8 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * A comma separated list of Flag to be applied by default on each cache
- * invocation, not applicable to remote caches.
+ * A comma separated list of org.infinispan.client.hotrod.Flag to be
+ * applied by default on each cache invocation.
*
* The option will be converted to a
* <code>org.infinispan.client.hotrod.Flag[]</code> type.
diff --git a/docs/components/modules/ROOT/pages/infinispan-component.adoc b/docs/components/modules/ROOT/pages/infinispan-component.adoc
index 01f2103..93c21dc 100644
--- a/docs/components/modules/ROOT/pages/infinispan-component.adoc
+++ b/docs/components/modules/ROOT/pages/infinispan-component.adoc
@@ -71,10 +71,10 @@ The Infinispan component supports 26 options, which are listed below.
| *username* ( security) | Define the username to access the infinispan instance | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
@@ -128,10 +128,10 @@ with the following path and query parameters:
| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
| *username* ( security) | Define the username to access the infinispan instance | | String
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.client.hotrod.Flag to be applied by default on each cache invocation. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
diff --git a/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc b/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc
index 0d2a807..eb8252c 100644
--- a/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc
+++ b/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc
@@ -21,7 +21,7 @@ store and data grid platform written in Java.
Infinispan requires at least Java 8.
-The `camel-infinispan` component includes the following features:
+The `camel-infinispan-embedded` component includes the following features:
* *Local Camel Consumer* - Receives cache change notifications and sends them to be processed.
This can be done synchronously or asynchronously, and is also supported with a replicated or distributed cache.
@@ -53,14 +53,11 @@ infinispan-embedded://cacheName?[options]
== URI Options
-The producer allows sending messages to a local infinispan cache
-configured in the registry, or to a remote cache using the HotRod
-protocol. The consumer allows listening for events from local infinispan cache
-accessible from the registry.
+The producer allows sending messages to a local infinispan cache.
+The consumer allows listening for events from local infinispan cache.
If no cache configuration is provided, embedded cacheContainer is created directly in the component.
-
// component options: START
The Infinispan Embedded component supports 20 options, which are listed below.
@@ -84,9 +81,9 @@ The Infinispan Embedded component supports 20 options, which are listed below.
| *value* (producer) | Set a specific value for producer operations | | Object
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
@@ -135,268 +132,169 @@ with the following path and query parameters:
| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
| *value* (producer) | Set a specific value for producer operations | | Object
| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Used if the cacheContainer is not defined. | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *flags* (advanced) | A comma separated list of org.infinispan.context.Flag to be applied by default on each cache invocation | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
+
== Camel Operations
This section lists all available operations, along with their header information.
.Put Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUT
-| *Context*: Embedded / Remote
-
-*Description*: Puts a key/value pair in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.PUTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENT
-| *Description*: Puts a key/value pair in the cache if it did not exist, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUT | Puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTASYNC | Asynchronously puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTIFABSENT | Puts a key/value pair in the cache if it did not exist, optionally with expiration
+| InfinispanOperation.PUTIFABSENTASYNC | Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Put All Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUTALL
-| *Context*: Embedded / Remote
-
-*Description*: Adds multiple entries to a cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanMap
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit
-
-*Result Header*: None
-
-| CamelInfinispanOperation.PUTALLASYNC
-| *Description*: Asynchronously adds multiple entries to a cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUTALL | Adds multiple entries to a cache, optionally with expiration
+| CamelInfinispanOperation.PUTALLASYNC | Asynchronously adds multiple entries to a cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanMap
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+
.Get Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-|Operation Name
-|Description
-
-| InfinispanOperation.GET
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.GETORDEFAULT
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value, or default value, associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
+|Operation Name |Description
+| InfinispanOperation.GET | Retrieves the value associated with a specific key from the cache
+| InfinispanOperation.GETORDEFAULT | Retrieves the value, or default value, associated with a specific key from the cache
|===
+* *Required Headers*:
+** CamelInfinispanKey
+
.Contains Key Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSKEY
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific key
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.CONTAINSKEY | Determines whether a cache contains a specific key
|===
+* *Required Headers*
+** CamelInfinispanKey
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Contains Value Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CONTAINSVALUE | Determines whether a cache contains a specific value
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSVALUE
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific value
-
-*Required Headers*: CamelInfinispanKey
-*Optional Headers*: None
+* *Required Headers*:
+** CamelInfinispanKey
-*Result Headers*: None
-|===
.Remove Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REMOVE
-| *Context*: Embedded / Remote
-
-*Description*: Removes an entry from a cache, optionally only if the value matches a given one
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: CamelInfinispanValue
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REMOVEASYNC
-| *Description*: Asynchronously removes an entry from a cache, optionally only if the value matches a given one
-
+| Operation Name | Description
+| InfinispanOperation.REMOVE | Removes an entry from a cache, optionally only if the value matches a given one
+| InfinispanOperation.REMOVEASYNC | Asynchronously removes an entry from a cache, optionally only if the value matches a given one
|===
+* *Required Headers*:
+** CamelInfinispanKey
+* *Optional Headers*:
+** CamelInfinispanValue
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Replace Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REPLACE
-| *Context*: Embedded / Remote
-
-*Description*: Conditionally replaces an entry in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue, CamelInfinispanOldValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REPLACEASYNC
-| *Description*: Asynchronously conditionally replaces an entry in the cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.REPLACE | Conditionally replaces an entry in the cache, optionally with expiration
+| InfinispanOperation.REPLACEASYNC | Asynchronously conditionally replaces an entry in the cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+** CamelInfinispanOldValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Clear Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CLEAR
-| *Context*: Embedded / Remote
-
-*Description*: Clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.CLEARASYNC
-| *Context*: Embedded / Remote
-
-*Description*: Asynchronously clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
+| Operation Name | Description
+| InfinispanOperation.CLEAR | Clears the cache
+| InfinispanOperation.CLEARASYNC | Asynchronously clears the cache
|===
.Size Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.SIZE
-| *Context*: Embedded / Remote
-
-*Description*: Returns the number of entries in the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.SIZE | Returns the number of entries in the cache
|===
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Stats Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.STATS
-| *Context*: Embedded / Remote
-
-*Description*: Returns statistics about the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.STATS | Returns statistics about the cache
|===
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Query Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.QUERY
-| *Context*: Remote
-
-*Description*: Executes a query on the cache
-
-*Required Headers*: CamelInfinispanQueryBuilder
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.QUERY | Executes a query on the cache
|===
+* *Required Headers*:
+** CamelInfinispanQueryBuilder
+* *Result Header*:
+** CamelInfinispanOperationResult
+
[NOTE]
====
-Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null result.
+Write methods like put(key, value) and remove(key) do not return the previous value by default.
====
-
-
== Message Headers
[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
@@ -407,439 +305,188 @@ Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null
|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
-|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event. Possible values defined here org.infinispan.notifications.cachelistener.event.Event.Type
-|CamelInfinispanIsPre |`null` |Boolean |Consumer |Infinispan fires two events for each operation: one before and one after the operation.
+|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event.
|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
-|CamelInfinispanIgnoreReturnValues |null |Boolean |Producer |If this header is set, the return value for cache operation returning something is ignored by the client application
|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
|=======================================================================
-== Examples
-
-* Retrieve a specific key from the default cache using a custom cache container:
-
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer");
-----
+== Examples
* Put a key/value into a named cache:
+
[source,java]
----
from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan:myCacheName");
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT) // <1>
+ .setHeader(InfinispanConstants.KEY).constant("123") // <2>
+ .to("infinispan:myCacheName&cacheContainer=#cacheContainer"); // <3>
----
-
-* Put a value with lifespan
-
-[source,java]
+<1> Set the operation to perform
+<2> Set the key used to identify the element in the cache
+<3> Use the configured cache manager `cacheContainer` from the registry to put an element to the cache named `myCacheName`
++
+It is possible to configure the lifetime and/or the idle time before the entry expires and gets evicted from the cache, as example:
++
+[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
.setHeader(InfinispanConstants.KEY).constant("123")
- .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L)
- .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString())
+ .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L) // <1>
+ .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString()) // <2>
.to("infinispan:myCacheName");
----
+<1> Set the lifespan of the entry
+<2> Set the time unit for the lifespan
-* Compute operation through a remapping function on the default cache using a custom cache container:
-
-[source,java]
-----
-@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer&remappingFunction=#mappingFunction");
-----
-
-This will return oldValue + "replay".
-
-This can be done also as async operation, with the `InfinispanOperation.COMPUTEASYNC` operation
-
-* Retrieve a specific key from the remote cache using a cache container configuration with additional parameters (host, port and protocol version):
-
-[source,java]
-----
-org.infinispan.client.hotrod.configuration.Configuration cacheContainerConfiguration = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
- .addServer()
- .host("localhost")
- .port(9999)
- .version(org.infinispan.client.hotrod.ProtocolVersion.PROTOCOL_VERSION_25)
- .build();
-...
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainerConfiguration=#cacheContainerConfiguration");
-----
-
-
-
-=== XML examples
-
-Routing can also be performed using XML configuration.
-The following example demonstrates `camel-infinispan` `local-camel-producer`, a camel route that sends data to an embedded cache created by the `local-cache` module.
-
-[source,java,options="nowrap"]
-----
-<camelContext id="local-producer" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="timer://local?fixedRate=true&period=5000"/>
- <setHeader headerName="CamelInfinispanKey">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanValue">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <to uri="infinispan://foo?cacheContainer=#cacheManager"/>
- <to uri="log:local-put?showAll=true"/>
- </route>
-</camelContext>
-----
-
-
-The provided example requires you to instantiate the [class]``cacheManager``.
-
-You can instantiate the [class]``cacheManager`` bean for Spring XML as follows:
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <constructor-arg type="java.lang.String" value="infinispan.xml"/>
-</bean>
-----
-
-
-The following demonstrates how to instantiate the [class]``cacheManager`` bean using Blueprint XML.
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-----
-
-[NOTE]
-====
-Both the Spring XML and Blueprint XML examples use the configuration file [path]_infinispan.xml_
- for configuration of the cache. This file must be present on the classpath.
-====
-
-
-== Remote Query
-
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
-
-.Using only Java
-====
+* Queries
++
[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
- .setHeader(InfinispanConstants.QUERY_BUILDER,
- new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class).having("name").like("%abc%")
- .build();
- }
- })
- .to("infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache") ;
-----
-====
-
-.Using Blueprint and Java
-====
-.Java [class]``RemoteCacheManagerFactory`` class:
-[source,java,options="nowrap"]
-----
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
- }
-}
-----
-.Java [class]``InfinispanQueryExample`` class:
-[source,java,options="nowrap"]
-----
-public class InfinispanQueryExample {
- public InfinispanQueryBuilder getBuilder() {
- return new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class)
- .having("name")
- .like("%abc%")
- .build();
- }
+ .setHeader(InfinispanConstants.QUERY_BUILDER, new InfinispanQueryBuilder() {
+ @Override
+ public Query build(QueryFactory<Query> qf) {
+ return qf.from(User.class).having("name").like("%abc%").build();
}
- }
-}
-----
-.blueprint.xml:
-[source,xml,options="nowrap"]
+ })
+ .to("infinispan:myCacheName?cacheContainer=#cacheManager") ;
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
-</bean>
-
-<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:start"/>
- <setHeader headerName="CamelInfinispanOperation">
- <constant>CamelInfinispanOperationQuery</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanQueryBuilder">
- <method ref="queryBuilder" method="getBuilder"/>
- </setHeader>
- <to uri="infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache"/>
- </route>
-</camelContext>
-----
-====
-
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-
-In addition, there are the following requirements:
-
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
-
-
-== Custom Listeners for Embedded Cache
-
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
-
-.Using Java
++
+* Custom Listeners
++
[source,java,options="nowrap"]
----
-from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener")
+from("infinispan://?cacheContainer=#cacheManager&customListener=#myCustomListener")
.to("mock:result");
----
-
-.Using Blueprint
-
-[source,xml,options="nowrap"]
-----
-<bean id="myCustomContainer" org.infinispan.manager.DefaultCacheManager"
- init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
- </route>
-</camelContext>
-----
-
-
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
-
-[NOTE]
-====
-Custom filters and converters for embedded caches are currently not supported.
-====
++
+The instance of `myCustomListener` must exist and Camel should be able to look it up from the `Registry`.
+Users are encouraged to extend the `org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener` class and annotate the resulting class with `@Listener` which can be found found in package `org.infinispan.notifications`.
-== Custom Listeners for Remote Cache
+== Using the Infinispan based idempotent repository
-Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
+In this section we will use the Infinispan based idempotent repository.
-.Using only Java
-====
-[source,java,options="nowrap"]
-----
-from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener")
- .to(mock:result);
+.Java Example
+[source,java]
----
-====
+InfinispanEmbeddedConfiguration conf = new InfinispanEmbeddedConfiguration(); // <1>
+conf.setConfigurationUri("classpath:infinispan.xml")
-.Using Blueprint and Java
-====
-.Java class:
-[source,java,options="nowrap"]
-----
+InfinispanEmbeddedIdempotentRepository repo = new InfinispanEmbeddedIdempotentRepository("idempotent"); // <2>
+repo.setConfiguration(conf);
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
+context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .idempotentConsumer(header("MessageID"), repo) // <3>
+ .to("mock:result");
}
-}
+});
----
-.blueprint.xml:
-[source,xml,options="nowrap"]
-----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
+<1> Configure the cache
+<2> Configure the repository bean
+<3> Set the repository to the route
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+.XML Example
+[source,xml]
+----
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedIdempotentRepository" destroy-method="stop">
+ <constructor-arg value="idempotent"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration">
+ <property name="configurationUrl" value="classpath:infinispan.xml"/>
+ </bean>
+ </property>
</bean>
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
- <from uri="infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
+ <from uri="direct:start" />
+ <idempotentConsumer messageIdRepositoryRef="infinispanRepo"> <3>
+ <header>MessageID</header>
+ <to uri="mock:result" />
+ </idempotentConsumer>
</route>
</camelContext>
----
-====
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
+== Using the Infinispan based aggregation repository
-Remote listeners may also be associated with custom filters and converters as shown below:
-[source,java,options="nowrap"]
-----
-@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
- private static class MyCustomListener extends InfinispanRemoteCustomListener {
-}
-----
+In this section we will use the Infinispan based aggregation repository.
-In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
-[source,java,options="nowrap"]
+.Java Example
+[source,java]
----
-import org.infinispan.notifications.cachelistener.filter;
-
-@NamedFactory(name = "static-converter-factory")
-public static class StaticConverterFactory implements CacheEventConverterFactory {
- @Override
- public CacheEventConverter<Integer, String, CustomEvent> getConverter(Object[] params) {
- ...
- }
-
- static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
- @Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
- }
- }
-}
+InfinispanEmbeddedConfiguration conf = new InfinispanEmbeddedConfiguration(); // <1>
+conf.setConfigurationUri("classpath:infinispan.xml")
-@NamedFactory(name = "static-filter-factory")
-public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
- @Override
- public CacheEventFilter<Integer, String> getFilter(final Object[] params) {
- ...
- }
+InfinispanEmbeddedAggregationRepository repo = new InfinispanEmbeddedAggregationRepository("aggregation"); // <2>
+repo.setConfiguration(conf);
- static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
+context.addRoutes(new RouteBuilder() {
@Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
+ public void configure() {
+ from("direct:start")
+ .aggregate(header("MessageID"))
+ .completionSize(3)
+ .aggregationRepository(repo) // <3>
+ .aggregationStrategyRef("myStrategy")
+ .to("mock:result");
}
- }
-}
-----
-
-Custom filters and converters must be registered with the server.
-.
-
-[NOTE]
-====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
-====
-
-[NOTE]
-====
-With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
-For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
-====
-
-== Using the Infinispan based idempotent repository
-
-In this section we will use the Infinispan based idempotent repository.
-
-First, we need to create a cacheManager and then configure our
-
-[source,java]
-----
-org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository:
+});
----
+<1> Configure the cache
+<2> Create the repository bean
+<3> Set the repository to the route
+.XML Example
[source,xml]
----
-<!-- set up the cache manager -->
-<bean id="cacheManager"
- class="org.infinispan.manager.DefaultCacheManager"
- init-method="start"
- destroy-method="stop"/>
-
-<!-- set up the repository -->
-<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.InfinispanIdempotentRepository"
- factory-method="infinispanIdempotentRepository">
- <argument ref="cacheManager"/>
- <argument value="idempotent"/>
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedAggregationRepository" destroy-method="stop">
+ <constructor-arg value="aggregation"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration">
+ <property name="configurationUrl" value="classpath:infinispan.xml"/>
+ </bean>
+ </property>
</bean>
-----
-
-Then we can create our Infinispan idempotent repository in the spring
-XML file as well:
-[source,xml]
-----
<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route id="JpaMessageIdRepositoryTest">
+ <route>
<from uri="direct:start" />
- <idempotentConsumer messageIdRepositoryRef="infinispanStore">
- <header>messageId</header>
- <to uri="mock:result" />
- </idempotentConsumer>
+ <aggregate strategyRef="myStrategy"
+ completionSize="3"
+ aggregationRepositoryRef="infinispanRepo"> <3>
+ <correlationExpression>
+ <header>MessageID</header>
+ </correlationExpression>
+ <to uri="mock:result"/>
+ </aggregate>
</route>
</camelContext>
----
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
+[NOTE]
+====
+With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
+For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
+====
-include::camel-spring-boot::page$infinispan-starter.adoc[]
+include::camel-spring-boot::page$infinispan-embedded-starter.adoc[]
[camel] 05/06: CAMEL-12489 - camel-infinspan: split remote and
embedded components (cleanup)
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 8618ebae22c94f2ce601e9111cffbcdcbbdb2ab5
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Tue Jan 26 11:50:05 2021 +0100
CAMEL-12489 - camel-infinspan: split remote and embedded components (cleanup)
---
.../apache/camel/component/infinispan/InfinispanUtil.java | 9 +--------
.../infinispan/embedded/InfinispanEmbeddedProducerTest.java | 12 +++++++++---
.../infinispan/embedded/InfinispanEmbeddedTestSupport.java | 1 +
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
index 95e6e1e..f9f0ebc 100644
--- a/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
+++ b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
@@ -27,20 +27,13 @@ import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.util.ObjectHelper;
-import org.infinispan.AdvancedCache;
-import org.infinispan.commons.api.BasicCache;
public class InfinispanUtil {
protected InfinispanUtil() {
}
- @SuppressWarnings("unchecked")
- public static <K, V> AdvancedCache<K, V> asAdvanced(BasicCache<K, V> cache) {
- return (AdvancedCache) cache;
- }
-
public static boolean isInHeaderEmpty(Exchange exchange, String header) {
- return isHeaderEmpty(exchange.getIn(), header);
+ return isHeaderEmpty(exchange.getMessage(), header);
}
public static boolean isHeaderEmpty(Message message, String header) {
diff --git a/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
index 46a4a1c..3f0acc8 100644
--- a/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
@@ -23,8 +23,8 @@ import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.infinispan.InfinispanConstants;
import org.apache.camel.component.infinispan.InfinispanOperation;
import org.apache.camel.component.infinispan.InfinispanProducerTestSupport;
-import org.apache.camel.component.infinispan.InfinispanUtil;
import org.infinispan.commons.api.BasicCache;
+import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.stats.Stats;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -37,10 +37,16 @@ public class InfinispanEmbeddedProducerTest extends InfinispanEmbeddedTestSuppor
return (k, v) -> v + "replay";
}
+ @Override
+ protected ConfigurationBuilder getConfiguration() {
+ ConfigurationBuilder builder = super.getConfiguration();
+ builder.statistics().enable();
+
+ return builder;
+ }
+
@Test
public void statsOperation() {
- InfinispanUtil.asAdvanced(getCache()).getStats().setStatisticsEnabled(true);
-
fluentTemplate()
.to("direct:start")
.withHeader(InfinispanConstants.KEY, InfinispanProducerTestSupport.KEY_ONE)
diff --git a/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
index e887c9c..f99da99 100644
--- a/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
@@ -65,6 +65,7 @@ public class InfinispanEmbeddedTestSupport extends InfinispanTestSupport {
protected ConfigurationBuilder getConfiguration() {
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.clustering().cacheMode(CacheMode.LOCAL);
+
return builder;
}
[camel] 02/06: CAMEL-12489 - camel-infinspan: split remote and
embedded components (split)
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 37f2ec49cbe558dede84df765d640ee2414b55f0
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Thu Jan 21 19:01:21 2021 +0100
CAMEL-12489 - camel-infinspan: split remote and embedded components
(split)
---
bom/camel-bom/pom.xml | 15 +
.../org/apache/camel/catalog/components.properties | 2 -
.../catalog/components/infinispan-embedded.json | 71 --
.../camel/catalog/components/infinispan.json | 87 ---
.../org/apache/camel/catalog/docs.properties | 2 -
.../camel-infinispan-common/pom.xml | 107 +++
.../InfinispanAggregationRepository.java | 0
.../component/infinispan/InfinispanComponent.java | 0
.../infinispan/InfinispanConfiguration.java | 85 +--
.../component/infinispan/InfinispanConstants.java | 0
.../component/infinispan/InfinispanConsumer.java | 0
.../component/infinispan/InfinispanEndpoint.java | 0
.../infinispan/InfinispanEventListener.java | 0
.../infinispan/InfinispanEventProcessor.java | 0
.../infinispan/InfinispanIdempotentRepository.java | 0
.../component/infinispan/InfinispanManager.java | 0
.../component/infinispan/InfinispanOperation.java | 0
.../component/infinispan/InfinispanProducer.java | 0
.../infinispan/InfinispanQueryBuilder.java | 0
.../infinispan/InfinispanRoutePolicy.java | 0
.../camel/component/infinispan/InfinispanUtil.java | 0
.../infinispan/InfinispanConsumerTestSupport.java | 0
.../InfinispanIdempotentRepositoryTestSupport.java | 0
.../infinispan/InfinispanProducerTestSupport.java | 22 -
.../InfinispanRoutePolicyTestSupport.java | 0
.../infinispan/InfinispanTestSupport.java | 2 +-
.../camel-infinispan-embedded/pom.xml | 134 ++++
.../InfinispanEmbeddedComponentConfigurer.java | 3 -
.../InfinispanEmbeddedEndpointConfigurer.java | 3 -
.../InfinispanEmbeddedEndpointUriFactory.java | 3 +-
.../services/org/apache/camel/component.properties | 7 +
.../org/apache/camel/component/infinispan-embedded | 0
.../camel/configurer/infinispan-embedded-component | 0
.../camel/configurer/infinispan-embedded-endpoint | 0
.../camel/urifactory/infinispan-embedded-endpoint | 0
.../infinispan/embedded/infinispan-embedded.json | 12 +-
.../main}/docs/infinispan-embedded-component.adoc | 14 +-
.../InfinispanEmbeddedAggregationRepository.java | 3 +-
.../embedded/InfinispanEmbeddedComponent.java | 0
.../embedded/InfinispanEmbeddedConfiguration.java | 0
.../embedded/InfinispanEmbeddedConsumer.java | 0
.../embedded/InfinispanEmbeddedCustomListener.java | 0
.../embedded/InfinispanEmbeddedEndpoint.java | 0
.../embedded/InfinispanEmbeddedEventListener.java | 0
.../embedded/InfinispanEmbeddedEventListeners.java | 0
.../InfinispanEmbeddedIdempotentRepository.java | 0
.../embedded/InfinispanEmbeddedManager.java | 0
.../embedded/InfinispanEmbeddedProducer.java | 0
.../embedded/InfinispanEmbeddedRoutePolicy.java | 0
.../embedded/InfinispanEmbeddedUtil.java | 3 +-
...mbeddedAggregationRepositoryOperationsTest.java | 0
...nfinispanEmbeddedAggregationRepositoryTest.java | 0
.../InfinispanEmbeddedClusteredConsumerTest.java | 0
.../InfinispanEmbeddedClusteredTestSupport.java | 0
.../InfinispanEmbeddedConfigurationTest.java | 0
.../embedded/InfinispanEmbeddedConsumerTest.java | 32 +-
.../InfinispanEmbeddedCustomListenerTest.java | 2 +-
...InfinispanEmbeddedIdempotentRepositoryTest.java | 0
.../embedded/InfinispanEmbeddedProducerTest.java | 16 +-
.../InfinispanEmbeddedQueryConsumerTest.java | 0
.../InfinispanEmbeddedQueryProducerTest.java | 0
.../InfinispanEmbeddedQueryTestSupport.java | 0
.../InfinispanEmbeddedRoutePolicyTest.java | 98 +++
.../embedded/InfinispanEmbeddedTestSupport.java | 2 +-
...ispanEmbeddedIdempotentRepositoryCamelTest.java | 0
...spanEmbeddedIdempotentRepositorySpringTest.java | 0
...panEmbeddedIdempotentRepositoryTestSupport.java | 0
.../src/test/resources/log4j2.properties | 0
...nispanEmbeddedIdempotentRepositoryCamelTest.xml | 0
...anEmbeddedIdempotentRepositoryConfiguration.xml | 0
...ispanEmbeddedIdempotentRepositorySpringTest.xml | 0
.../{ => camel-infinispan}/pom.xml | 89 +--
.../InfinispanRemoteComponentConfigurer.java | 3 -
.../remote/InfinispanRemoteEndpointConfigurer.java | 3 -
.../remote/InfinispanRemoteEndpointUriFactory.java | 3 +-
.../services/org/apache/camel/component.properties | 6 +-
.../services/org/apache/camel/component/infinispan | 0
.../apache/camel/configurer/infinispan-component | 0
.../apache/camel/configurer/infinispan-endpoint | 0
.../apache/camel/urifactory/infinispan-endpoint | 0
.../component/infinispan/remote/infinispan.json | 10 +-
.../src/main}/docs/infinispan-component.adoc | 36 +-
.../InfinispanRemoteAggregationRepository.java | 0
.../remote/InfinispanRemoteComponent.java | 0
.../remote/InfinispanRemoteConfiguration.java | 0
.../remote/InfinispanRemoteConsumer.java | 0
.../remote/InfinispanRemoteCustomListener.java | 0
.../remote/InfinispanRemoteEndpoint.java | 0
.../remote/InfinispanRemoteEventListener.java | 0
.../InfinispanRemoteIdempotentRepository.java | 0
.../infinispan/remote/InfinispanRemoteManager.java | 0
.../remote/InfinispanRemoteProducer.java | 0
.../remote/InfinispanRemoteRoutePolicy.java | 0
.../infinispan/remote/InfinispanRemoteUtil.java | 0
...nRemoteAggregationRepositoryOperationsTest.java | 0
.../InfinispanRemoteAggregationRepositoryTest.java | 0
.../remote/InfinispanRemoteConfigurationTest.java | 0
.../remote/InfinispanRemoteConsumerTest.java | 4 +-
.../remote/InfinispanRemoteCustomListenerTest.java | 4 +-
.../InfinispanRemoteIdempotentRepositoryTest.java | 0
.../remote/InfinispanRemoteProducerTest.java | 16 +-
.../remote/InfinispanRemoteQueryConsumerTest.java | 0
.../remote/InfinispanRemoteQueryProducerTest.java | 0
.../remote/InfinispanRemoteQueryTestSupport.java | 0
.../remote/InfinispanRemoteRoutePolicyTest.java | 124 +++
.../remote/InfinispanRemoteTestSupport.java | 2 +-
...inispanRemoteIdempotentRepositoryCamelTest.java | 0
...nispanRemoteIdempotentRepositorySpringTest.java | 0
...ispanRemoteIdempotentRepositoryTestSupport.java | 0
.../test/resources/infinispan/client.properties | 0
.../src/test/resources/log4j2.properties | 4 +-
...finispanRemoteIdempotentRepositoryCamelTest.xml | 0
...inispanRemoteIdempotentRepositorySpringTest.xml | 0
components/camel-infinispan/pom.xml | 224 +-----
.../camel/component/infinispan/infinispan.json | 87 ---
.../src/main/docs/infinispan-component.adoc | 501 ------------
.../main/docs/infinispan-embedded-component.adoc | 845 ---------------------
.../InfinispanEmbeddedRoutePolicyTest.java | 48 --
.../remote/InfinispanRemoteRoutePolicyTest.java | 49 --
core/camel-allcomponents/pom.xml | 8 +
.../component/ComponentsBuilderFactory.java | 4 +-
.../dsl/InfinispanComponentBuilderFactory.java | 17 -
.../InfinispanEmbeddedComponentBuilderFactory.java | 22 +-
.../src/generated/resources/metadata.json | 2 +-
.../builder/endpoint/StaticEndpointBuilders.java | 8 +-
.../InfinispanEmbeddedEndpointBuilderFactory.java | 24 +-
.../InfinispanRemoteEndpointBuilderFactory.java | 16 -
.../modules/ROOT/pages/infinispan-component.adoc | 38 +-
.../ROOT/pages/infinispan-embedded-component.adoc | 16 +-
parent/pom.xml | 15 +
.../test/infra/common/services/TestService.java | 7 +-
131 files changed, 693 insertions(+), 2267 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 23eac32..2bf41c7 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -979,6 +979,21 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-embedded</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-parent</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-influxdb</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index 6e9c853..8ca9418 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -176,8 +176,6 @@ ignite-queue
ignite-set
imap
imaps
-infinispan
-infinispan-embedded
influxdb
iota
ipfs
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan-embedded.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan-embedded.json
deleted file mode 100644
index 62c5705..0000000
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan-embedded.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "infinispan-embedded",
- "title": "Infinispan Embedded",
- "description": "Read and write from\/to Infinispan distributed key\/value store and data grid.",
- "deprecated": false,
- "firstVersion": "2.13.0",
- "label": "cache,datagrid,clustering",
- "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-infinispan",
- "version": "3.8.0-SNAPSHOT",
- "scheme": "infinispan-embedded",
- "extendsScheme": "",
- "syntax": "infinispan-embedded:cacheName",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": false,
- "lenientProperties": false
- },
- "componentProperties": {
- "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
- "queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
- "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
- "clusteredListener": { "kind": "property", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
- "customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom list [...]
- "eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated b [...]
- "sync": { "kind": "property", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
- "defaultValue": { "kind": "property", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
- "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
- "value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- "cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
- "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The C [...]
- "configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remot [...]
- "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
- "resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHead [...]
- },
- "properties": {
- "cacheName": { "kind": "path", "displayName": "Cache Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name." },
- "queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
- "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
- "clusteredListener": { "kind": "parameter", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
- "customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom lis [...]
- "eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated [...]
- "sync": { "kind": "parameter", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
- "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
- "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
- "defaultValue": { "kind": "parameter", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
- "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
- "oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
- "value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
- "cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to con [...]
- "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The [...]
- "configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remo [...]
- "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
- "resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHea [...]
- }
-}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan.json
deleted file mode 100644
index 5b48148..0000000
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan.json
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "infinispan",
- "title": "Infinispan",
- "description": "Read and write from\/to Infinispan distributed key\/value store and data grid.",
- "deprecated": false,
- "firstVersion": "2.13.0",
- "label": "cache,datagrid,clustering",
- "javaType": "org.apache.camel.component.infinispan.InfinispanComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-infinispan",
- "version": "3.8.0-SNAPSHOT",
- "scheme": "infinispan",
- "extendsScheme": "",
- "syntax": "infinispan:cacheName",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": false,
- "lenientProperties": false
- },
- "componentProperties": {
- "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
- "hosts": { "kind": "property", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the host of the cache on Infinispan instance" },
- "queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
- "secure": { "kind": "property", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
- "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
- "clusteredListener": { "kind": "property", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
- "customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in use, if provided" },
- "eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The pos [...]
- "sync": { "kind": "property", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
- "defaultValue": { "kind": "property", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
- "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
- "value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
- "password": { "kind": "property", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
- "saslMechanism": { "kind": "property", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
- "securityRealm": { "kind": "property", "displayName": "Security Realm", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security realm to access the infinispan instance" },
- "securityServerName": { "kind": "property", "displayName": "Security Server Name", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security server name to access the infinispan instance" },
- "username": { "kind": "property", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- "cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.commons.api.BasicCacheContainer", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
- "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The CacheContainer configuration. Uses if the cacheContainer is not defined. [...]
- "configurationProperties": { "kind": "property", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for the CacheManager" },
- "configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches." },
- "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
- "resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader == null and th [...]
- },
- "properties": {
- "cacheName": { "kind": "path", "displayName": "Cache Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name." },
- "hosts": { "kind": "parameter", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the host of the cache on Infinispan instance" },
- "queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
- "secure": { "kind": "parameter", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
- "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
- "clusteredListener": { "kind": "parameter", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
- "customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in use, if provided" },
- "eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The po [...]
- "sync": { "kind": "parameter", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
- "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
- "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
- "defaultValue": { "kind": "parameter", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
- "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
- "oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
- "value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
- "password": { "kind": "parameter", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
- "saslMechanism": { "kind": "parameter", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
- "securityRealm": { "kind": "parameter", "displayName": "Security Realm", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security realm to access the infinispan instance" },
- "securityServerName": { "kind": "parameter", "displayName": "Security Server Name", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security server name to access the infinispan instance" },
- "username": { "kind": "parameter", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
- "cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.commons.api.BasicCacheContainer", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
- "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The CacheContainer configuration. Uses if the cacheContainer is not defined [...]
- "configurationProperties": { "kind": "parameter", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for the CacheMan [...]
- "configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches." },
- "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
- "resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader == null and t [...]
- }
-}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
index 76df481..8b18c96 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
@@ -243,8 +243,6 @@ ignite-set-component
ignite-summary
inOnly-eip
inOut-eip
-infinispan-component
-infinispan-embedded-component
influxdb-component
intercept
iota-component
diff --git a/components/camel-infinispan/camel-infinispan-common/pom.xml b/components/camel-infinispan/camel-infinispan-common/pom.xml
new file mode 100644
index 0000000..3989a98
--- /dev/null
+++ b/components/camel-infinispan/camel-infinispan-common/pom.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-parent</artifactId>
+ <version>3.8.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-infinispan-common</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Infinispan :: Common</name>
+ <description>Camel Infinispan Common</description>
+
+ <properties>
+ <firstVersion>2.13.0</firstVersion>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-core</artifactId>
+ <version>${infinispan-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-query-dsl</artifactId>
+ <version>${infinispan-version}</version>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-package-maven-plugin</artifactId>
+ <configuration>
+ <!-- set to true to make build fail fast if missing documentation in docs files -->
+ <failFast>false</failFast>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <phase/>
+ </execution>
+ <execution>
+ <id>generate-postcompile</id>
+ <goals>
+ <goal>generate-postcompile</goal>
+ </goals>
+ <phase/>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
similarity index 61%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
index 10824f3..6dd32d2 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
+++ b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
@@ -21,53 +21,43 @@ import java.util.function.BiFunction;
import org.apache.camel.spi.UriParam;
public abstract class InfinispanConfiguration {
- @UriParam(label = "producer", defaultValue = "PUT")
+ @UriParam(label = "producer", defaultValue = "PUT", description = "The operation to perform")
private InfinispanOperation operation = InfinispanOperation.PUT;
- @UriParam(label = "producer")
+
+ @UriParam(label = "producer", description = "Set a specific key for producer operations")
private Object key;
- @UriParam(label = "producer")
+
+ @UriParam(label = "producer", description = "Set a specific value for producer operations")
private Object value;
- @UriParam(label = "producer")
+
+ @UriParam(label = "producer", description = "Set a specific old value for some producer operations")
private Object oldValue;
- @UriParam(label = "producer")
+
+ @UriParam(label = "producer", description = "Set a specific default value for some producer operations")
private Object defaultValue;
- @Deprecated
- @UriParam(label = "consumer", defaultValue = "PUT")
- private String command = "PUT";
- @UriParam(label = "advanced")
+
+ @UriParam(label = "advanced", description = "An implementation specific URI for the CacheManager")
private String configurationUri;
- @UriParam(label = "advanced")
- private String resultHeader;
- @UriParam(label = "advanced")
- private BiFunction remappingFunction;
- @UriParam
- private InfinispanQueryBuilder queryBuilder;
- public String getCommand() {
- return operation.toString();
- }
+ @UriParam(label = "advanced",
+ description = "Store the operation result in a header instead of the message body. By default,\n" +
+ "resultHeader == null and the query result is stored in the message body, any \n" +
+ "existing content in the message body is discarded. If resultHeader is set, the \n" +
+ "value is used as the name of the header to store the query result and the original \n" +
+ "message body is preserved. This value can be overridden by an in message header \n" +
+ "named: CamelInfinispanOperationResultHeader")
+ private String resultHeader;
- /**
- * The operation to perform.
- *
- * @deprecated replaced by @{link setOperation}
- */
- @Deprecated
- public void setCommand(String command) {
- if (command.startsWith(InfinispanConstants.OPERATION)) {
- command = command.substring(InfinispanConstants.OPERATION.length()).toUpperCase();
- }
+ @UriParam(label = "advanced", description = "Set a specific remappingFunction to use in a compute operation.")
+ private BiFunction remappingFunction;
- setOperation(InfinispanOperation.valueOf(command));
- }
+ @UriParam(description = "Specifies the query builder.")
+ private InfinispanQueryBuilder queryBuilder;
public InfinispanOperation getOperation() {
return operation;
}
- /**
- * The operation to perform.
- */
public void setOperation(InfinispanOperation operation) {
this.operation = operation;
}
@@ -76,9 +66,6 @@ public abstract class InfinispanConfiguration {
return this.operation != null ? operation : InfinispanOperation.PUT;
}
- /**
- * An implementation specific URI for the CacheManager
- */
public String getConfigurationUri() {
return configurationUri;
}
@@ -91,13 +78,6 @@ public abstract class InfinispanConfiguration {
return resultHeader;
}
- /**
- * Store the operation result in a header instead of the message body. By default, resultHeader == null and the
- * query result is stored in the message body, any existing content in the message body is discarded. If
- * resultHeader is set, the value is used as the name of the header to store the query result and the original
- * message body is preserved. This value can be overridden by an in message header named:
- * CamelInfinispanOperationResultHeader
- */
public void setResultHeader(String resultHeader) {
this.resultHeader = resultHeader;
}
@@ -106,9 +86,6 @@ public abstract class InfinispanConfiguration {
return remappingFunction;
}
- /**
- * Set a specific remappingFunction to use in a compute operation
- */
public void setRemappingFunction(BiFunction remappingFunction) {
this.remappingFunction = remappingFunction;
}
@@ -117,9 +94,6 @@ public abstract class InfinispanConfiguration {
return key;
}
- /**
- * Set a specific key for producer operations
- */
public void setKey(Object key) {
this.key = key;
}
@@ -128,9 +102,6 @@ public abstract class InfinispanConfiguration {
return value;
}
- /**
- * Set a specific value for producer operations
- */
public void setValue(Object value) {
this.value = value;
}
@@ -139,9 +110,6 @@ public abstract class InfinispanConfiguration {
return oldValue;
}
- /**
- * Set a specific old value for some producer operations
- */
public void setOldValue(Object oldValue) {
this.oldValue = oldValue;
}
@@ -150,9 +118,6 @@ public abstract class InfinispanConfiguration {
return defaultValue;
}
- /**
- * Set a specific default value for some producer operations
- */
public void setDefaultValue(Object defaultValue) {
this.defaultValue = defaultValue;
}
@@ -161,9 +126,6 @@ public abstract class InfinispanConfiguration {
return queryBuilder;
}
- /**
- * Specifies the query builder.
- */
public void setQueryBuilder(InfinispanQueryBuilder queryBuilder) {
this.queryBuilder = queryBuilder;
}
@@ -171,5 +133,4 @@ public abstract class InfinispanConfiguration {
public boolean hasQueryBuilder() {
return queryBuilder != null;
}
-
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanOperation.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanOperation.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanOperation.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanOperation.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
rename to components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerTestSupport.java b/components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerTestSupport.java
rename to components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanConsumerTestSupport.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepositoryTestSupport.java b/components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepositoryTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepositoryTestSupport.java
rename to components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepositoryTestSupport.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTestSupport.java b/components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTestSupport.java
similarity index 97%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTestSupport.java
rename to components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTestSupport.java
index c2c4440..5b3460d 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTestSupport.java
+++ b/components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanProducerTestSupport.java
@@ -831,28 +831,6 @@ public interface InfinispanProducerTestSupport {
}
@Test
- default void testDeprecatedUriOption() {
- fluentTemplate()
- .to("direct:put-deprecated-option")
- .withHeader(InfinispanConstants.KEY, COMMAND_KEY)
- .withHeader(InfinispanConstants.VALUE, COMMAND_VALUE)
- .send();
-
- assertEquals(COMMAND_VALUE, getCache().get(COMMAND_KEY));
- }
-
- @Test
- default void testDeprecatedUriCommand() {
- fluentTemplate()
- .to("direct:put-deprecated-command")
- .withHeader(InfinispanConstants.KEY, COMMAND_KEY)
- .withHeader(InfinispanConstants.VALUE, COMMAND_VALUE)
- .send();
-
- assertEquals(COMMAND_VALUE, getCache().get(COMMAND_KEY));
- }
-
- @Test
default void clearAsyncTest() throws Exception {
getCache().put(KEY_ONE, VALUE_ONE);
getCache().put(KEY_TWO, VALUE_TWO);
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanRoutePolicyTestSupport.java b/components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanRoutePolicyTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanRoutePolicyTestSupport.java
rename to components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanRoutePolicyTestSupport.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java b/components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java
similarity index 96%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java
rename to components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java
index 775e357..df4a96f 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java
+++ b/components/camel-infinispan/camel-infinispan-common/src/test/java/org/apache/camel/component/infinispan/InfinispanTestSupport.java
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.TestMethodOrder;
@TestMethodOrder(MethodOrderer.MethodName.class)
public abstract class InfinispanTestSupport extends CamelTestSupport {
- protected static final String TEST_CACHE = "mycache";
+ public static final String TEST_CACHE = "mycache";
protected BasicCache<Object, Object> getCache() {
return getCache(getCacheName());
diff --git a/components/camel-infinispan/camel-infinispan-embedded/pom.xml b/components/camel-infinispan/camel-infinispan-embedded/pom.xml
new file mode 100644
index 0000000..34ed98f
--- /dev/null
+++ b/components/camel-infinispan/camel-infinispan-embedded/pom.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-parent</artifactId>
+ <version>3.8.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-infinispan-embedded</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Infinispan :: Embedded</name>
+ <description>Camel Infinispan Embedded support</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-query</artifactId>
+ <version>${infinispan-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-component-annotations</artifactId>
+ <version>${infinispan-version}</version>
+ </dependency>
+
+ <!-- testing - camel -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-common</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-spring-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- testing - infinispan -->
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-core</artifactId>
+ <version>${infinispan-version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-commons-test</artifactId>
+ <version>${infinispan-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-spring5-embedded</artifactId>
+ <version>${infinispan-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan.protostream</groupId>
+ <artifactId>sample-domain-implementation</artifactId>
+ <version>${protostream-version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- testing - misc -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-log</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>infinispan.test.jgroups.protocol</name>
+ <value>tcp</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java b/components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
similarity index 97%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
index c30640a..14df574 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
@@ -38,7 +38,6 @@ public class InfinispanEmbeddedComponentConfigurer extends PropertyConfigurerSup
case "cacheContainerConfiguration": getOrCreateConfiguration(target).setCacheContainerConfiguration(property(camelContext, org.infinispan.configuration.cache.Configuration.class, value)); return true;
case "clusteredlistener":
case "clusteredListener": getOrCreateConfiguration(target).setClusteredListener(property(camelContext, boolean.class, value)); return true;
- case "command": getOrCreateConfiguration(target).setCommand(property(camelContext, java.lang.String.class, value)); return true;
case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration.class, value)); return true;
case "configurationuri":
case "configurationUri": getOrCreateConfiguration(target).setConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
@@ -85,7 +84,6 @@ public class InfinispanEmbeddedComponentConfigurer extends PropertyConfigurerSup
case "cacheContainerConfiguration": return org.infinispan.configuration.cache.Configuration.class;
case "clusteredlistener":
case "clusteredListener": return boolean.class;
- case "command": return java.lang.String.class;
case "configuration": return org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration.class;
case "configurationuri":
case "configurationUri": return java.lang.String.class;
@@ -128,7 +126,6 @@ public class InfinispanEmbeddedComponentConfigurer extends PropertyConfigurerSup
case "cacheContainerConfiguration": return getOrCreateConfiguration(target).getCacheContainerConfiguration();
case "clusteredlistener":
case "clusteredListener": return getOrCreateConfiguration(target).isClusteredListener();
- case "command": return getOrCreateConfiguration(target).getCommand();
case "configuration": return target.getConfiguration();
case "configurationuri":
case "configurationUri": return getOrCreateConfiguration(target).getConfigurationUri();
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java b/components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
similarity index 97%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
index 3dd246e..08660ec 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
@@ -29,7 +29,6 @@ public class InfinispanEmbeddedEndpointConfigurer extends PropertyConfigurerSupp
case "cacheContainerConfiguration": target.getConfiguration().setCacheContainerConfiguration(property(camelContext, org.infinispan.configuration.cache.Configuration.class, value)); return true;
case "clusteredlistener":
case "clusteredListener": target.getConfiguration().setClusteredListener(property(camelContext, boolean.class, value)); return true;
- case "command": target.getConfiguration().setCommand(property(camelContext, java.lang.String.class, value)); return true;
case "configurationuri":
case "configurationUri": target.getConfiguration().setConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
case "customlistener":
@@ -77,7 +76,6 @@ public class InfinispanEmbeddedEndpointConfigurer extends PropertyConfigurerSupp
case "cacheContainerConfiguration": return org.infinispan.configuration.cache.Configuration.class;
case "clusteredlistener":
case "clusteredListener": return boolean.class;
- case "command": return java.lang.String.class;
case "configurationuri":
case "configurationUri": return java.lang.String.class;
case "customlistener":
@@ -121,7 +119,6 @@ public class InfinispanEmbeddedEndpointConfigurer extends PropertyConfigurerSupp
case "cacheContainerConfiguration": return target.getConfiguration().getCacheContainerConfiguration();
case "clusteredlistener":
case "clusteredListener": return target.getConfiguration().isClusteredListener();
- case "command": return target.getConfiguration().getCommand();
case "configurationuri":
case "configurationUri": return target.getConfiguration().getConfigurationUri();
case "customlistener":
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java b/components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
similarity index 96%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
index a6e5646..d608348 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
@@ -20,7 +20,7 @@ public class InfinispanEmbeddedEndpointUriFactory extends org.apache.camel.suppo
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(22);
+ Set<String> props = new HashSet<>(21);
props.add("customListener");
props.add("defaultValue");
props.add("exchangePattern");
@@ -29,7 +29,6 @@ public class InfinispanEmbeddedEndpointUriFactory extends org.apache.camel.suppo
props.add("cacheContainer");
props.add("resultHeader");
props.add("sync");
- props.add("command");
props.add("configurationUri");
props.add("clusteredListener");
props.add("lazyStartProducer");
diff --git a/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/component.properties
new file mode 100644
index 0000000..8da71fb
--- /dev/null
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/component.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+components=infinispan-embedded
+groupId=org.apache.camel
+artifactId=camel-infinispan-embedded
+version=3.8.0-SNAPSHOT
+projectName=Camel :: Infinispan :: Embedded
+projectDescription=Camel Infinispan Embedded support
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint
diff --git a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
similarity index 95%
rename from components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
rename to components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
index 62c5705..63daf90 100644
--- a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
@@ -10,7 +10,7 @@
"javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponent",
"supportLevel": "Stable",
"groupId": "org.apache.camel",
- "artifactId": "camel-infinispan",
+ "artifactId": "camel-infinispan-embedded",
"version": "3.8.0-SNAPSHOT",
"scheme": "infinispan-embedded",
"extendsScheme": "",
@@ -26,7 +26,6 @@
"queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
"bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
"clusteredListener": { "kind": "property", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
"customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom list [...]
"eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated b [...]
"sync": { "kind": "property", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
@@ -34,14 +33,14 @@
"key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
"lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
"oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
+ "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
"value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
"autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
"cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
"cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The C [...]
"configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
"flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remot [...]
- "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHead [...]
},
"properties": {
@@ -49,7 +48,6 @@
"queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
"bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
"clusteredListener": { "kind": "parameter", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
"customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom lis [...]
"eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated [...]
"sync": { "kind": "parameter", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
@@ -59,13 +57,13 @@
"key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
"lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
"oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
+ "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
"value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
"cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to con [...]
"cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The [...]
"configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
"flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remo [...]
- "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHea [...]
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc b/components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
similarity index 98%
rename from catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
index 1b78ba5..3b2f7f3 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
@@ -1,7 +1,7 @@
[[infinispan-embedded-component]]
= Infinispan Embedded Component
:docTitle: Infinispan Embedded
-:artifactId: camel-infinispan
+:artifactId: camel-infinispan-embedded
:description: Read and write from/to Infinispan distributed key/value store and data grid.
:since: 2.13
:supportLevel: Stable
@@ -36,7 +36,7 @@ If you use Maven, you must add the following dependency to your `pom.xml`:
------------------------------------------------------------
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-infinispan</artifactId>
+ <artifactId>camel-infinispan-embedded</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
@@ -60,7 +60,7 @@ If no cache configuration is provided, embedded cacheContainer is created direct
// component options: START
-The Infinispan Embedded component supports 21 options, which are listed below.
+The Infinispan Embedded component supports 20 options, which are listed below.
@@ -71,7 +71,6 @@ The Infinispan Embedded component supports 21 options, which are listed below.
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
@@ -86,7 +85,7 @@ The Infinispan Embedded component supports 21 options, which are listed below.
| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// component options: END
@@ -113,7 +112,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (21 parameters):
+=== Query Parameters (20 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -122,7 +121,6 @@ with the following path and query parameters:
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
@@ -138,7 +136,7 @@ with the following path and query parameters:
| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
similarity index 93%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
index 45cd27c..36b0840 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.infinispan.embedded;
import java.util.function.Supplier;
import org.apache.camel.component.infinispan.InfinispanAggregationRepository;
-import org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository;
import org.apache.camel.support.DefaultExchangeHolder;
import org.apache.camel.support.service.ServiceHelper;
import org.apache.camel.util.ObjectHelper;
@@ -33,7 +32,7 @@ public class InfinispanEmbeddedAggregationRepository extends InfinispanAggregati
private InfinispanEmbeddedManager manager;
/**
- * Creates new {@link InfinispanRemoteAggregationRepository} that defaults to non-optimistic locking with
+ * Creates new {@link InfinispanEmbeddedAggregationRepository} that defaults to non-optimistic locking with
* recoverable behavior and a local Infinispan cache.
*
* @param cacheName cache name
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
similarity index 94%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
index 1efe3b0..8d992bb 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
@@ -21,7 +21,6 @@ import org.apache.camel.component.infinispan.InfinispanConfiguration;
import org.apache.camel.component.infinispan.InfinispanConstants;
import org.apache.camel.component.infinispan.InfinispanQueryBuilder;
import org.apache.camel.component.infinispan.InfinispanUtil;
-import org.apache.camel.component.infinispan.remote.InfinispanRemoteManager;
import org.infinispan.Cache;
import org.infinispan.context.Flag;
import org.infinispan.query.Search;
@@ -32,7 +31,7 @@ public final class InfinispanEmbeddedUtil extends InfinispanUtil {
}
@SuppressWarnings("unchecked")
- public static <K, V> Cache<K, V> getCacheWithFlags(InfinispanRemoteManager manager, String cacheName, Flag... flags) {
+ public static <K, V> Cache<K, V> getCacheWithFlags(InfinispanEmbeddedManager manager, String cacheName, Flag... flags) {
final Cache<K, V> cache = manager.getCache(cacheName, Cache.class);
return flags == null || flags.length == 0 ? cache : cache.getAdvancedCache().withFlags(flags);
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryOperationsTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryOperationsTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryOperationsTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryOperationsTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepositoryTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredConsumerTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredConsumerTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredConsumerTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredConsumerTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredTestSupport.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredTestSupport.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedClusteredTestSupport.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfigurationTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfigurationTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfigurationTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfigurationTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumerTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumerTest.java
similarity index 87%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumerTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumerTest.java
index 5e25990..755eb62 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumerTest.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumerTest.java
@@ -37,20 +37,20 @@ public class InfinispanEmbeddedConsumerTest extends InfinispanEmbeddedTestSuppor
mock.message(0).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_CREATED");
mock.message(0).header(InfinispanConstants.IS_PRE).isEqualTo(true);
mock.message(0).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(0).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(0).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
mock.message(1).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_CREATED");
mock.message(1).header(InfinispanConstants.IS_PRE).isEqualTo(false);
mock.message(1).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(1).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(1).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
- getCache().put(KEY_ONE, VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
mock.assertIsSatisfied();
}
@Test
public void consumerReceivedPreAndPostEntryRemoveEventNotifications() throws Exception {
- getCache().put(KEY_ONE, VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
MockEndpoint mock = getMockEndpoint("mock:removed");
mock.expectedMessageCount(2);
@@ -58,21 +58,21 @@ public class InfinispanEmbeddedConsumerTest extends InfinispanEmbeddedTestSuppor
mock.message(0).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_REMOVED");
mock.message(0).header(InfinispanConstants.IS_PRE).isEqualTo(true);
mock.message(0).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(0).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(0).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
mock.message(1).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_REMOVED");
mock.message(1).header(InfinispanConstants.IS_PRE).isEqualTo(false);
mock.message(1).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(1).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(1).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
- getCache().remove(KEY_ONE);
+ getCache().remove(InfinispanConsumerTestSupport.KEY_ONE);
mock.assertIsSatisfied();
}
@Test
public void consumerReceivedPreAndPostEntryUpdateEventNotifications() throws Exception {
- getCache().put(KEY_ONE, VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
MockEndpoint mock = getMockEndpoint("mock:modified");
mock.expectedMessageCount(2);
@@ -80,21 +80,21 @@ public class InfinispanEmbeddedConsumerTest extends InfinispanEmbeddedTestSuppor
mock.message(0).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_MODIFIED");
mock.message(0).header(InfinispanConstants.IS_PRE).isEqualTo(true);
mock.message(0).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(0).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(0).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
mock.message(1).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_MODIFIED");
mock.message(1).header(InfinispanConstants.IS_PRE).isEqualTo(false);
mock.message(1).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(1).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(1).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
- getCache().replace(KEY_ONE, VALUE_TWO);
+ getCache().replace(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_TWO);
mock.assertIsSatisfied();
}
@Test
public void consumerReceivedPreAndPostEntryVisitedEventNotifications() throws Exception {
- getCache().put(KEY_ONE, VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
MockEndpoint mock = getMockEndpoint("mock:visited");
mock.expectedMessageCount(2);
@@ -102,14 +102,14 @@ public class InfinispanEmbeddedConsumerTest extends InfinispanEmbeddedTestSuppor
mock.message(0).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_VISITED");
mock.message(0).header(InfinispanConstants.IS_PRE).isEqualTo(true);
mock.message(0).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(0).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(0).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
mock.message(1).header(InfinispanConstants.EVENT_TYPE).isEqualTo("CACHE_ENTRY_VISITED");
mock.message(1).header(InfinispanConstants.IS_PRE).isEqualTo(false);
mock.message(1).header(InfinispanConstants.CACHE_NAME).isNotNull();
- mock.message(1).header(InfinispanConstants.KEY).isEqualTo(KEY_ONE);
+ mock.message(1).header(InfinispanConstants.KEY).isEqualTo(InfinispanConsumerTestSupport.KEY_ONE);
- getCache().get(KEY_ONE);
+ getCache().get(InfinispanConsumerTestSupport.KEY_ONE);
mock.assertIsSatisfied();
}
@@ -139,7 +139,7 @@ public class InfinispanEmbeddedConsumerTest extends InfinispanEmbeddedTestSuppor
MockEndpoint mock = getMockEndpoint("mock:sync");
mock.expectedMessageCount(2);
- getCache().put(KEY_ONE, VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
mock.assertIsSatisfied();
}
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListenerTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListenerTest.java
similarity index 97%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListenerTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListenerTest.java
index ee0e297..12f4241 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListenerTest.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListenerTest.java
@@ -38,7 +38,7 @@ public class InfinispanEmbeddedCustomListenerTest extends InfinispanEmbeddedTest
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(2);
- getCache().put(KEY_ONE, VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
mock.message(0).header(InfinispanConstants.IS_PRE).isEqualTo(true);
mock.message(0).header(InfinispanConstants.KEY).isEqualTo("newKey");
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepositoryTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepositoryTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepositoryTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepositoryTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
similarity index 84%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
index 88c9466..46a4a1c 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducerTest.java
@@ -43,21 +43,21 @@ public class InfinispanEmbeddedProducerTest extends InfinispanEmbeddedTestSuppor
fluentTemplate()
.to("direct:start")
- .withHeader(InfinispanConstants.KEY, KEY_ONE)
- .withHeader(InfinispanConstants.VALUE, VALUE_ONE)
+ .withHeader(InfinispanConstants.KEY, InfinispanProducerTestSupport.KEY_ONE)
+ .withHeader(InfinispanConstants.VALUE, InfinispanProducerTestSupport.VALUE_ONE)
.withHeader(InfinispanConstants.OPERATION, InfinispanOperation.PUT)
.send();
- assertEquals(VALUE_ONE, getCache().get(KEY_ONE));
+ assertEquals(InfinispanProducerTestSupport.VALUE_ONE, getCache().get(InfinispanProducerTestSupport.KEY_ONE));
fluentTemplate()
.to("direct:start")
- .withHeader(InfinispanConstants.KEY, KEY_TWO)
- .withHeader(InfinispanConstants.VALUE, VALUE_TWO)
+ .withHeader(InfinispanConstants.KEY, InfinispanProducerTestSupport.KEY_TWO)
+ .withHeader(InfinispanConstants.VALUE, InfinispanProducerTestSupport.VALUE_TWO)
.withHeader(InfinispanConstants.OPERATION, InfinispanOperation.PUT)
.send();
- assertEquals(VALUE_TWO, getCache().get(KEY_TWO));
+ assertEquals(InfinispanProducerTestSupport.VALUE_TWO, getCache().get(InfinispanProducerTestSupport.KEY_TWO));
assertEquals(
2L,
@@ -95,10 +95,6 @@ public class InfinispanEmbeddedProducerTest extends InfinispanEmbeddedTestSuppor
public void configure() {
from("direct:start")
.toF("infinispan-embedded:%s", getCacheName());
- from("direct:put-deprecated-option")
- .toF("infinispan-embedded:%s?command=PUT", getCacheName());
- from("direct:put-deprecated-command")
- .toF("infinispan-embedded:%s?command=CamelInfinispanOperationPut", getCacheName());
from("direct:compute")
.toF("infinispan-embedded:%s?remappingFunction=#mappingFunction", getCacheName());
from("direct:explicitput")
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryConsumerTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryConsumerTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryConsumerTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryConsumerTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryProducerTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryProducerTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryProducerTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryProducerTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryTestSupport.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryTestSupport.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedQueryTestSupport.java
diff --git a/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicyTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicyTest.java
new file mode 100644
index 0000000..9c02b7a
--- /dev/null
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicyTest.java
@@ -0,0 +1,98 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.infinispan.InfinispanRoutePolicy;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.infinispan.commons.api.CacheContainerAdmin;
+import org.infinispan.configuration.cache.CacheMode;
+import org.infinispan.configuration.cache.ConfigurationBuilder;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.junit.jupiter.api.Test;
+
+import static org.awaitility.Awaitility.await;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class InfinispanEmbeddedRoutePolicyTest {
+ public static final String CACHE_NAME = "_route_policy";
+
+ @Test
+ public void testLeadership() throws Exception {
+ try (EmbeddedCacheManager cacheContainer = createCacheContainer()) {
+
+ cacheContainer.start();
+
+ final InfinispanRoutePolicy policy1 = createRoutePolicy(cacheContainer, "route1");
+ final InfinispanRoutePolicy policy2 = createRoutePolicy(cacheContainer, "route2");
+
+ try (CamelContext context = new DefaultCamelContext()) {
+ context.start();
+
+ RouteBuilder.addRoutes(context, b -> b.from("direct:r1").routePolicy(policy1).to("mock:p1"));
+
+ await().atMost(10, TimeUnit.SECONDS).until(policy1::isLeader);
+
+ RouteBuilder.addRoutes(context, b -> b.from("direct:r2").routePolicy(policy2).to("mock:p2"));
+
+ assertTrue(policy1.isLeader());
+ assertFalse(policy2.isLeader());
+
+ policy1.shutdown();
+
+ await().atMost(10, TimeUnit.SECONDS).until(policy2::isLeader);
+
+ assertFalse(policy1.isLeader());
+ assertTrue(policy2.isLeader());
+ }
+ }
+ }
+
+ // *****************************
+ //
+ // *****************************
+
+ private static EmbeddedCacheManager createCacheContainer() {
+ DefaultCacheManager cacheContainer = new DefaultCacheManager();
+ cacheContainer.administration()
+ .withFlags(CacheContainerAdmin.AdminFlag.VOLATILE)
+ .getOrCreateCache(
+ CACHE_NAME,
+ new ConfigurationBuilder()
+ .clustering().cacheMode(CacheMode.LOCAL)
+ .build());
+
+ return cacheContainer;
+ }
+
+ private static InfinispanRoutePolicy createRoutePolicy(EmbeddedCacheManager cacheContainer, String lockValue) {
+ InfinispanEmbeddedConfiguration configuration = new InfinispanEmbeddedConfiguration();
+ configuration.setCacheContainer(cacheContainer);
+
+ InfinispanEmbeddedRoutePolicy policy = new InfinispanEmbeddedRoutePolicy(configuration);
+ policy.setLockMapName(CACHE_NAME);
+ policy.setLockKey("lock-key");
+ policy.setLockValue(lockValue);
+
+ return policy;
+ }
+}
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
similarity index 98%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
index 29a9a8d..e887c9c 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
+++ b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedTestSupport.java
@@ -42,7 +42,7 @@ public class InfinispanEmbeddedTestSupport extends InfinispanTestSupport {
cacheContainer.administration()
.withFlags(CacheContainerAdmin.AdminFlag.VOLATILE)
.getOrCreateCache(
- TEST_CACHE,
+ InfinispanTestSupport.TEST_CACHE,
getConfiguration().build());
super.setupResources();
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryTestSupport.java b/components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryTestSupport.java
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/java/org/apache/camel/component/infinispan/embedded/spring/SpringInfinispanEmbeddedIdempotentRepositoryTestSupport.java
diff --git a/components/camel-infinispan/src/test/resources/log4j2.properties b/components/camel-infinispan/camel-infinispan-embedded/src/test/resources/log4j2.properties
similarity index 100%
copy from components/camel-infinispan/src/test/resources/log4j2.properties
copy to components/camel-infinispan/camel-infinispan-embedded/src/test/resources/log4j2.properties
diff --git a/components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.xml b/components/camel-infinispan/camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.xml
similarity index 100%
rename from components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.xml
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryCamelTest.xml
diff --git a/components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryConfiguration.xml b/components/camel-infinispan/camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryConfiguration.xml
similarity index 100%
rename from components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryConfiguration.xml
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositoryConfiguration.xml
diff --git a/components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.xml b/components/camel-infinispan/camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.xml
similarity index 100%
rename from components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.xml
rename to components/camel-infinispan/camel-infinispan-embedded/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanEmbeddedIdempotentRepositorySpringTest.xml
diff --git a/components/camel-infinispan/pom.xml b/components/camel-infinispan/camel-infinispan/pom.xml
similarity index 84%
copy from components/camel-infinispan/pom.xml
copy to components/camel-infinispan/camel-infinispan/pom.xml
index 564d9fa..7db9c45 100644
--- a/components/camel-infinispan/pom.xml
+++ b/components/camel-infinispan/camel-infinispan/pom.xml
@@ -23,18 +23,14 @@
<parent>
<groupId>org.apache.camel</groupId>
- <artifactId>components</artifactId>
+ <artifactId>camel-infinispan-parent</artifactId>
<version>3.8.0-SNAPSHOT</version>
</parent>
<artifactId>camel-infinispan</artifactId>
<packaging>jar</packaging>
- <name>Camel :: Infinispan</name>
- <description>Camel Infinispan support</description>
-
- <properties>
- <protostream-version>4.3.0.Final</protostream-version>
- </properties>
+ <name>Camel :: Infinispan :: Remote</name>
+ <description>Camel Infinispan Remote support</description>
<dependencies>
<dependency>
@@ -42,14 +38,8 @@
<artifactId>camel-support</artifactId>
</dependency>
<dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-core</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-query-dsl</artifactId>
- <version>${infinispan-version}</version>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-common</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
@@ -58,16 +48,6 @@
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
- <artifactId>infinispan-component-annotations</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-query</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
<version>${infinispan-version}</version>
</dependency>
@@ -82,34 +62,51 @@
<version>${infinispan-version}</version>
</dependency>
- <!-- testing -->
+ <!-- testing - camel -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-core</artifactId>
- <version>${infinispan-version}</version>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-common</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-common</artifactId>
+ <version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-infinispan</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- testing - infinispan -->
+ <dependency>
<groupId>org.infinispan</groupId>
- <artifactId>infinispan-commons-test</artifactId>
+ <artifactId>infinispan-core</artifactId>
<version>${infinispan-version}</version>
+ <type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
- <artifactId>infinispan-spring5-remote</artifactId>
+ <artifactId>infinispan-commons-test</artifactId>
<version>${infinispan-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
- <artifactId>infinispan-spring5-embedded</artifactId>
+ <artifactId>infinispan-spring5-remote</artifactId>
<version>${infinispan-version}</version>
<scope>test</scope>
</dependency>
@@ -125,6 +122,8 @@
<version>${protostream-version}</version>
<scope>test</scope>
</dependency>
+
+ <!-- testing - misc -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
@@ -146,22 +145,6 @@
<scope>test</scope>
</dependency>
- <!-- test infra -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-infra-common</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-infra-infinispan</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
</dependencies>
<profiles>
@@ -176,12 +159,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
- <systemProperties>
- <property>
- <name>infinispan.test.jgroups.protocol</name>
- <value>tcp</value>
- </property>
- </systemProperties>
</configuration>
</plugin>
</plugins>
@@ -201,6 +178,8 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <forkCount>1</forkCount>
+ <reuseForks>false</reuseForks>
<skipTests>${skipTests}</skipTests>
<systemPropertyVariables>
<visibleassertions.silence>true</visibleassertions.silence>
@@ -230,6 +209,8 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <forkCount>1</forkCount>
+ <reuseForks>false</reuseForks>
<skipTests>${skipTests}</skipTests>
<systemPropertyVariables>
<visibleassertions.silence>true</visibleassertions.silence>
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java b/components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
similarity index 97%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
rename to components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
index 13da027..d50b428 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
+++ b/components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
@@ -36,7 +36,6 @@ public class InfinispanRemoteComponentConfigurer extends PropertyConfigurerSuppo
case "cacheContainer": getOrCreateConfiguration(target).setCacheContainer(property(camelContext, org.infinispan.client.hotrod.RemoteCacheManager.class, value)); return true;
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": getOrCreateConfiguration(target).setCacheContainerConfiguration(property(camelContext, org.infinispan.client.hotrod.configuration.Configuration.class, value)); return true;
- case "command": getOrCreateConfiguration(target).setCommand(property(camelContext, java.lang.String.class, value)); return true;
case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration.class, value)); return true;
case "configurationproperties":
case "configurationProperties": getOrCreateConfiguration(target).setConfigurationProperties(property(camelContext, java.util.Map.class, value)); return true;
@@ -92,7 +91,6 @@ public class InfinispanRemoteComponentConfigurer extends PropertyConfigurerSuppo
case "cacheContainer": return org.infinispan.client.hotrod.RemoteCacheManager.class;
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": return org.infinispan.client.hotrod.configuration.Configuration.class;
- case "command": return java.lang.String.class;
case "configuration": return org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration.class;
case "configurationproperties":
case "configurationProperties": return java.util.Map.class;
@@ -144,7 +142,6 @@ public class InfinispanRemoteComponentConfigurer extends PropertyConfigurerSuppo
case "cacheContainer": return getOrCreateConfiguration(target).getCacheContainer();
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": return getOrCreateConfiguration(target).getCacheContainerConfiguration();
- case "command": return getOrCreateConfiguration(target).getCommand();
case "configuration": return target.getConfiguration();
case "configurationproperties":
case "configurationProperties": return getOrCreateConfiguration(target).getConfigurationProperties();
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java b/components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
similarity index 97%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
rename to components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
index 46f2c08..a2567f7 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
+++ b/components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
@@ -27,7 +27,6 @@ public class InfinispanRemoteEndpointConfigurer extends PropertyConfigurerSuppor
case "cacheContainer": target.getConfiguration().setCacheContainer(property(camelContext, org.infinispan.client.hotrod.RemoteCacheManager.class, value)); return true;
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": target.getConfiguration().setCacheContainerConfiguration(property(camelContext, org.infinispan.client.hotrod.configuration.Configuration.class, value)); return true;
- case "command": target.getConfiguration().setCommand(property(camelContext, java.lang.String.class, value)); return true;
case "configurationproperties":
case "configurationProperties": target.getConfiguration().setConfigurationProperties(property(camelContext, java.util.Map.class, value)); return true;
case "configurationuri":
@@ -84,7 +83,6 @@ public class InfinispanRemoteEndpointConfigurer extends PropertyConfigurerSuppor
case "cacheContainer": return org.infinispan.client.hotrod.RemoteCacheManager.class;
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": return org.infinispan.client.hotrod.configuration.Configuration.class;
- case "command": return java.lang.String.class;
case "configurationproperties":
case "configurationProperties": return java.util.Map.class;
case "configurationuri":
@@ -137,7 +135,6 @@ public class InfinispanRemoteEndpointConfigurer extends PropertyConfigurerSuppor
case "cacheContainer": return target.getConfiguration().getCacheContainer();
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": return target.getConfiguration().getCacheContainerConfiguration();
- case "command": return target.getConfiguration().getCommand();
case "configurationproperties":
case "configurationProperties": return target.getConfiguration().getConfigurationProperties();
case "configurationuri":
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java b/components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
similarity index 97%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
rename to components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
index 05fff13..42abdc9 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
+++ b/components/camel-infinispan/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
@@ -20,7 +20,7 @@ public class InfinispanRemoteEndpointUriFactory extends org.apache.camel.support
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(28);
+ Set<String> props = new HashSet<>(27);
props.add("defaultValue");
props.add("flags");
props.add("secure");
@@ -41,7 +41,6 @@ public class InfinispanRemoteEndpointUriFactory extends org.apache.camel.support
props.add("saslMechanism");
props.add("eventTypes");
props.add("cacheContainer");
- props.add("command");
props.add("lazyStartProducer");
props.add("remappingFunction");
props.add("cacheContainerConfiguration");
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
similarity index 53%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
rename to components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
index 93f4fdf..c9b3b40 100644
--- a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
+++ b/components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
@@ -1,7 +1,7 @@
# Generated by camel build tools - do NOT edit this file!
-components=infinispan infinispan-embedded
+components=infinispan
groupId=org.apache.camel
artifactId=camel-infinispan
version=3.8.0-SNAPSHOT
-projectName=Camel :: Infinispan
-projectDescription=Camel Infinispan support
+projectName=Camel :: Infinispan :: Remote
+projectDescription=Camel Infinispan Remote support
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan b/components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
rename to components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component b/components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
rename to components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint b/components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
rename to components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint b/components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
similarity index 100%
rename from components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
rename to components/camel-infinispan/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
diff --git a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json b/components/camel-infinispan/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
similarity index 96%
rename from components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
rename to components/camel-infinispan/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
index 6950d79..3a299ce 100644
--- a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
+++ b/components/camel-infinispan/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
@@ -27,14 +27,13 @@
"queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
"secure": { "kind": "property", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
"bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
- "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
"customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in [...]
"eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated by co [...]
"defaultValue": { "kind": "property", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
"key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
"lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
"oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
+ "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
"value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
"password": { "kind": "property", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
"saslMechanism": { "kind": "property", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
@@ -47,7 +46,7 @@
"configurationProperties": { "kind": "property", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for [...]
"configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
"flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote ca [...]
- "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader = [...]
},
"properties": {
@@ -56,7 +55,6 @@
"queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
"secure": { "kind": "parameter", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
"bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
- "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
"customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in [...]
"eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated by c [...]
"exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
@@ -65,7 +63,7 @@
"key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
"lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
"oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
+ "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
"value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
"password": { "kind": "parameter", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
"saslMechanism": { "kind": "parameter", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
@@ -77,7 +75,7 @@
"configurationProperties": { "kind": "parameter", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for [...]
"configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
"flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote c [...]
- "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation." },
"resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader [...]
}
}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc b/components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
similarity index 89%
rename from catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
rename to components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
index 440016f..0ba396c 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
+++ b/components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
@@ -42,23 +42,20 @@ The producer allows sending messages to a remote cache using the HotRod protocol
The consumer allows listening for events from a remote cache using the HotRod protocol.
// component options: START
-The Infinispan component supports 29 options, which are listed below.
+The Infinispan component supports 26 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *configuration* (common) | Component configuration | | InfinispanConfiguration
+| *configuration* (common) | Component configuration | | InfinispanRemoteConfiguration
| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanRemoteCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER | | String
| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
| *key* (producer) | Set a specific key for producer operations | | Object
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
@@ -71,13 +68,13 @@ The Infinispan component supports 29 options, which are listed below.
| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
| *username* ( security) | Define the username to access the infinispan instance | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// component options: END
@@ -103,7 +100,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (29 parameters):
+=== Query Parameters (26 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -113,11 +110,8 @@ with the following path and query parameters:
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanRemoteCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER | | String
| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
@@ -131,13 +125,13 @@ with the following path and query parameters:
| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
| *username* ( security) | Define the username to access the infinispan instance | | String
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducer.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducer.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducer.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducer.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicy.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicy.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicy.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicy.java
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteUtil.java b/components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteUtil.java
similarity index 100%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteUtil.java
rename to components/camel-infinispan/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteUtil.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryOperationsTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryOperationsTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryOperationsTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryOperationsTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepositoryTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfigurationTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfigurationTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfigurationTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfigurationTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumerTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumerTest.java
similarity index 92%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumerTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumerTest.java
index a949918..8e12f47 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumerTest.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumerTest.java
@@ -31,8 +31,8 @@ public class InfinispanRemoteConsumerTest extends InfinispanRemoteTestSupport im
mock.expectedMessageCount(1);
mock.expectedHeaderReceived(InfinispanConstants.EVENT_TYPE, "CLIENT_CACHE_ENTRY_CREATED");
- getCache().put(KEY_ONE, VALUE_ONE);
- getCache().put(KEY_ONE, VALUE_TWO);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_TWO);
mock.assertIsSatisfied();
}
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListenerTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListenerTest.java
similarity index 94%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListenerTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListenerTest.java
index fe79d56..169c0b0 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListenerTest.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListenerTest.java
@@ -35,8 +35,8 @@ public class InfinispanRemoteCustomListenerTest extends InfinispanRemoteTestSupp
mock.expectedMessageCount(1);
mock.expectedHeaderReceived(InfinispanConstants.EVENT_TYPE, "CLIENT_CACHE_ENTRY_CREATED");
- getCache().put(KEY_ONE, VALUE_ONE);
- getCache().put(KEY_ONE, VALUE_TWO);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_ONE);
+ getCache().put(InfinispanConsumerTestSupport.KEY_ONE, InfinispanConsumerTestSupport.VALUE_TWO);
mock.assertIsSatisfied();
}
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepositoryTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepositoryTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepositoryTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepositoryTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
similarity index 84%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
index a7d47c3..e0ac1eb 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
@@ -41,21 +41,21 @@ public class InfinispanRemoteProducerTest extends InfinispanRemoteTestSupport im
public void statsOperation() {
fluentTemplate()
.to("direct:start")
- .withHeader(InfinispanConstants.KEY, KEY_ONE)
- .withHeader(InfinispanConstants.VALUE, VALUE_ONE)
+ .withHeader(InfinispanConstants.KEY, InfinispanProducerTestSupport.KEY_ONE)
+ .withHeader(InfinispanConstants.VALUE, InfinispanProducerTestSupport.VALUE_ONE)
.withHeader(InfinispanConstants.OPERATION, InfinispanOperation.PUT)
.send();
- assertEquals(VALUE_ONE, getCache().get(KEY_ONE));
+ assertEquals(InfinispanProducerTestSupport.VALUE_ONE, getCache().get(InfinispanProducerTestSupport.KEY_ONE));
fluentTemplate()
.to("direct:start")
- .withHeader(InfinispanConstants.KEY, KEY_TWO)
- .withHeader(InfinispanConstants.VALUE, VALUE_TWO)
+ .withHeader(InfinispanConstants.KEY, InfinispanProducerTestSupport.KEY_TWO)
+ .withHeader(InfinispanConstants.VALUE, InfinispanProducerTestSupport.VALUE_TWO)
.withHeader(InfinispanConstants.OPERATION, InfinispanOperation.PUT)
.send();
- assertEquals(VALUE_TWO, getCache().get(KEY_TWO));
+ assertEquals(InfinispanProducerTestSupport.VALUE_TWO, getCache().get(InfinispanProducerTestSupport.KEY_TWO));
assertEquals(
2,
@@ -93,10 +93,6 @@ public class InfinispanRemoteProducerTest extends InfinispanRemoteTestSupport im
public void configure() {
from("direct:start")
.toF("infinispan:%s", getCacheName());
- from("direct:put-deprecated-option")
- .toF("infinispan:%s?command=PUT", getCacheName());
- from("direct:put-deprecated-command")
- .toF("infinispan:%s?command=CamelInfinispanOperationPut", getCacheName());
from("direct:compute")
.toF("infinispan:%s?remappingFunction=#mappingFunction", getCacheName());
from("direct:explicitput")
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryConsumerTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryConsumerTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryConsumerTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryConsumerTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryProducerTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryProducerTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryProducerTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryProducerTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java
diff --git a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicyTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicyTest.java
new file mode 100644
index 0000000..f09887d
--- /dev/null
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicyTest.java
@@ -0,0 +1,124 @@
+/*
+ * 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.component.infinispan.remote;
+
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.infinispan.InfinispanRoutePolicy;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.test.infra.infinispan.services.InfinispanService;
+import org.apache.camel.test.infra.infinispan.services.InfinispanServiceFactory;
+import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
+import org.infinispan.configuration.cache.CacheMode;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import static org.awaitility.Awaitility.await;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class InfinispanRemoteRoutePolicyTest {
+ public static final String CACHE_NAME = "_route_policy";
+
+ @RegisterExtension
+ public static InfinispanService service = InfinispanServiceFactory.createService();
+
+ @Test
+ public void testLeadership() throws Exception {
+ try (RemoteCacheManager cacheContainer = createCacheContainer(service)) {
+
+ cacheContainer.start();
+
+ final InfinispanRoutePolicy policy1 = createRoutePolicy(cacheContainer, "route1");
+ final InfinispanRoutePolicy policy2 = createRoutePolicy(cacheContainer, "route2");
+
+ try (CamelContext context = new DefaultCamelContext()) {
+ context.start();
+
+ RouteBuilder.addRoutes(context, b -> b.from("direct:r1").routePolicy(policy1).to("mock:p1"));
+
+ await().atMost(10, TimeUnit.SECONDS).until(policy1::isLeader);
+
+ RouteBuilder.addRoutes(context, b -> b.from("direct:r2").routePolicy(policy2).to("mock:p2"));
+
+ assertTrue(policy1.isLeader());
+ assertFalse(policy2.isLeader());
+
+ policy1.shutdown();
+
+ await().atMost(10, TimeUnit.SECONDS).until(policy2::isLeader);
+
+ assertFalse(policy1.isLeader());
+ assertTrue(policy2.isLeader());
+ }
+ }
+ }
+
+ // *****************************
+ //
+ // *****************************
+
+ private static RemoteCacheManager createCacheContainer(InfinispanService service) {
+ ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
+
+ // for default tests, we force return value for all the
+ // operations
+ clientBuilder
+ .forceReturnValues(true);
+
+ // add server from the test infra service
+ clientBuilder
+ .addServer()
+ .host(service.host())
+ .port(service.port());
+
+ // add security info
+ clientBuilder
+ .security()
+ .authentication()
+ .username(service.username())
+ .password(service.password())
+ .serverName("infinispan")
+ .saslMechanism("DIGEST-MD5")
+ .realm("default");
+
+ RemoteCacheManager cacheContainer = new RemoteCacheManager(clientBuilder.build());
+ cacheContainer.administration()
+ .getOrCreateCache(
+ CACHE_NAME,
+ new org.infinispan.configuration.cache.ConfigurationBuilder()
+ .clustering()
+ .cacheMode(CacheMode.DIST_SYNC).build());
+
+ return cacheContainer;
+ }
+
+ private static InfinispanRoutePolicy createRoutePolicy(RemoteCacheManager cacheContainer, String lockValue) {
+ InfinispanRemoteConfiguration configuration = new InfinispanRemoteConfiguration();
+ configuration.setCacheContainer(cacheContainer);
+
+ InfinispanRemoteRoutePolicy policy = new InfinispanRemoteRoutePolicy(configuration);
+ policy.setLockMapName(CACHE_NAME);
+ policy.setLockKey("lock-key");
+ policy.setLockValue(lockValue);
+
+ return policy;
+ }
+}
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
similarity index 98%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
index 33b9216..75fc85b 100644
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
@@ -44,7 +44,7 @@ public class InfinispanRemoteTestSupport extends InfinispanTestSupport {
cacheContainer = new RemoteCacheManager(getConfiguration().build());
cacheContainer.administration()
.getOrCreateCache(
- TEST_CACHE,
+ InfinispanTestSupport.TEST_CACHE,
new org.infinispan.configuration.cache.ConfigurationBuilder()
.clustering()
.cacheMode(CacheMode.DIST_SYNC).build());
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java
similarity index 100%
rename from components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java
rename to components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java
diff --git a/components/camel-infinispan/src/test/resources/infinispan/client.properties b/components/camel-infinispan/camel-infinispan/src/test/resources/infinispan/client.properties
similarity index 100%
rename from components/camel-infinispan/src/test/resources/infinispan/client.properties
rename to components/camel-infinispan/camel-infinispan/src/test/resources/infinispan/client.properties
diff --git a/components/camel-infinispan/src/test/resources/log4j2.properties b/components/camel-infinispan/camel-infinispan/src/test/resources/log4j2.properties
similarity index 95%
rename from components/camel-infinispan/src/test/resources/log4j2.properties
rename to components/camel-infinispan/camel-infinispan/src/test/resources/log4j2.properties
index 1301f96..3847970 100644
--- a/components/camel-infinispan/src/test/resources/log4j2.properties
+++ b/components/camel-infinispan/camel-infinispan/src/test/resources/log4j2.properties
@@ -36,9 +36,9 @@ logger.infinispan-camel-remote.name = org.apache.camel.component.infinispan.remo
logger.infinispan-camel-remote.level = INFO
logger.infinispan-camel-embedded.name = org.apache.camel.component.infinispan.embedded
logger.infinispan-test-infra-container.name = container.infinispan
-logger.infinispan-test-infra-container.level = INFO
+logger.infinispan-test-infra-container.level = WARN
logger.infinispan-camel-test.name = org.apache.camel.test.junit5
-logger.infinispan-camel-test.level = WARN
+logger.infinispan-camel-test.level = INFO
logger.infinispan.name = org.infinispan
logger.infinispan.level = INFO
diff --git a/components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.xml b/components/camel-infinispan/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.xml
similarity index 100%
rename from components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.xml
rename to components/camel-infinispan/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.xml
diff --git a/components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.xml b/components/camel-infinispan/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.xml
similarity index 100%
rename from components/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.xml
rename to components/camel-infinispan/camel-infinispan/src/test/resources/org/apache/camel/component/infinispan/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.xml
diff --git a/components/camel-infinispan/pom.xml b/components/camel-infinispan/pom.xml
index 564d9fa..c7bafca 100644
--- a/components/camel-infinispan/pom.xml
+++ b/components/camel-infinispan/pom.xml
@@ -27,223 +27,19 @@
<version>3.8.0-SNAPSHOT</version>
</parent>
- <artifactId>camel-infinispan</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Infinispan</name>
- <description>Camel Infinispan support</description>
+ <artifactId>camel-infinispan-parent</artifactId>
+ <packaging>pom</packaging>
+ <name>Camel :: Infinispan :: Parent</name>
+ <description>Camel Infinispan parent</description>
<properties>
- <protostream-version>4.3.0.Final</protostream-version>
+ <protostream-version>4.3.0.Final</protostream-version>
</properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-core</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-query-dsl</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-client-hotrod</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-component-annotations</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-query</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-remote-query-client</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-marshaller-protostuff</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-jboss-marshalling</artifactId>
- <version>${infinispan-version}</version>
- </dependency>
+ <modules>
+ <module>camel-infinispan-common</module>
+ <module>camel-infinispan-embedded</module>
+ <module>camel-infinispan</module>
+ </modules>
- <!-- testing -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-spring-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-core</artifactId>
- <version>${infinispan-version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-commons-test</artifactId>
- <version>${infinispan-version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-spring5-remote</artifactId>
- <version>${infinispan-version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-spring5-embedded</artifactId>
- <version>${infinispan-version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.infinispan.protostream</groupId>
- <artifactId>sample-domain-definition</artifactId>
- <version>${protostream-version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.infinispan.protostream</groupId>
- <artifactId>sample-domain-implementation</artifactId>
- <version>${protostream-version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-log</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- test infra -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-infra-common</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-infra-infinispan</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>infinispan-skip-tests</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- <systemProperties>
- <property>
- <name>infinispan.test.jgroups.protocol</name>
- <value>tcp</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- activate test if the docker socket file is accessible -->
- <profile>
- <id>infinispan-tests-docker-file</id>
- <activation>
- <file>
- <exists>/var/run/docker.sock</exists>
- </file>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>${skipTests}</skipTests>
- <systemPropertyVariables>
- <visibleassertions.silence>true</visibleassertions.silence>
- </systemPropertyVariables>
- <systemProperties>
- <property>
- <name>infinispan.test.jgroups.protocol</name>
- <value>tcp</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- activate test if the DOCKER_HOST env var is set -->
- <profile>
- <id>infinispan-tests-docker-env</id>
- <activation>
- <property>
- <name>env.DOCKER_HOST</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>${skipTests}</skipTests>
- <systemPropertyVariables>
- <visibleassertions.silence>true</visibleassertions.silence>
- </systemPropertyVariables>
- <systemProperties>
- <property>
- <name>infinispan.test.jgroups.protocol</name>
- <value>tcp</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
diff --git a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/infinispan.json b/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/infinispan.json
deleted file mode 100644
index 5b48148..0000000
--- a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/infinispan.json
+++ /dev/null
@@ -1,87 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "infinispan",
- "title": "Infinispan",
- "description": "Read and write from\/to Infinispan distributed key\/value store and data grid.",
- "deprecated": false,
- "firstVersion": "2.13.0",
- "label": "cache,datagrid,clustering",
- "javaType": "org.apache.camel.component.infinispan.InfinispanComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-infinispan",
- "version": "3.8.0-SNAPSHOT",
- "scheme": "infinispan",
- "extendsScheme": "",
- "syntax": "infinispan:cacheName",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": false,
- "lenientProperties": false
- },
- "componentProperties": {
- "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
- "hosts": { "kind": "property", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the host of the cache on Infinispan instance" },
- "queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
- "secure": { "kind": "property", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
- "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
- "clusteredListener": { "kind": "property", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
- "customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in use, if provided" },
- "eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The pos [...]
- "sync": { "kind": "property", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
- "defaultValue": { "kind": "property", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
- "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
- "value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
- "password": { "kind": "property", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
- "saslMechanism": { "kind": "property", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
- "securityRealm": { "kind": "property", "displayName": "Security Realm", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security realm to access the infinispan instance" },
- "securityServerName": { "kind": "property", "displayName": "Security Server Name", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security server name to access the infinispan instance" },
- "username": { "kind": "property", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- "cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.commons.api.BasicCacheContainer", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
- "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The CacheContainer configuration. Uses if the cacheContainer is not defined. [...]
- "configurationProperties": { "kind": "property", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for the CacheManager" },
- "configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches." },
- "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
- "resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader == null and th [...]
- },
- "properties": {
- "cacheName": { "kind": "path", "displayName": "Cache Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name." },
- "hosts": { "kind": "parameter", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the host of the cache on Infinispan instance" },
- "queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
- "secure": { "kind": "parameter", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
- "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
- "clusteredListener": { "kind": "parameter", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
- "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
- "customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in use, if provided" },
- "eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The po [...]
- "sync": { "kind": "parameter", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
- "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
- "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
- "defaultValue": { "kind": "parameter", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
- "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
- "oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
- "value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
- "password": { "kind": "parameter", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
- "saslMechanism": { "kind": "parameter", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
- "securityRealm": { "kind": "parameter", "displayName": "Security Realm", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security realm to access the infinispan instance" },
- "securityServerName": { "kind": "parameter", "displayName": "Security Server Name", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the security server name to access the infinispan instance" },
- "username": { "kind": "parameter", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
- "cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.commons.api.BasicCacheContainer", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
- "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "The CacheContainer configuration. Uses if the cacheContainer is not defined [...]
- "configurationProperties": { "kind": "parameter", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for the CacheMan [...]
- "configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
- "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches." },
- "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
- "resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.InfinispanConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader == null and t [...]
- }
-}
diff --git a/components/camel-infinispan/src/main/docs/infinispan-component.adoc b/components/camel-infinispan/src/main/docs/infinispan-component.adoc
deleted file mode 100644
index 440016f..0000000
--- a/components/camel-infinispan/src/main/docs/infinispan-component.adoc
+++ /dev/null
@@ -1,501 +0,0 @@
-[[infinispan-component]]
-= Infinispan Component
-:docTitle: Infinispan
-:artifactId: camel-infinispan
-:description: Read and write from/to Infinispan distributed key/value store and data grid.
-:since: 2.13
-:supportLevel: Stable
-:component-header: Both producer and consumer are supported
-include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan.adoc[opts=optional]
-
-*Since Camel {since}*
-
-*{component-header}*
-
-This component allows you to interact with http://infinispan.org/[Infinispan] distributed data grid / cache using the Hot Rod procol.
-Infinispan is an extremely scalable, highly available key/value data store and data grid platform written in Java.
-
-Infinispan requires at least Java 8.
-
-If you use Maven, you must add the following dependency to your `pom.xml`:
-
-[source,xml]
-------------------------------------------------------------
-<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-infinispan</artifactId>
- <version>x.x.x</version>
- <!-- use the same version as your Camel core version -->
-</dependency>
-------------------------------------------------------------
-
-== URI format
-
-[source,java]
--------------------------------
-infinispan://cacheName?[options]
--------------------------------
-
-== URI Options
-
-The producer allows sending messages to a remote cache using the HotRod protocol.
-The consumer allows listening for events from a remote cache using the HotRod protocol.
-
-// component options: START
-The Infinispan component supports 29 options, which are listed below.
-
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *configuration* (common) | Component configuration | | InfinispanConfiguration
-| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
-| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
-| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
-| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
-| *key* (producer) | Set a specific key for producer operations | | Object
-| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
-| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
-| *value* (producer) | Set a specific value for producer operations | | Object
-| *password* ( security) | Define the password to access the infinispan instance | | String
-| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
-| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
-| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
-| *username* ( security) | Define the username to access the infinispan instance | | String
-| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
-| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
-| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
-|===
-// component options: END
-
-
-
-
-// endpoint options: START
-The Infinispan endpoint is configured using URI syntax:
-
-----
-infinispan:cacheName
-----
-
-with the following path and query parameters:
-
-=== Path Parameters (1 parameters):
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *cacheName* | *Required* The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name. | | String
-|===
-
-
-=== Query Parameters (29 parameters):
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
-| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
-| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
-| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
-| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
-| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
-| *key* (producer) | Set a specific key for producer operations | | Object
-| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
-| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
-| *value* (producer) | Set a specific value for producer operations | | Object
-| *password* ( security) | Define the password to access the infinispan instance | | String
-| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
-| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
-| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
-| *username* ( security) | Define the username to access the infinispan instance | | String
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
-| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
-| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
-|===
-// endpoint options: END
-
-== Camel Operations
-This section lists all available operations, along with their header information.
-
-.Put Operations
-[cols="40%,60%a", frame="all", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.PUT | Puts a key/value pair in the cache, optionally with expiration
-| InfinispanOperation.PUTASYNC | Asynchronously puts a key/value pair in the cache, optionally with expiration
-| InfinispanOperation.PUTIFABSENT | Puts a key/value pair in the cache if it did not exist, optionally with expiration
-| InfinispanOperation.PUTIFABSENTASYNC | Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
-|===
-
-* *Required Headers*:
-** CamelInfinispanKey
-** CamelInfinispanValue
-* *Optional Headers*:
-** CamelInfinispanLifespanTime
-** CamelInfinispanLifespanTimeUnit
-** CamelInfinispanMaxIdleTime
-** CamelInfinispanMaxIdleTimeUnit
-* *Result Header*:
-** CamelInfinispanOperationResult
-
-.Put All Operations
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.PUTALL | Adds multiple entries to a cache, optionally with expiration
-| CamelInfinispanOperation.PUTALLASYNC | Asynchronously adds multiple entries to a cache, optionally with expiration
-|===
-
-* *Required Headers*:
-** CamelInfinispanMap
-* *Optional Headers*:
-** CamelInfinispanLifespanTime
-** CamelInfinispanLifespanTimeUnit
-** CamelInfinispanMaxIdleTime
-** CamelInfinispanMaxIdleTimeUnit
-
-.Get Operations
-[cols="40%,60%a", frame="all", options="header"]
-|===
-|Operation Name |Description
-| InfinispanOperation.GET | Retrieves the value associated with a specific key from the cache
-| InfinispanOperation.GETORDEFAULT | Retrieves the value, or default value, associated with a specific key from the cache
-|===
-
-* *Required Headers*:
-** CamelInfinispanKey
-
-.Contains Key Operation
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.CONTAINSKEY | Determines whether a cache contains a specific key
-|===
-
-* *Required Headers*
-** CamelInfinispanKey
-* *Result Header*
-** CamelInfinispanOperationResult
-
-.Contains Value Operation
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.CONTAINSVALUE | Determines whether a cache contains a specific value
-|===
-
-* *Required Headers*:
-** CamelInfinispanKey
-
-
-.Remove Operations
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.REMOVE | Removes an entry from a cache, optionally only if the value matches a given one
-| InfinispanOperation.REMOVEASYNC | Asynchronously removes an entry from a cache, optionally only if the value matches a given one
-|===
-
-* *Required Headers*:
-** CamelInfinispanKey
-* *Optional Headers*:
-** CamelInfinispanValue
-* *Result Header*:
-** CamelInfinispanOperationResult
-
-.Replace Operations
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.REPLACE | Conditionally replaces an entry in the cache, optionally with expiration
-| InfinispanOperation.REPLACEASYNC | Asynchronously conditionally replaces an entry in the cache, optionally with expiration
-|===
-
-* *Required Headers*:
-** CamelInfinispanKey
-** CamelInfinispanValue
-** CamelInfinispanOldValue
-* *Optional Headers*:
-** CamelInfinispanLifespanTime
-** CamelInfinispanLifespanTimeUnit
-** CamelInfinispanMaxIdleTime
-** CamelInfinispanMaxIdleTimeUnit
-* *Result Header*:
-** CamelInfinispanOperationResult
-
-.Clear Operations
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.CLEAR | Clears the cache
-| InfinispanOperation.CLEARASYNC | Asynchronously clears the cache
-|===
-
-.Size Operation
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.SIZE | Returns the number of entries in the cache
-|===
-
-* *Result Header*
-** CamelInfinispanOperationResult
-
-.Stats Operation
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.STATS | Returns statistics about the cache
-|===
-
-* *Result Header*:
-** CamelInfinispanOperationResult
-
-.Query Operation
-[cols="40%,60%a", options="header"]
-|===
-| Operation Name | Description
-| InfinispanOperation.QUERY | Executes a query on the cache
-|===
-
-* *Required Headers*:
-** CamelInfinispanQueryBuilder
-* *Result Header*:
-** CamelInfinispanOperationResult
-
-[NOTE]
-====
-Write methods like put(key, value) and remove(key) do not return the previous value by default.
-====
-
-== Message Headers
-
-[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
-|=======================================================================
-|Name |Default Value |Type |Context |Description
-|CamelInfinispanCacheName |`null` |String |Shared |The cache participating in the operation or event.
-|CamelInfinispanOperation |`PUT` |InfinispanOperation |Producer |The operation to perform.
-|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
-|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
-|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
-|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event.
-|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
-|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
-|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
-|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
-|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
-|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
-|=======================================================================
-
-
-== Examples
-
-* Put a key/value into a named cache:
-+
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT) // <1>
- .setHeader(InfinispanConstants.KEY).constant("123") // <2>
- .to("infinispan:myCacheName&cacheContainer=#cacheContainer"); // <3>
-----
-<1> Set the operation to perform
-<2> Set the key used to identify the element in the cache
-<3> Use the configured cache manager `cacheContainer` from the registry to put an element to the cache named `myCacheName`
-+
-It is possible to configure the lifetime and/or the idle time before the entry expires and gets evicted from the cache, as example:
-+
-[source,java,options="nowrap"]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L) // <1>
- .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString()) // <2>
- .to("infinispan:myCacheName");
-----
-<1> Set the lifespan of the entry
-<2> Set the time unit for the lifespan
-
-* Queries
-+
-[source,java,options="nowrap"]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
- .setHeader(InfinispanConstants.QUERY_BUILDER, new InfinispanQueryBuilder() {
- @Override
- public Query build(QueryFactory<Query> qf) {
- return qf.from(User.class).having("name").like("%abc%").build();
- }
- })
- .to("infinispan:myCacheName?cacheContainer=#cacheManager") ;
-----
-+
-
-[NOTE]
-====
-The .proto descriptors for domain objects must be registered with the remote Data Grid server, see https://infinispan.org/docs/stable/titles/developing/developing.html#remote_query_example[Remote Query Example] in the official Infinispan documentation.
-====
-
-* Custom Listeners
-+
-[source,java,options="nowrap"]
-----
-from("infinispan://?cacheContainer=#cacheManager&customListener=#myCustomListener")
- .to("mock:result");
-----
-+
-The instance of `myCustomListener` must exist and Camel should be able to look it up from the `Registry`.
-Users are encouraged to extend the `org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener` class and annotate the resulting class with `@ClientListener` which can be found found in package `org.infinispan.client.hotrod.annotation`.
-
-
-== Using the Infinispan based idempotent repository
-
-In this section we will use the Infinispan based idempotent repository.
-
-.Java Example
-[source,java]
-----
-InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
-conf.setHosts("localhost:1122")
-
-InfinispanRemoteIdempotentRepository repo = new InfinispanRemoteIdempotentRepository("idempotent"); // <2>
-repo.setConfiguration(conf);
-
-context.addRoutes(new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start")
- .idempotentConsumer(header("MessageID"), repo) // <3>
- .to("mock:result");
- }
-});
-----
-<1> Configure the cache
-<2> Configure the repository bean
-<3> Set the repository to the route
-
-.XML Example
-[source,xml]
-----
-<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteIdempotentRepository" destroy-method="stop">
- <constructor-arg value="idempotent"/> <1>
- <property name="configuration"> <2>
- <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
- <property name="hosts" value="localhost:11222"/>
- </bean>
- </property>
-</bean>
-
-<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start" />
- <idempotentConsumer messageIdRepositoryRef="infinispanRepo"> <3>
- <header>MessageID</header>
- <to uri="mock:result" />
- </idempotentConsumer>
- </route>
-</camelContext>
-----
-<1> Set the name of the cache that will be used by the repository
-<2> Configure the repository bean
-<3> Set the repository to the route
-
-== Using the Infinispan based aggregation repository
-
-In this section we will use the Infinispan based aggregation repository.
-
-.Java Example
-[source,java]
-----
-InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
-conf.setHosts("localhost:1122")
-
-InfinispanRemoteAggregationRepository repo = new InfinispanRemoteAggregationRepository(); // <2>
-repo.setCacheName("aggregation");
-repo.setConfiguration(conf);
-
-context.addRoutes(new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start")
- .aggregate(header("MessageID"))
- .completionSize(3)
- .aggregationRepository(repo) // <3>
- .aggregationStrategyRef("myStrategy")
- .to("mock:result");
- }
-});
-----
-<1> Configure the cache
-<2> Create the repository bean
-<3> Set the repository to the route
-
-.XML Example
-[source,xml]
-----
-<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository" destroy-method="stop">
- <constructor-arg value="aggregation"/> <1>
- <property name="configuration"> <2>
- <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
- <property name="hosts" value="localhost:11222"/>
- </bean>
- </property>
-</bean>
-
-<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route>
- <from uri="direct:start" />
- <aggregate strategyRef="myStrategy"
- completionSize="3"
- aggregationRepositoryRef="infinispanRepo"> <3>
- <correlationExpression>
- <header>MessageID</header>
- </correlationExpression>
- <to uri="mock:result"/>
- </aggregate>
- </route>
-</camelContext>
-----
-<1> Set the name of the cache that will be used by the repository
-<2> Configure the repository bean
-<3> Set the repository to the route
-
-[NOTE]
-====
-With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
-For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
-====
-
-
-
-
-include::camel-spring-boot::page$infinispan-starter.adoc[]
diff --git a/components/camel-infinispan/src/main/docs/infinispan-embedded-component.adoc b/components/camel-infinispan/src/main/docs/infinispan-embedded-component.adoc
deleted file mode 100644
index 1b78ba5..0000000
--- a/components/camel-infinispan/src/main/docs/infinispan-embedded-component.adoc
+++ /dev/null
@@ -1,845 +0,0 @@
-[[infinispan-embedded-component]]
-= Infinispan Embedded Component
-:docTitle: Infinispan Embedded
-:artifactId: camel-infinispan
-:description: Read and write from/to Infinispan distributed key/value store and data grid.
-:since: 2.13
-:supportLevel: Stable
-:component-header: Both producer and consumer are supported
-include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan-embedded.adoc[opts=optional]
-
-*Since Camel {since}*
-
-*{component-header}*
-
-This component allows you to interact with
-http://infinispan.org/[Infinispan] distributed data grid / cache.
-Infinispan is an extremely scalable, highly available key/value data
-store and data grid platform written in Java.
-
-Infinispan requires at least Java 8.
-
-The `camel-infinispan` component includes the following features:
-
-* *Local Camel Consumer* - Receives cache change notifications and sends them to be processed.
-This can be done synchronously or asynchronously, and is also supported with a replicated or distributed cache.
-
-* *Local Camel Producer* - A producer creates and sends messages to an endpoint.
-The `camel-infinispan` producer uses ``GET``, ``PUT``, ``REMOVE``, and `CLEAR` operations.
-The local producer is also supported with a replicated or distributed cache.
-
-The events are processed asynchronously.
-
-If you use Maven, you must add the following dependency to your `pom.xml`:
-
-[source,xml]
-------------------------------------------------------------
-<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-infinispan</artifactId>
- <version>x.x.x</version>
- <!-- use the same version as your Camel core version -->
-</dependency>
-------------------------------------------------------------
-
-== URI format
-
-[source,java]
--------------------------------
-infinispan-embedded://cacheName?[options]
--------------------------------
-
-== URI Options
-
-The producer allows sending messages to a local infinispan cache
-configured in the registry, or to a remote cache using the HotRod
-protocol. The consumer allows listening for events from local infinispan cache
-accessible from the registry.
-
-If no cache configuration is provided, embedded cacheContainer is created directly in the component.
-
-
-// component options: START
-The Infinispan Embedded component supports 21 options, which are listed below.
-
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *configuration* (common) | Component configuration | | InfinispanEmbeddedConfiguration
-| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
-| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
-| *key* (producer) | Set a specific key for producer operations | | Object
-| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
-| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
-| *value* (producer) | Set a specific value for producer operations | | Object
-| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
-| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
-|===
-// component options: END
-
-
-
-
-// endpoint options: START
-The Infinispan Embedded endpoint is configured using URI syntax:
-
-----
-infinispan-embedded:cacheName
-----
-
-with the following path and query parameters:
-
-=== Path Parameters (1 parameters):
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *cacheName* | *Required* The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name. | | String
-|===
-
-
-=== Query Parameters (21 parameters):
-
-
-[width="100%",cols="2,5,^1,2",options="header"]
-|===
-| Name | Description | Default | Type
-| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
-| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
-| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
-| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
-| *key* (producer) | Set a specific key for producer operations | | Object
-| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
-| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
-| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
-| *value* (producer) | Set a specific value for producer operations | | Object
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
-| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
-| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
-| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
-|===
-// endpoint options: END
-
-== Camel Operations
-This section lists all available operations, along with their header information.
-
-.Put Operations
-[cols="40%,60%", frame="all", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUT
-| *Context*: Embedded / Remote
-
-*Description*: Puts a key/value pair in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.PUTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENT
-| *Description*: Puts a key/value pair in the cache if it did not exist, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
-
-|===
-
-.Put All Operations
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUTALL
-| *Context*: Embedded / Remote
-
-*Description*: Adds multiple entries to a cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanMap
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit
-
-*Result Header*: None
-
-| CamelInfinispanOperation.PUTALLASYNC
-| *Description*: Asynchronously adds multiple entries to a cache, optionally with expiration
-
-|===
-
-.Get Operations
-[cols="40%,60%", frame="all", options="header"]
-|===
-|Operation Name
-|Description
-
-| InfinispanOperation.GET
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.GETORDEFAULT
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value, or default value, associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
-|===
-
-.Contains Key Operation
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSKEY
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific key
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
-|===
-
-.Contains Value Operation
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSVALUE
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific value
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Headers*: None
-|===
-
-.Remove Operations
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REMOVE
-| *Context*: Embedded / Remote
-
-*Description*: Removes an entry from a cache, optionally only if the value matches a given one
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: CamelInfinispanValue
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REMOVEASYNC
-| *Description*: Asynchronously removes an entry from a cache, optionally only if the value matches a given one
-
-|===
-
-.Replace Operations
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REPLACE
-| *Context*: Embedded / Remote
-
-*Description*: Conditionally replaces an entry in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue, CamelInfinispanOldValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REPLACEASYNC
-| *Description*: Asynchronously conditionally replaces an entry in the cache, optionally with expiration
-
-|===
-
-.Clear Operations
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CLEAR
-| *Context*: Embedded / Remote
-
-*Description*: Clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.CLEARASYNC
-| *Context*: Embedded / Remote
-
-*Description*: Asynchronously clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
-|===
-
-.Size Operation
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.SIZE
-| *Context*: Embedded / Remote
-
-*Description*: Returns the number of entries in the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
-|===
-
-.Stats Operation
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.STATS
-| *Context*: Embedded / Remote
-
-*Description*: Returns statistics about the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
-|===
-
-.Query Operation
-[cols="40%,60%", options="header"]
-|===
-| Operation Name
-| Description
-
-| InfinispanOperation.QUERY
-| *Context*: Remote
-
-*Description*: Executes a query on the cache
-
-*Required Headers*: CamelInfinispanQueryBuilder
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
-|===
-
-[NOTE]
-====
-Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null result.
-====
-
-
-
-== Message Headers
-
-[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
-|=======================================================================
-|Name |Default Value |Type |Context |Description
-|CamelInfinispanCacheName |`null` |String |Shared |The cache participating in the operation or event.
-|CamelInfinispanOperation |`PUT` |InfinispanOperation |Producer |The operation to perform.
-|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
-|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
-|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
-|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event. Possible values defined here org.infinispan.notifications.cachelistener.event.Event.Type
-|CamelInfinispanIsPre |`null` |Boolean |Consumer |Infinispan fires two events for each operation: one before and one after the operation.
-|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
-|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
-|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
-|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
-|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
-|CamelInfinispanIgnoreReturnValues |null |Boolean |Producer |If this header is set, the return value for cache operation returning something is ignored by the client application
-|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
-|=======================================================================
-
-== Examples
-
-* Retrieve a specific key from the default cache using a custom cache container:
-
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer");
-----
-
-
-* Put a key/value into a named cache:
-+
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan:myCacheName");
-----
-
-* Put a value with lifespan
-
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L)
- .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString())
- .to("infinispan:myCacheName");
-----
-
-* Compute operation through a remapping function on the default cache using a custom cache container:
-
-[source,java]
-----
-@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer&remappingFunction=#mappingFunction");
-----
-
-This will return oldValue + "replay".
-
-This can be done also as async operation, with the `InfinispanOperation.COMPUTEASYNC` operation
-
-* Retrieve a specific key from the remote cache using a cache container configuration with additional parameters (host, port and protocol version):
-
-[source,java]
-----
-org.infinispan.client.hotrod.configuration.Configuration cacheContainerConfiguration = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
- .addServer()
- .host("localhost")
- .port(9999)
- .version(org.infinispan.client.hotrod.ProtocolVersion.PROTOCOL_VERSION_25)
- .build();
-...
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainerConfiguration=#cacheContainerConfiguration");
-----
-
-
-
-=== XML examples
-
-Routing can also be performed using XML configuration.
-The following example demonstrates `camel-infinispan` `local-camel-producer`, a camel route that sends data to an embedded cache created by the `local-cache` module.
-
-[source,java,options="nowrap"]
-----
-<camelContext id="local-producer" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="timer://local?fixedRate=true&period=5000"/>
- <setHeader headerName="CamelInfinispanKey">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanValue">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <to uri="infinispan://foo?cacheContainer=#cacheManager"/>
- <to uri="log:local-put?showAll=true"/>
- </route>
-</camelContext>
-----
-
-
-The provided example requires you to instantiate the [class]``cacheManager``.
-
-You can instantiate the [class]``cacheManager`` bean for Spring XML as follows:
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <constructor-arg type="java.lang.String" value="infinispan.xml"/>
-</bean>
-----
-
-
-The following demonstrates how to instantiate the [class]``cacheManager`` bean using Blueprint XML.
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-----
-
-[NOTE]
-====
-Both the Spring XML and Blueprint XML examples use the configuration file [path]_infinispan.xml_
- for configuration of the cache. This file must be present on the classpath.
-====
-
-
-== Remote Query
-
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
-
-.Using only Java
-====
-[source,java,options="nowrap"]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
- .setHeader(InfinispanConstants.QUERY_BUILDER,
- new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class).having("name").like("%abc%")
- .build();
- }
- })
- .to("infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache") ;
-----
-====
-
-.Using Blueprint and Java
-====
-.Java [class]``RemoteCacheManagerFactory`` class:
-[source,java,options="nowrap"]
-----
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
- }
-}
-----
-.Java [class]``InfinispanQueryExample`` class:
-[source,java,options="nowrap"]
-----
-public class InfinispanQueryExample {
- public InfinispanQueryBuilder getBuilder() {
- return new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class)
- .having("name")
- .like("%abc%")
- .build();
- }
- }
- }
-}
-----
-.blueprint.xml:
-[source,xml,options="nowrap"]
-----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
-</bean>
-
-<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:start"/>
- <setHeader headerName="CamelInfinispanOperation">
- <constant>CamelInfinispanOperationQuery</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanQueryBuilder">
- <method ref="queryBuilder" method="getBuilder"/>
- </setHeader>
- <to uri="infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache"/>
- </route>
-</camelContext>
-----
-====
-
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-
-In addition, there are the following requirements:
-
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
-
-
-== Custom Listeners for Embedded Cache
-
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
-
-.Using Java
-
-[source,java,options="nowrap"]
-----
-from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener")
- .to("mock:result");
-----
-
-.Using Blueprint
-
-[source,xml,options="nowrap"]
-----
-<bean id="myCustomContainer" org.infinispan.manager.DefaultCacheManager"
- init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
- </route>
-</camelContext>
-----
-
-
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
-
-[NOTE]
-====
-Custom filters and converters for embedded caches are currently not supported.
-====
-
-
-== Custom Listeners for Remote Cache
-
-Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
-
-.Using only Java
-====
-[source,java,options="nowrap"]
-----
-from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener")
- .to(mock:result);
-----
-====
-
-.Using Blueprint and Java
-====
-.Java class:
-[source,java,options="nowrap"]
-----
-
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
- }
-}
-----
-.blueprint.xml:
-[source,xml,options="nowrap"]
-----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
-</bean>
-
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
- </route>
-</camelContext>
-----
-====
-
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
-
-Remote listeners may also be associated with custom filters and converters as shown below:
-[source,java,options="nowrap"]
-----
-@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
- private static class MyCustomListener extends InfinispanRemoteCustomListener {
-}
-----
-
-In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
-[source,java,options="nowrap"]
-----
-import org.infinispan.notifications.cachelistener.filter;
-
-@NamedFactory(name = "static-converter-factory")
-public static class StaticConverterFactory implements CacheEventConverterFactory {
- @Override
- public CacheEventConverter<Integer, String, CustomEvent> getConverter(Object[] params) {
- ...
- }
-
- static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
- @Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
- }
- }
-}
-
-@NamedFactory(name = "static-filter-factory")
-public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
- @Override
- public CacheEventFilter<Integer, String> getFilter(final Object[] params) {
- ...
- }
-
- static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
- @Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
- }
- }
-}
-----
-
-Custom filters and converters must be registered with the server.
-.
-
-[NOTE]
-====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
-====
-
-[NOTE]
-====
-With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
-For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
-====
-
-== Using the Infinispan based idempotent repository
-
-In this section we will use the Infinispan based idempotent repository.
-
-First, we need to create a cacheManager and then configure our
-
-[source,java]
-----
-org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository:
-----
-
-[source,xml]
-----
-<!-- set up the cache manager -->
-<bean id="cacheManager"
- class="org.infinispan.manager.DefaultCacheManager"
- init-method="start"
- destroy-method="stop"/>
-
-<!-- set up the repository -->
-<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.InfinispanIdempotentRepository"
- factory-method="infinispanIdempotentRepository">
- <argument ref="cacheManager"/>
- <argument value="idempotent"/>
-</bean>
-----
-
-Then we can create our Infinispan idempotent repository in the spring
-XML file as well:
-
-[source,xml]
-----
-<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route id="JpaMessageIdRepositoryTest">
- <from uri="direct:start" />
- <idempotentConsumer messageIdRepositoryRef="infinispanStore">
- <header>messageId</header>
- <to uri="mock:result" />
- </idempotentConsumer>
- </route>
-</camelContext>
-----
-
-
-include::camel-spring-boot::page$infinispan-starter.adoc[]
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicyTest.java b/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicyTest.java
deleted file mode 100644
index 23aa8a0..0000000
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicyTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.component.infinispan.embedded;
-
-import org.apache.camel.component.infinispan.InfinispanRoutePolicy;
-import org.apache.camel.component.infinispan.InfinispanRoutePolicyTestSupport;
-import org.junit.jupiter.api.BeforeEach;
-
-public class InfinispanEmbeddedRoutePolicyTest extends InfinispanEmbeddedTestSupport
- implements InfinispanRoutePolicyTestSupport {
-
- @BeforeEach
- protected void beforeEach() {
- // cleanup the default test cache before each run
- getCache().clear();
- }
-
- // *****************************
- //
- // *****************************
-
- @Override
- public InfinispanRoutePolicy createRoutePolicy(String lockValue) {
- InfinispanEmbeddedConfiguration configuration = new InfinispanEmbeddedConfiguration();
- configuration.setCacheContainer(cacheContainer);
-
- InfinispanEmbeddedRoutePolicy policy = new InfinispanEmbeddedRoutePolicy(configuration);
- policy.setLockMapName(getCacheName());
- policy.setLockKey("lock-key");
- policy.setLockValue(lockValue);
-
- return policy;
- }
-}
diff --git a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicyTest.java b/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicyTest.java
deleted file mode 100644
index a9864d1..0000000
--- a/components/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteRoutePolicyTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.component.infinispan.remote;
-
-import org.apache.camel.component.infinispan.InfinispanRoutePolicy;
-import org.apache.camel.component.infinispan.InfinispanRoutePolicyTestSupport;
-import org.junit.jupiter.api.BeforeEach;
-
-public class InfinispanRemoteRoutePolicyTest
- extends InfinispanRemoteTestSupport
- implements InfinispanRoutePolicyTestSupport {
-
- @BeforeEach
- protected void beforeEach() {
- // cleanup the default test cache before each run
- getCache().clear();
- }
-
- // *****************************
- //
- // *****************************
-
- @Override
- public InfinispanRoutePolicy createRoutePolicy(String lockValue) {
- InfinispanRemoteConfiguration configuration = new InfinispanRemoteConfiguration();
- configuration.setCacheContainer(cacheContainer);
-
- InfinispanRemoteRoutePolicy policy = new InfinispanRemoteRoutePolicy(configuration);
- policy.setLockMapName(getCacheName());
- policy.setLockKey("lock-key");
- policy.setLockValue(lockValue);
-
- return policy;
- }
-}
diff --git a/core/camel-allcomponents/pom.xml b/core/camel-allcomponents/pom.xml
index 1cffb06..197b026 100644
--- a/core/camel-allcomponents/pom.xml
+++ b/core/camel-allcomponents/pom.xml
@@ -683,6 +683,14 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-embedded</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-infinispan</artifactId>
</dependency>
<dependency>
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index 0924bea..e099043 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -2415,13 +2415,13 @@ public interface ComponentsBuilderFactory {
return org.apache.camel.builder.component.dsl.InfinispanComponentBuilderFactory.infinispan();
}
/**
- * Infinispan Embedded (camel-infinispan)
+ * Infinispan Embedded (camel-infinispan-embedded)
* Read and write from/to Infinispan distributed key/value store and data
* grid.
*
* Category: cache,datagrid,clustering
* Since: 2.13
- * Maven coordinates: org.apache.camel:camel-infinispan
+ * Maven coordinates: org.apache.camel:camel-infinispan-embedded
*
* @return the dsl builder
*/
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java
index b05b653..92f37dc 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanComponentBuilderFactory.java
@@ -135,22 +135,6 @@ public interface InfinispanComponentBuilderFactory {
return this;
}
/**
- * The operation to perform.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Default: PUT
- * Group: consumer
- *
- * @param command the value to set
- * @return the dsl builder
- */
- @Deprecated
- default InfinispanComponentBuilder command(java.lang.String command) {
- doSetProperty("command", command);
- return this;
- }
- /**
* Returns the custom listener in use, if provided.
*
* The option is a:
@@ -526,7 +510,6 @@ public interface InfinispanComponentBuilderFactory {
case "queryBuilder": getOrCreateConfiguration((InfinispanRemoteComponent) component).setQueryBuilder((org.apache.camel.component.infinispan.InfinispanQueryBuilder) value); return true;
case "secure": getOrCreateConfiguration((InfinispanRemoteComponent) component).setSecure((boolean) value); return true;
case "bridgeErrorHandler": ((InfinispanRemoteComponent) component).setBridgeErrorHandler((boolean) value); return true;
- case "command": getOrCreateConfiguration((InfinispanRemoteComponent) component).setCommand((java.lang.String) value); return true;
case "customListener": getOrCreateConfiguration((InfinispanRemoteComponent) component).setCustomListener((org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener) value); return true;
case "eventTypes": getOrCreateConfiguration((InfinispanRemoteComponent) component).setEventTypes((java.lang.String) value); return true;
case "defaultValue": getOrCreateConfiguration((InfinispanRemoteComponent) component).setDefaultValue((java.lang.Object) value); return true;
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java
index 2709e99..ab203d2 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/InfinispanEmbeddedComponentBuilderFactory.java
@@ -31,13 +31,13 @@ import org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponen
public interface InfinispanEmbeddedComponentBuilderFactory {
/**
- * Infinispan Embedded (camel-infinispan)
+ * Infinispan Embedded (camel-infinispan-embedded)
* Read and write from/to Infinispan distributed key/value store and data
* grid.
*
* Category: cache,datagrid,clustering
* Since: 2.13
- * Maven coordinates: org.apache.camel:camel-infinispan
+ * Maven coordinates: org.apache.camel:camel-infinispan-embedded
*
* @return the dsl builder
*/
@@ -122,23 +122,6 @@ public interface InfinispanEmbeddedComponentBuilderFactory {
return this;
}
/**
- * The operation to perform.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Default: PUT
- * Group: consumer
- *
- * @param command the value to set
- * @return the dsl builder
- */
- @Deprecated
- default InfinispanEmbeddedComponentBuilder command(
- java.lang.String command) {
- doSetProperty("command", command);
- return this;
- }
- /**
* Returns the custom listener in use, if provided.
*
* The option is a:
@@ -444,7 +427,6 @@ public interface InfinispanEmbeddedComponentBuilderFactory {
case "queryBuilder": getOrCreateConfiguration((InfinispanEmbeddedComponent) component).setQueryBuilder((org.apache.camel.component.infinispan.InfinispanQueryBuilder) value); return true;
case "bridgeErrorHandler": ((InfinispanEmbeddedComponent) component).setBridgeErrorHandler((boolean) value); return true;
case "clusteredListener": getOrCreateConfiguration((InfinispanEmbeddedComponent) component).setClusteredListener((boolean) value); return true;
- case "command": getOrCreateConfiguration((InfinispanEmbeddedComponent) component).setCommand((java.lang.String) value); return true;
case "customListener": getOrCreateConfiguration((InfinispanEmbeddedComponent) component).setCustomListener((org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener) value); return true;
case "eventTypes": getOrCreateConfiguration((InfinispanEmbeddedComponent) component).setEventTypes((java.lang.String) value); return true;
case "sync": getOrCreateConfiguration((InfinispanEmbeddedComponent) component).setSync((boolean) value); return true;
diff --git a/core/camel-componentdsl/src/generated/resources/metadata.json b/core/camel-componentdsl/src/generated/resources/metadata.json
index 6f33ea5..82320fb 100644
--- a/core/camel-componentdsl/src/generated/resources/metadata.json
+++ b/core/camel-componentdsl/src/generated/resources/metadata.json
@@ -3980,7 +3980,7 @@
"javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponent",
"supportLevel": "Stable",
"groupId": "org.apache.camel",
- "artifactId": "camel-infinispan",
+ "artifactId": "camel-infinispan-embedded",
"version": "3.8.0-SNAPSHOT",
"scheme": "infinispan-embedded",
"extendsScheme": "",
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index b4f2ab4..6d971b0 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -8090,13 +8090,13 @@ public class StaticEndpointBuilders {
return org.apache.camel.builder.endpoint.dsl.InfinispanRemoteEndpointBuilderFactory.endpointBuilder(componentName, path);
}
/**
- * Infinispan Embedded (camel-infinispan)
+ * Infinispan Embedded (camel-infinispan-embedded)
* Read and write from/to Infinispan distributed key/value store and data
* grid.
*
* Category: cache,datagrid,clustering
* Since: 2.13
- * Maven coordinates: org.apache.camel:camel-infinispan
+ * Maven coordinates: org.apache.camel:camel-infinispan-embedded
*
* Syntax: <code>infinispan-embedded:cacheName</code>
*
@@ -8113,13 +8113,13 @@ public class StaticEndpointBuilders {
return org.apache.camel.builder.endpoint.dsl.InfinispanEmbeddedEndpointBuilderFactory.endpointBuilder("infinispan-embedded", path);
}
/**
- * Infinispan Embedded (camel-infinispan)
+ * Infinispan Embedded (camel-infinispan-embedded)
* Read and write from/to Infinispan distributed key/value store and data
* grid.
*
* Category: cache,datagrid,clustering
* Since: 2.13
- * Maven coordinates: org.apache.camel:camel-infinispan
+ * Maven coordinates: org.apache.camel:camel-infinispan-embedded
*
* Syntax: <code>infinispan-embedded:cacheName</code>
*
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java
index dce48e2..a8fe216 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanEmbeddedEndpointBuilderFactory.java
@@ -153,22 +153,6 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return this;
}
/**
- * The operation to perform.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Default: PUT
- * Group: consumer
- *
- * @param command the value to set
- * @return the dsl builder
- */
- @Deprecated
- default InfinispanEmbeddedEndpointConsumerBuilder command(String command) {
- doSetProperty("command", command);
- return this;
- }
- /**
* Returns the custom listener in use, if provided.
*
* The option is a:
@@ -1252,13 +1236,13 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
public interface InfinispanEmbeddedBuilders {
/**
- * Infinispan Embedded (camel-infinispan)
+ * Infinispan Embedded (camel-infinispan-embedded)
* Read and write from/to Infinispan distributed key/value store and
* data grid.
*
* Category: cache,datagrid,clustering
* Since: 2.13
- * Maven coordinates: org.apache.camel:camel-infinispan
+ * Maven coordinates: org.apache.camel:camel-infinispan-embedded
*
* Syntax: <code>infinispan-embedded:cacheName</code>
*
@@ -1274,13 +1258,13 @@ public interface InfinispanEmbeddedEndpointBuilderFactory {
return InfinispanEmbeddedEndpointBuilderFactory.endpointBuilder("infinispan-embedded", path);
}
/**
- * Infinispan Embedded (camel-infinispan)
+ * Infinispan Embedded (camel-infinispan-embedded)
* Read and write from/to Infinispan distributed key/value store and
* data grid.
*
* Category: cache,datagrid,clustering
* Since: 2.13
- * Maven coordinates: org.apache.camel:camel-infinispan
+ * Maven coordinates: org.apache.camel:camel-infinispan-embedded
*
* Syntax: <code>infinispan-embedded:cacheName</code>
*
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java
index 0a379b0..0b4f9ab 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/InfinispanRemoteEndpointBuilderFactory.java
@@ -166,22 +166,6 @@ public interface InfinispanRemoteEndpointBuilderFactory {
return this;
}
/**
- * The operation to perform.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Default: PUT
- * Group: consumer
- *
- * @param command the value to set
- * @return the dsl builder
- */
- @Deprecated
- default InfinispanRemoteEndpointConsumerBuilder command(String command) {
- doSetProperty("command", command);
- return this;
- }
- /**
* Returns the custom listener in use, if provided.
*
* The option is a:
diff --git a/docs/components/modules/ROOT/pages/infinispan-component.adoc b/docs/components/modules/ROOT/pages/infinispan-component.adoc
index 7d88f54..01f2103 100644
--- a/docs/components/modules/ROOT/pages/infinispan-component.adoc
+++ b/docs/components/modules/ROOT/pages/infinispan-component.adoc
@@ -1,7 +1,7 @@
[[infinispan-component]]
= Infinispan Component
//THIS FILE IS COPIED: EDIT THE SOURCE FILE:
-:page-source: components/camel-infinispan/src/main/docs/infinispan-component.adoc
+:page-source: components/camel-infinispan/camel-infinispan/src/main/docs/infinispan-component.adoc
:docTitle: Infinispan
:artifactId: camel-infinispan
:description: Read and write from/to Infinispan distributed key/value store and data grid.
@@ -44,23 +44,20 @@ The producer allows sending messages to a remote cache using the HotRod protocol
The consumer allows listening for events from a remote cache using the HotRod protocol.
// component options: START
-The Infinispan component supports 29 options, which are listed below.
+The Infinispan component supports 26 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *configuration* (common) | Component configuration | | InfinispanConfiguration
+| *configuration* (common) | Component configuration | | InfinispanRemoteConfiguration
| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanRemoteCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER | | String
| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
| *key* (producer) | Set a specific key for producer operations | | Object
| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
@@ -73,13 +70,13 @@ The Infinispan component supports 29 options, which are listed below.
| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
| *username* ( security) | Define the username to access the infinispan instance | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// component options: END
@@ -105,7 +102,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (29 parameters):
+=== Query Parameters (26 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -115,11 +112,8 @@ with the following path and query parameters:
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
-| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
-| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanRemoteCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER | | String
| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
@@ -133,13 +127,13 @@ with the following path and query parameters:
| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
| *username* ( security) | Define the username to access the infinispan instance | | String
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
diff --git a/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc b/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc
index f8365e5..0d2a807 100644
--- a/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc
+++ b/docs/components/modules/ROOT/pages/infinispan-embedded-component.adoc
@@ -1,9 +1,9 @@
[[infinispan-embedded-component]]
= Infinispan Embedded Component
//THIS FILE IS COPIED: EDIT THE SOURCE FILE:
-:page-source: components/camel-infinispan/src/main/docs/infinispan-embedded-component.adoc
+:page-source: components/camel-infinispan/camel-infinispan-embedded/src/main/docs/infinispan-embedded-component.adoc
:docTitle: Infinispan Embedded
-:artifactId: camel-infinispan
+:artifactId: camel-infinispan-embedded
:description: Read and write from/to Infinispan distributed key/value store and data grid.
:since: 2.13
:supportLevel: Stable
@@ -38,7 +38,7 @@ If you use Maven, you must add the following dependency to your `pom.xml`:
------------------------------------------------------------
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-infinispan</artifactId>
+ <artifactId>camel-infinispan-embedded</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
@@ -62,7 +62,7 @@ If no cache configuration is provided, embedded cacheContainer is created direct
// component options: START
-The Infinispan Embedded component supports 21 options, which are listed below.
+The Infinispan Embedded component supports 20 options, which are listed below.
@@ -73,7 +73,6 @@ The Infinispan Embedded component supports 21 options, which are listed below.
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
@@ -88,7 +87,7 @@ The Infinispan Embedded component supports 21 options, which are listed below.
| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// component options: END
@@ -115,7 +114,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (21 parameters):
+=== Query Parameters (20 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -124,7 +123,6 @@ with the following path and query parameters:
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
-| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
@@ -140,7 +138,7 @@ with the following path and query parameters:
| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
-| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
diff --git a/parent/pom.xml b/parent/pom.xml
index 0df304f..3dfd887 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1597,6 +1597,21 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-embedded</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-parent</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-infinispan</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java
index 2c4dcee..737cbef 100644
--- a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java
+++ b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java
@@ -17,7 +17,7 @@
package org.apache.camel.test.infra.common.services;
-public interface TestService {
+public interface TestService extends AutoCloseable {
/**
* Register service properties (such as using System.setProperties) so that they can be resolved at distance (ie.:
@@ -35,4 +35,9 @@ public interface TestService {
* Shuts down the service after the test has completed
*/
void shutdown();
+
+ @Override
+ default void close() {
+ shutdown();
+ }
}
[camel] 01/06: CAMEL-12489 - camel-infinspan: split remote and
embedded components
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 573ae8445cbf5d4ed4303d3a19eae0dad39356a8
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Tue Jan 12 19:07:05 2021 +0100
CAMEL-12489 - camel-infinspan: split remote and embedded components
---
.../org/apache/camel/catalog/components.properties | 1 +
.../catalog/components/infinispan-embedded.json | 71 ++
.../org/apache/camel/catalog/docs.properties | 1 +
.../camel/catalog/docs/infinispan-component.adoc | 813 ++++----------
.../docs/infinispan-embedded-component.adoc | 139 +--
components/camel-infinispan/pom.xml | 63 +-
.../InfinispanEmbeddedComponentConfigurer.java} | 79 +-
.../InfinispanEmbeddedEndpointConfigurer.java} | 71 +-
.../InfinispanEmbeddedEndpointUriFactory.java} | 40 +-
.../InfinispanRemoteComponentConfigurer.java} | 43 +-
.../InfinispanRemoteEndpointConfigurer.java} | 35 +-
.../InfinispanRemoteEndpointUriFactory.java} | 8 +-
.../services/org/apache/camel/component.properties | 2 +-
.../services/org/apache/camel/component/infinispan | 2 +-
.../org/apache/camel/component/infinispan-embedded | 2 +
.../apache/camel/configurer/infinispan-component | 2 +-
.../camel/configurer/infinispan-embedded-component | 2 +
.../camel/configurer/infinispan-embedded-endpoint | 2 +
.../apache/camel/configurer/infinispan-endpoint | 2 +-
.../camel/urifactory/infinispan-embedded-endpoint | 2 +
.../apache/camel/urifactory/infinispan-endpoint | 2 +-
.../infinispan/embedded/infinispan-embedded.json | 71 ++
.../component/infinispan/remote/infinispan.json | 83 ++
.../src/main/docs/infinispan-component.adoc | 813 ++++----------
...ent.adoc => infinispan-embedded-component.adoc} | 139 +--
...y.java => InfinispanAggregationRepository.java} | 120 +-
.../component/infinispan/InfinispanComponent.java | 84 +-
.../infinispan/InfinispanConfiguration.java | 289 +----
.../component/infinispan/InfinispanConstants.java | 5 +
.../component/infinispan/InfinispanConsumer.java | 130 +--
.../infinispan/InfinispanCustomListener.java | 39 -
.../component/infinispan/InfinispanEndpoint.java | 61 +-
.../infinispan/InfinispanEventListener.java | 38 +-
...rHandler.java => InfinispanEventProcessor.java} | 8 +-
.../infinispan/InfinispanIdempotentRepository.java | 85 ++
.../component/infinispan/InfinispanManager.java | 209 +---
.../component/infinispan/InfinispanProducer.java | 335 ++----
.../infinispan/InfinispanQueryBuilder.java | 5 +
.../infinispan/InfinispanRoutePolicy.java | 246 ++++
.../camel/component/infinispan/InfinispanUtil.java | 73 +-
.../InfinispanConsumerEmbeddedHandler.java | 62 --
.../InfinispanEmbeddedAggregationRepository.java | 82 ++
.../embedded/InfinispanEmbeddedComponent.java | 57 +
.../embedded/InfinispanEmbeddedConfiguration.java | 158 +++
.../embedded/InfinispanEmbeddedConsumer.java | 156 +++
.../embedded/InfinispanEmbeddedCustomListener.java | 30 +-
.../InfinispanEmbeddedEndpoint.java} | 33 +-
.../embedded/InfinispanEmbeddedEventListener.java | 193 ++++
.../embedded/InfinispanEmbeddedEventListeners.java | 67 ++
.../InfinispanEmbeddedIdempotentRepository.java | 96 ++
.../embedded/InfinispanEmbeddedManager.java | 147 +++
.../embedded/InfinispanEmbeddedProducer.java | 57 +
.../embedded/InfinispanEmbeddedRoutePolicy.java | 150 +++
.../InfinispanEmbeddedUtil.java} | 41 +-
.../InfinispanSyncClusteredEventListener.java | 48 -
.../embedded/InfinispanSyncLocalEventListener.java | 59 -
.../infinispan/policy/InfinispanRoutePolicy.java | 475 --------
.../InfinispanLocalAggregationRepository.java | 241 ----
.../idempotent/InfinispanIdempotentRepository.java | 146 ---
.../remote/InfinispanConsumerRemoteHandler.java | 56 -
.../InfinispanRemoteAggregationRepository.java | 104 ++
.../remote/InfinispanRemoteComponent.java | 57 +
.../remote/InfinispanRemoteConfiguration.java | 247 +++++
.../remote/InfinispanRemoteConsumer.java | 148 +++
.../remote/InfinispanRemoteCustomListener.java | 40 +-
.../InfinispanRemoteEndpoint.java} | 30 +-
.../remote/InfinispanRemoteEventListener.java | 50 +-
.../InfinispanRemoteIdempotentRepository.java | 100 ++
.../InfinispanRemoteManager.java} | 148 +--
.../remote/InfinispanRemoteProducer.java | 59 +
.../remote/InfinispanRemoteRoutePolicy.java | 174 +++
...oteOperation.java => InfinispanRemoteUtil.java} | 34 +-
.../infinispan/InfinispanConfigurationIT.java | 109 --
.../InfinispanConsumerEntryCreatedTest.java | 57 -
.../InfinispanConsumerEntryRemovedTest.java | 59 -
.../InfinispanConsumerEntryUpdatedTest.java | 59 -
.../InfinispanConsumerEntryVisitedTest.java | 59 -
...ion.java => InfinispanConsumerTestSupport.java} | 17 +-
.../InfinispanIdempotentRepositoryTestSupport.java | 103 ++
.../InfinispanLocalConsumerCustomListenerIT.java | 58 -
.../infinispan/InfinispanLocalConsumerTest.java | 83 --
.../infinispan/InfinispanProducerTest.java | 1172 --------------------
.../infinispan/InfinispanProducerTestSupport.java | 890 +++++++++++++++
.../infinispan/InfinispanRemoteProducerTest.java | 54 -
.../InfinispanRoutePolicyTestSupport.java | 58 +
.../infinispan/InfinispanSyncConsumerTest.java | 49 -
.../infinispan/InfinispanTestSupport.java | 51 +-
.../infinispan/MyEmbeddedCustomListener.java | 44 -
...beddedAggregationRepositoryOperationsTest.java} | 106 +-
...nfinispanEmbeddedAggregationRepositoryTest.java | 72 ++
.../InfinispanEmbeddedClusteredConsumerTest.java} | 36 +-
.../InfinispanEmbeddedClusteredTestSupport.java} | 67 +-
.../InfinispanEmbeddedConfigurationTest.java | 52 +
.../embedded/InfinispanEmbeddedConsumerTest.java | 192 ++++
.../InfinispanEmbeddedCustomListenerTest.java | 110 ++
...InfinispanEmbeddedIdempotentRepositoryTest.java | 79 ++
.../embedded/InfinispanEmbeddedProducerTest.java | 109 ++
.../InfinispanEmbeddedQueryConsumerTest.java | 130 +++
.../InfinispanEmbeddedQueryProducerTest.java} | 126 +--
.../InfinispanEmbeddedQueryTestSupport.java} | 9 +-
.../InfinispanEmbeddedRoutePolicyTest.java | 48 +
.../embedded/InfinispanEmbeddedTestSupport.java | 82 ++
...spanEmbeddedIdempotentRepositoryCamelTest.java} | 20 +-
...panEmbeddedIdempotentRepositorySpringTest.java} | 20 +-
...anEmbeddedIdempotentRepositoryTestSupport.java} | 30 +-
.../policy/InfinispanEmbeddedRoutePolicyTest.java | 32 -
.../policy/InfinispanRemoteRoutePolicyTest.java | 39 -
.../policy/InfinispanRoutePolicyTestBase.java | 90 --
.../InfinispanLocalAggregationRepositoryTest.java | 97 --
.../InfinispanRemoteAggregationRepositoryTest.java | 95 --
.../InfinispanDefaultIdempotentRepositoryTest.java | 65 --
.../InfinispanIdempotentRepositoryIT.java | 82 --
.../InfinispanIdempotentRepositoryTest.java | 108 --
...RemoteAggregationRepositoryOperationsTest.java} | 101 +-
.../InfinispanRemoteAggregationRepositoryTest.java | 73 ++
.../remote/InfinispanRemoteConfigurationTest.java | 96 ++
.../remote/InfinispanRemoteConsumerTest.java | 75 ++
.../remote/InfinispanRemoteCustomListenerTest.java | 99 ++
.../InfinispanRemoteIdempotentRepositoryTest.java | 79 ++
.../remote/InfinispanRemoteProducerTest.java | 107 ++
.../InfinispanRemoteQueryConsumerTest.java} | 132 +--
.../InfinispanRemoteQueryProducerTest.java} | 136 ++-
.../InfinispanRemoteQueryTestSupport.java} | 9 +-
.../remote/InfinispanRemoteRoutePolicyTest.java | 49 +
.../remote/InfinispanRemoteTestSupport.java | 104 ++
...nispanRemoteIdempotentRepositoryCamelTest.java} | 19 +-
...ispanRemoteIdempotentRepositorySpringTest.java} | 20 +-
...spanRemoteIdempotentRepositoryTestSupport.java} | 44 +-
.../InfinispanTestContainerSupport.java | 47 -
.../InfinispanTestContainersConsumerTest.java | 81 --
...ispanTestContainersContainsKeyProducerTest.java | 77 --
...spanTestContainersGetOrDefaultProducerTest.java | 86 --
...spanTestContainersIdempotentRepositoryTest.java | 78 --
.../InfinispanTestContainersProducerTest.java | 77 --
...ispanTestContainersPutIfAbsentProducerTest.java | 96 --
...InfinispanTestContainersRemoveProducerTest.java | 96 --
.../camel/component/infinispan/util/Wait.java | 55 -
.../src/test/resources/log4j2.properties | 10 +
...ispanEmbeddedIdempotentRepositoryCamelTest.xml} | 22 +-
...anEmbeddedIdempotentRepositoryConfiguration.xml | 32 +
...spanEmbeddedIdempotentRepositorySpringTest.xml} | 14 +-
...inispanRemoteIdempotentRepositoryCamelTest.xml} | 26 +-
...nispanRemoteIdempotentRepositorySpringTest.xml} | 10 +-
.../component/ComponentsBuilderFactory.java | 14 +
.../dsl/InfinispanComponentBuilderFactory.java | 137 +--
...InfinispanEmbeddedComponentBuilderFactory.java} | 282 ++---
.../src/generated/resources/metadata.json | 24 +-
.../builder/endpoint/EndpointBuilderFactory.java | 3 +-
.../camel/builder/endpoint/EndpointBuilders.java | 3 +-
.../builder/endpoint/StaticEndpointBuilders.java | 57 +-
... InfinispanEmbeddedEndpointBuilderFactory.java} | 824 +++-----------
...=> InfinispanRemoteEndpointBuilderFactory.java} | 503 +++------
.../camel/support/HeaderSelectorProducer.java | 30 +-
docs/components/modules/ROOT/nav.adoc | 1 +
.../modules/ROOT/pages/infinispan-component.adoc | 813 ++++----------
...ent.adoc => infinispan-embedded-component.adoc} | 141 +--
.../services/InfinispanLocalContainerService.java | 32 +-
157 files changed, 7765 insertions(+), 9627 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index 8773a62..6e9c853 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -177,6 +177,7 @@ ignite-set
imap
imaps
infinispan
+infinispan-embedded
influxdb
iota
ipfs
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan-embedded.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan-embedded.json
new file mode 100644
index 0000000..62c5705
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/infinispan-embedded.json
@@ -0,0 +1,71 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "infinispan-embedded",
+ "title": "Infinispan Embedded",
+ "description": "Read and write from\/to Infinispan distributed key\/value store and data grid.",
+ "deprecated": false,
+ "firstVersion": "2.13.0",
+ "label": "cache,datagrid,clustering",
+ "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponent",
+ "supportLevel": "Stable",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-infinispan",
+ "version": "3.8.0-SNAPSHOT",
+ "scheme": "infinispan-embedded",
+ "extendsScheme": "",
+ "syntax": "infinispan-embedded:cacheName",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": false,
+ "lenientProperties": false
+ },
+ "componentProperties": {
+ "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
+ "queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
+ "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
+ "clusteredListener": { "kind": "property", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
+ "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
+ "customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom list [...]
+ "eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated b [...]
+ "sync": { "kind": "property", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
+ "defaultValue": { "kind": "property", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
+ "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
+ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
+ "oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
+ "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
+ "value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
+ "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
+ "cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
+ "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The C [...]
+ "configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
+ "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remot [...]
+ "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHead [...]
+ },
+ "properties": {
+ "cacheName": { "kind": "path", "displayName": "Cache Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name." },
+ "queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
+ "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
+ "clusteredListener": { "kind": "parameter", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
+ "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
+ "customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom lis [...]
+ "eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated [...]
+ "sync": { "kind": "parameter", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
+ "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
+ "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
+ "defaultValue": { "kind": "parameter", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
+ "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
+ "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
+ "oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
+ "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
+ "value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
+ "cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to con [...]
+ "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The [...]
+ "configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
+ "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remo [...]
+ "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHea [...]
+ }
+}
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
index fd942fb..76df481 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
@@ -244,6 +244,7 @@ ignite-summary
inOnly-eip
inOut-eip
infinispan-component
+infinispan-embedded-component
influxdb-component
intercept
iota-component
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
index 536546c..440016f 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
@@ -12,27 +12,11 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan
*{component-header}*
-This component allows you to interact with
-http://infinispan.org/[Infinispan] distributed data grid / cache.
-Infinispan is an extremely scalable, highly available key/value data
-store and data grid platform written in Java.
+This component allows you to interact with http://infinispan.org/[Infinispan] distributed data grid / cache using the Hot Rod procol.
+Infinispan is an extremely scalable, highly available key/value data store and data grid platform written in Java.
Infinispan requires at least Java 8.
-The `camel-infinispan` component includes the following features:
-
-* *Local Camel Consumer* - Receives cache change notifications and sends them to be processed.
-This can be done synchronously or asynchronously, and is also supported with a replicated or distributed cache.
-
-* *Local Camel Producer* - A producer creates and sends messages to an endpoint.
-The `camel-infinispan` producer uses ``GET``, ``PUT``, ``REMOVE``, and `CLEAR` operations.
-The local producer is also supported with a replicated or distributed cache.
-
-* *Remote Camel Producer* - In Remote Client-Server mode, the Camel producer can send messages using Hot Rod.
-
-* *Remote Camel Consumer* - In Client-Server mode, receives cache change notifications and sends them to be processed.
-The events are processed asynchronously.
-
If you use Maven, you must add the following dependency to your `pom.xml`:
[source,xml]
@@ -54,13 +38,8 @@ infinispan://cacheName?[options]
== URI Options
-The producer allows sending messages to a local infinispan cache
-configured in the registry, or to a remote cache using the HotRod
-protocol. The consumer allows listening for events from local infinispan cache
-accessible from the registry.
-
-If no cache configuration is provided, embedded cacheContainer is created directly in the component.
-
+The producer allows sending messages to a remote cache using the HotRod protocol.
+The consumer allows listening for events from a remote cache using the HotRod protocol.
// component options: START
The Infinispan component supports 29 options, which are listed below.
@@ -166,256 +145,156 @@ with the following path and query parameters:
This section lists all available operations, along with their header information.
.Put Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUT
-| *Context*: Embedded / Remote
-
-*Description*: Puts a key/value pair in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.PUTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENT
-| *Description*: Puts a key/value pair in the cache if it did not exist, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUT | Puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTASYNC | Asynchronously puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTIFABSENT | Puts a key/value pair in the cache if it did not exist, optionally with expiration
+| InfinispanOperation.PUTIFABSENTASYNC | Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Put All Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUTALL
-| *Context*: Embedded / Remote
-
-*Description*: Adds multiple entries to a cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanMap
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit
-
-*Result Header*: None
-
-| CamelInfinispanOperation.PUTALLASYNC
-| *Description*: Asynchronously adds multiple entries to a cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUTALL | Adds multiple entries to a cache, optionally with expiration
+| CamelInfinispanOperation.PUTALLASYNC | Asynchronously adds multiple entries to a cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanMap
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+
.Get Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-|Operation Name
-|Description
-
-| InfinispanOperation.GET
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.GETORDEFAULT
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value, or default value, associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
+|Operation Name |Description
+| InfinispanOperation.GET | Retrieves the value associated with a specific key from the cache
+| InfinispanOperation.GETORDEFAULT | Retrieves the value, or default value, associated with a specific key from the cache
|===
+* *Required Headers*:
+** CamelInfinispanKey
+
.Contains Key Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSKEY
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific key
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.CONTAINSKEY | Determines whether a cache contains a specific key
|===
+* *Required Headers*
+** CamelInfinispanKey
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Contains Value Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CONTAINSVALUE | Determines whether a cache contains a specific value
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSVALUE
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific value
-
-*Required Headers*: CamelInfinispanKey
-*Optional Headers*: None
+* *Required Headers*:
+** CamelInfinispanKey
-*Result Headers*: None
-|===
.Remove Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REMOVE
-| *Context*: Embedded / Remote
-
-*Description*: Removes an entry from a cache, optionally only if the value matches a given one
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: CamelInfinispanValue
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REMOVEASYNC
-| *Description*: Asynchronously removes an entry from a cache, optionally only if the value matches a given one
-
+| Operation Name | Description
+| InfinispanOperation.REMOVE | Removes an entry from a cache, optionally only if the value matches a given one
+| InfinispanOperation.REMOVEASYNC | Asynchronously removes an entry from a cache, optionally only if the value matches a given one
|===
+* *Required Headers*:
+** CamelInfinispanKey
+* *Optional Headers*:
+** CamelInfinispanValue
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Replace Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REPLACE
-| *Context*: Embedded / Remote
-
-*Description*: Conditionally replaces an entry in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue, CamelInfinispanOldValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REPLACEASYNC
-| *Description*: Asynchronously conditionally replaces an entry in the cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.REPLACE | Conditionally replaces an entry in the cache, optionally with expiration
+| InfinispanOperation.REPLACEASYNC | Asynchronously conditionally replaces an entry in the cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+** CamelInfinispanOldValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Clear Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CLEAR
-| *Context*: Embedded / Remote
-
-*Description*: Clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.CLEARASYNC
-| *Context*: Embedded / Remote
-
-*Description*: Asynchronously clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
+| Operation Name | Description
+| InfinispanOperation.CLEAR | Clears the cache
+| InfinispanOperation.CLEARASYNC | Asynchronously clears the cache
|===
.Size Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.SIZE
-| *Context*: Embedded / Remote
-
-*Description*: Returns the number of entries in the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.SIZE | Returns the number of entries in the cache
|===
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Stats Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.STATS
-| *Context*: Embedded / Remote
-
-*Description*: Returns statistics about the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.STATS | Returns statistics about the cache
|===
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Query Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.QUERY
-| *Context*: Remote
-
-*Description*: Executes a query on the cache
-
-*Required Headers*: CamelInfinispanQueryBuilder
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.QUERY | Executes a query on the cache
|===
+* *Required Headers*:
+** CamelInfinispanQueryBuilder
+* *Result Header*:
+** CamelInfinispanOperationResult
+
[NOTE]
====
-Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null result.
+Write methods like put(key, value) and remove(key) do not return the previous value by default.
====
-
-
== Message Headers
[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
@@ -426,439 +305,197 @@ Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null
|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
-|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event. Possible values defined here org.infinispan.notifications.cachelistener.event.Event.Type
-|CamelInfinispanIsPre |`null` |Boolean |Consumer |Infinispan fires two events for each operation: one before and one after the operation.
+|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event.
|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
-|CamelInfinispanIgnoreReturnValues |null |Boolean |Producer |If this header is set, the return value for cache operation returning something is ignored by the client application
|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
|=======================================================================
-== Examples
-
-* Retrieve a specific key from the default cache using a custom cache container:
-
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer");
-----
+== Examples
* Put a key/value into a named cache:
+
[source,java]
----
from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan:myCacheName");
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT) // <1>
+ .setHeader(InfinispanConstants.KEY).constant("123") // <2>
+ .to("infinispan:myCacheName&cacheContainer=#cacheContainer"); // <3>
----
-
-* Put a value with lifespan
-
-[source,java]
+<1> Set the operation to perform
+<2> Set the key used to identify the element in the cache
+<3> Use the configured cache manager `cacheContainer` from the registry to put an element to the cache named `myCacheName`
++
+It is possible to configure the lifetime and/or the idle time before the entry expires and gets evicted from the cache, as example:
++
+[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
.setHeader(InfinispanConstants.KEY).constant("123")
- .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L)
- .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString())
+ .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L) // <1>
+ .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString()) // <2>
.to("infinispan:myCacheName");
----
+<1> Set the lifespan of the entry
+<2> Set the time unit for the lifespan
-* Compute operation through a remapping function on the default cache using a custom cache container:
-
-[source,java]
-----
-@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer&remappingFunction=#mappingFunction");
-----
-
-This will return oldValue + "replay".
-
-This can be done also as async operation, with the `InfinispanOperation.COMPUTEASYNC` operation
-
-* Retrieve a specific key from the remote cache using a cache container configuration with additional parameters (host, port and protocol version):
-
-[source,java]
-----
-org.infinispan.client.hotrod.configuration.Configuration cacheContainerConfiguration = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
- .addServer()
- .host("localhost")
- .port(9999)
- .version(org.infinispan.client.hotrod.ProtocolVersion.PROTOCOL_VERSION_25)
- .build();
-...
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainerConfiguration=#cacheContainerConfiguration");
-----
-
-
-
-=== XML examples
-
-Routing can also be performed using XML configuration.
-The following example demonstrates `camel-infinispan` `local-camel-producer`, a camel route that sends data to an embedded cache created by the `local-cache` module.
-
-[source,java,options="nowrap"]
-----
-<camelContext id="local-producer" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="timer://local?fixedRate=true&period=5000"/>
- <setHeader headerName="CamelInfinispanKey">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanValue">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <to uri="infinispan://foo?cacheContainer=#cacheManager"/>
- <to uri="log:local-put?showAll=true"/>
- </route>
-</camelContext>
-----
-
-
-The provided example requires you to instantiate the [class]``cacheManager``.
-
-You can instantiate the [class]``cacheManager`` bean for Spring XML as follows:
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <constructor-arg type="java.lang.String" value="infinispan.xml"/>
-</bean>
-----
-
-
-The following demonstrates how to instantiate the [class]``cacheManager`` bean using Blueprint XML.
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-----
-
-[NOTE]
-====
-Both the Spring XML and Blueprint XML examples use the configuration file [path]_infinispan.xml_
- for configuration of the cache. This file must be present on the classpath.
-====
-
-
-== Remote Query
-
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
-
-.Using only Java
-====
+* Queries
++
[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
- .setHeader(InfinispanConstants.QUERY_BUILDER,
- new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class).having("name").like("%abc%")
- .build();
+ .setHeader(InfinispanConstants.QUERY_BUILDER, new InfinispanQueryBuilder() {
+ @Override
+ public Query build(QueryFactory<Query> qf) {
+ return qf.from(User.class).having("name").like("%abc%").build();
}
- })
- .to("infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache") ;
+ })
+ .to("infinispan:myCacheName?cacheContainer=#cacheManager") ;
----
-====
++
-.Using Blueprint and Java
+[NOTE]
====
-.Java [class]``RemoteCacheManagerFactory`` class:
-[source,java,options="nowrap"]
-----
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
- }
-}
-----
-.Java [class]``InfinispanQueryExample`` class:
-[source,java,options="nowrap"]
-----
-public class InfinispanQueryExample {
- public InfinispanQueryBuilder getBuilder() {
- return new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class)
- .having("name")
- .like("%abc%")
- .build();
- }
- }
- }
-}
-----
-.blueprint.xml:
-[source,xml,options="nowrap"]
-----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
-</bean>
-
-<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:start"/>
- <setHeader headerName="CamelInfinispanOperation">
- <constant>CamelInfinispanOperationQuery</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanQueryBuilder">
- <method ref="queryBuilder" method="getBuilder"/>
- </setHeader>
- <to uri="infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache"/>
- </route>
-</camelContext>
-----
+The .proto descriptors for domain objects must be registered with the remote Data Grid server, see https://infinispan.org/docs/stable/titles/developing/developing.html#remote_query_example[Remote Query Example] in the official Infinispan documentation.
====
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-
-In addition, there are the following requirements:
-
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
-
-
-== Custom Listeners for Embedded Cache
-
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
-
-.Using Java
-
+* Custom Listeners
++
[source,java,options="nowrap"]
----
-from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener")
+from("infinispan://?cacheContainer=#cacheManager&customListener=#myCustomListener")
.to("mock:result");
----
-
-.Using Blueprint
-
-[source,xml,options="nowrap"]
-----
-<bean id="myCustomContainer" org.infinispan.manager.DefaultCacheManager"
- init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
- </route>
-</camelContext>
-----
-
-
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
-
-[NOTE]
-====
-Custom filters and converters for embedded caches are currently not supported.
-====
++
+The instance of `myCustomListener` must exist and Camel should be able to look it up from the `Registry`.
+Users are encouraged to extend the `org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener` class and annotate the resulting class with `@ClientListener` which can be found found in package `org.infinispan.client.hotrod.annotation`.
-== Custom Listeners for Remote Cache
+== Using the Infinispan based idempotent repository
-Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
+In this section we will use the Infinispan based idempotent repository.
-.Using only Java
-====
-[source,java,options="nowrap"]
-----
-from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener")
- .to(mock:result);
+.Java Example
+[source,java]
----
-====
+InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
+conf.setHosts("localhost:1122")
-.Using Blueprint and Java
-====
-.Java class:
-[source,java,options="nowrap"]
-----
+InfinispanRemoteIdempotentRepository repo = new InfinispanRemoteIdempotentRepository("idempotent"); // <2>
+repo.setConfiguration(conf);
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
+context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .idempotentConsumer(header("MessageID"), repo) // <3>
+ .to("mock:result");
}
-}
+});
----
-.blueprint.xml:
-[source,xml,options="nowrap"]
+<1> Configure the cache
+<2> Configure the repository bean
+<3> Set the repository to the route
+
+.XML Example
+[source,xml]
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteIdempotentRepository" destroy-method="stop">
+ <constructor-arg value="idempotent"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
+ <property name="hosts" value="localhost:11222"/>
+ </bean>
+ </property>
</bean>
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
- <from uri="infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
+ <from uri="direct:start" />
+ <idempotentConsumer messageIdRepositoryRef="infinispanRepo"> <3>
+ <header>MessageID</header>
+ <to uri="mock:result" />
+ </idempotentConsumer>
</route>
</camelContext>
----
-====
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
+== Using the Infinispan based aggregation repository
-Remote listeners may also be associated with custom filters and converters as shown below:
-[source,java,options="nowrap"]
-----
-@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
- private static class MyCustomListener extends InfinispanRemoteCustomListener {
-}
-----
+In this section we will use the Infinispan based aggregation repository.
-In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
-[source,java,options="nowrap"]
+.Java Example
+[source,java]
----
-import org.infinispan.notifications.cachelistener.filter;
+InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
+conf.setHosts("localhost:1122")
-@NamedFactory(name = "static-converter-factory")
-public static class StaticConverterFactory implements CacheEventConverterFactory {
- @Override
- public CacheEventConverter<Integer, String, CustomEvent> getConverter(Object[] params) {
- ...
- }
+InfinispanRemoteAggregationRepository repo = new InfinispanRemoteAggregationRepository(); // <2>
+repo.setCacheName("aggregation");
+repo.setConfiguration(conf);
- static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
- @Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
- }
- }
-}
-
-@NamedFactory(name = "static-filter-factory")
-public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
- @Override
- public CacheEventFilter<Integer, String> getFilter(final Object[] params) {
- ...
- }
-
- static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
+context.addRoutes(new RouteBuilder() {
@Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
+ public void configure() {
+ from("direct:start")
+ .aggregate(header("MessageID"))
+ .completionSize(3)
+ .aggregationRepository(repo) // <3>
+ .aggregationStrategyRef("myStrategy")
+ .to("mock:result");
}
- }
-}
-----
-
-Custom filters and converters must be registered with the server.
-.
-
-[NOTE]
-====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
-====
-
-[NOTE]
-====
-With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
-For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
-====
-
-== Using the Infinispan based idempotent repository
-
-In this section we will use the Infinispan based idempotent repository.
-
-First, we need to create a cacheManager and then configure our
-
-[source,java]
-----
-org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository:
+});
----
+<1> Configure the cache
+<2> Create the repository bean
+<3> Set the repository to the route
+.XML Example
[source,xml]
----
-<!-- set up the cache manager -->
-<bean id="cacheManager"
- class="org.infinispan.manager.DefaultCacheManager"
- init-method="start"
- destroy-method="stop"/>
-
-<!-- set up the repository -->
-<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository"
- factory-method="infinispanIdempotentRepository">
- <argument ref="cacheManager"/>
- <argument value="idempotent"/>
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository" destroy-method="stop">
+ <constructor-arg value="aggregation"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
+ <property name="hosts" value="localhost:11222"/>
+ </bean>
+ </property>
</bean>
-----
-Then we can create our Infinispan idempotent repository in the spring
-XML file as well:
-
-[source,xml]
-----
<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route id="JpaMessageIdRepositoryTest">
+ <route>
<from uri="direct:start" />
- <idempotentConsumer messageIdRepositoryRef="infinispanStore">
- <header>messageId</header>
- <to uri="mock:result" />
- </idempotentConsumer>
+ <aggregate strategyRef="myStrategy"
+ completionSize="3"
+ aggregationRepositoryRef="infinispanRepo"> <3>
+ <correlationExpression>
+ <header>MessageID</header>
+ </correlationExpression>
+ <to uri="mock:result"/>
+ </aggregate>
</route>
</camelContext>
----
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
+
+[NOTE]
+====
+With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
+For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
+====
+
+
include::camel-spring-boot::page$infinispan-starter.adoc[]
diff --git a/components/camel-infinispan/src/main/docs/infinispan-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
similarity index 85%
copy from components/camel-infinispan/src/main/docs/infinispan-component.adoc
copy to catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
index 536546c..1b78ba5 100644
--- a/components/camel-infinispan/src/main/docs/infinispan-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
@@ -1,12 +1,12 @@
-[[infinispan-component]]
-= Infinispan Component
-:docTitle: Infinispan
+[[infinispan-embedded-component]]
+= Infinispan Embedded Component
+:docTitle: Infinispan Embedded
:artifactId: camel-infinispan
:description: Read and write from/to Infinispan distributed key/value store and data grid.
:since: 2.13
:supportLevel: Stable
:component-header: Both producer and consumer are supported
-include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan.adoc[opts=optional]
+include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan-embedded.adoc[opts=optional]
*Since Camel {since}*
@@ -28,9 +28,6 @@ This can be done synchronously or asynchronously, and is also supported with a r
The `camel-infinispan` producer uses ``GET``, ``PUT``, ``REMOVE``, and `CLEAR` operations.
The local producer is also supported with a replicated or distributed cache.
-* *Remote Camel Producer* - In Remote Client-Server mode, the Camel producer can send messages using Hot Rod.
-
-* *Remote Camel Consumer* - In Client-Server mode, receives cache change notifications and sends them to be processed.
The events are processed asynchronously.
If you use Maven, you must add the following dependency to your `pom.xml`:
@@ -49,7 +46,7 @@ If you use Maven, you must add the following dependency to your `pom.xml`:
[source,java]
-------------------------------
-infinispan://cacheName?[options]
+infinispan-embedded://cacheName?[options]
-------------------------------
== URI Options
@@ -63,22 +60,20 @@ If no cache configuration is provided, embedded cacheContainer is created direct
// component options: START
-The Infinispan component supports 29 options, which are listed below.
+The Infinispan Embedded component supports 21 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *configuration* (common) | Component configuration | | InfinispanConfiguration
-| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
+| *configuration* (common) | Component configuration | | InfinispanEmbeddedConfiguration
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
| *key* (producer) | Set a specific key for producer operations | | Object
@@ -86,19 +81,13 @@ The Infinispan component supports 29 options, which are listed below.
| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
| *value* (producer) | Set a specific value for producer operations | | Object
-| *password* ( security) | Define the password to access the infinispan instance | | String
-| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
-| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
-| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
-| *username* ( security) | Define the username to access the infinispan instance | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
-| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// component options: END
@@ -106,10 +95,10 @@ The Infinispan component supports 29 options, which are listed below.
// endpoint options: START
-The Infinispan endpoint is configured using URI syntax:
+The Infinispan Embedded endpoint is configured using URI syntax:
----
-infinispan:cacheName
+infinispan-embedded:cacheName
----
with the following path and query parameters:
@@ -124,20 +113,18 @@ with the following path and query parameters:
|===
-=== Query Parameters (29 parameters):
+=== Query Parameters (21 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
@@ -147,18 +134,12 @@ with the following path and query parameters:
| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
| *value* (producer) | Set a specific value for producer operations | | Object
-| *password* ( security) | Define the password to access the infinispan instance | | String
-| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
-| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
-| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
-| *username* ( security) | Define the username to access the infinispan instance | | String
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
-| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
@@ -477,7 +458,7 @@ from("direct:start")
[source,java]
----
@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
+BiFunction<String, String, String> comp = (k, v) -> v + "replay";
from("direct:start")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
@@ -562,7 +543,7 @@ Both the Spring XML and Blueprint XML examples use the configuration file [path]
== Remote Query
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
+When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
.Using only Java
====
@@ -583,10 +564,10 @@ from("direct:start")
.Using Blueprint and Java
====
-.Java [class]``RemoteCacheManagerFactory`` class:
+.Java [class]``RemoteCacheManagerFactory`` class:
[source,java,options="nowrap"]
----
-public class RemoteCacheManagerFactory {
+public class RemoteCacheManagerFactory {
ConfigurationBuilder clientBuilder;
public RemoteCacheManagerFactory(String hostname, int port) {
clientBuilder = new ConfigurationBuilder();
@@ -598,7 +579,7 @@ public class RemoteCacheManagerFactory {
}
}
----
-.Java [class]``InfinispanQueryExample`` class:
+.Java [class]``InfinispanQueryExample`` class:
[source,java,options="nowrap"]
----
public class InfinispanQueryExample {
@@ -614,17 +595,17 @@ public class InfinispanQueryExample {
}
}
----
-.blueprint.xml:
+.blueprint.xml:
[source,xml,options="nowrap"]
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
+<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
+ <argument value=”localhost”/>
+ <argument value="11222”/>
</bean>
-
+
<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+ factory-ref=”remoteCacheManagerFactory”
+ factory-method=“newRemoteCacheManager”>
</bean>
<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
@@ -644,18 +625,18 @@ public class InfinispanQueryExample {
----
====
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
+The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-In addition, there are the following requirements:
+In addition, there are the following requirements:
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
+* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
+* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
+* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
== Custom Listeners for Embedded Cache
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
+Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
.Using Java
@@ -675,7 +656,7 @@ from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&
</bean>
<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
+
<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
@@ -687,18 +668,18 @@ from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&
The instance of [class]``myCustomListener`` must exist.
Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
+.
[NOTE]
====
-Custom filters and converters for embedded caches are currently not supported.
+Custom filters and converters for embedded caches are currently not supported.
====
== Custom Listeners for Remote Cache
Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
+For instance:
.Using only Java
====
@@ -711,11 +692,11 @@ from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCus
.Using Blueprint and Java
====
-.Java class:
+.Java class:
[source,java,options="nowrap"]
----
-public class RemoteCacheManagerFactory {
+public class RemoteCacheManagerFactory {
ConfigurationBuilder clientBuilder;
public RemoteCacheManagerFactory(String hostname, int port) {
clientBuilder = new ConfigurationBuilder();
@@ -727,17 +708,17 @@ public class RemoteCacheManagerFactory {
}
}
----
-.blueprint.xml:
+.blueprint.xml:
[source,xml,options="nowrap"]
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
+<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
+ <argument value=”localhost”/>
+ <argument value="11222”/>
</bean>
-
+
<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+ factory-ref=”remoteCacheManagerFactory”
+ factory-method=“newRemoteCacheManager”>
</bean>
<bean id="myCustomListener" class="org.example.com.CustomListener"/>
@@ -753,9 +734,9 @@ public class RemoteCacheManagerFactory {
The instance of [class]``myCustomListener`` must exist.
Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
+.
-Remote listeners may also be associated with custom filters and converters as shown below:
+Remote listeners may also be associated with custom filters and converters as shown below:
[source,java,options="nowrap"]
----
@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
@@ -764,7 +745,7 @@ Remote listeners may also be associated with custom filters and converters as sh
----
In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
+A skeleton that implements the necessary methods is shown below:
[source,java,options="nowrap"]
----
import org.infinispan.notifications.cachelistener.filter;
@@ -778,13 +759,13 @@ public static class StaticConverterFactory implements CacheEventConverterFactory
static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
@Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
+ public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
String value, Metadata metadata, EventType eventType) {
...
}
}
}
-
+
@NamedFactory(name = "static-filter-factory")
public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
@Override
@@ -794,7 +775,7 @@ public static class StaticCacheEventFilterFactory implements CacheEventFilterFac
static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
@Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
+ public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
String value, Metadata metadata, EventType eventType) {
...
}
@@ -803,11 +784,11 @@ public static class StaticCacheEventFilterFactory implements CacheEventFilterFac
----
Custom filters and converters must be registered with the server.
-.
+.
[NOTE]
====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
+In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
====
[NOTE]
@@ -837,7 +818,7 @@ org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentR
<!-- set up the repository -->
<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository"
+ class="org.apache.camel.component.infinispan.InfinispanIdempotentRepository"
factory-method="infinispanIdempotentRepository">
<argument ref="cacheManager"/>
<argument value="idempotent"/>
diff --git a/components/camel-infinispan/pom.xml b/components/camel-infinispan/pom.xml
index 3061177..564d9fa 100644
--- a/components/camel-infinispan/pom.xml
+++ b/components/camel-infinispan/pom.xml
@@ -63,9 +63,24 @@
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
+ <artifactId>infinispan-query</artifactId>
+ <version>${infinispan-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
<version>${infinispan-version}</version>
</dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-marshaller-protostuff</artifactId>
+ <version>${infinispan-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-jboss-marshalling</artifactId>
+ <version>${infinispan-version}</version>
+ </dependency>
<!-- testing -->
<dependency>
@@ -94,7 +109,7 @@
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
- <artifactId>infinispan-marshaller-protostuff</artifactId>
+ <artifactId>infinispan-spring5-embedded</artifactId>
<version>${infinispan-version}</version>
<scope>test</scope>
</dependency>
@@ -120,6 +135,16 @@
<artifactId>camel-test-junit5</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-log</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- test infra -->
<dependency>
@@ -151,12 +176,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
- <systemProperties>
- <property>
- <name>infinispan.test.jgroups.protocol</name>
- <value>tcp</value>
- </property>
- </systemProperties>
+ <systemProperties>
+ <property>
+ <name>infinispan.test.jgroups.protocol</name>
+ <value>tcp</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
</plugins>
@@ -180,12 +205,12 @@
<systemPropertyVariables>
<visibleassertions.silence>true</visibleassertions.silence>
</systemPropertyVariables>
- <systemProperties>
- <property>
- <name>infinispan.test.jgroups.protocol</name>
- <value>tcp</value>
- </property>
- </systemProperties>
+ <systemProperties>
+ <property>
+ <name>infinispan.test.jgroups.protocol</name>
+ <value>tcp</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
</plugins>
@@ -209,12 +234,12 @@
<systemPropertyVariables>
<visibleassertions.silence>true</visibleassertions.silence>
</systemPropertyVariables>
- <systemProperties>
- <property>
- <name>infinispan.test.jgroups.protocol</name>
- <value>tcp</value>
- </property>
- </systemProperties>
+ <systemProperties>
+ <property>
+ <name>infinispan.test.jgroups.protocol</name>
+ <value>tcp</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
</plugins>
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
similarity index 66%
copy from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java
copy to components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
index 2c395ea..c30640a 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java
+++ b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponentConfigurer.java
@@ -1,5 +1,5 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.embedded;
import java.util.Map;
@@ -15,65 +15,53 @@ import org.apache.camel.support.component.PropertyConfigurerSupport;
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class InfinispanComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class InfinispanEmbeddedComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
- private org.apache.camel.component.infinispan.InfinispanConfiguration getOrCreateConfiguration(InfinispanComponent target) {
+ private org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration getOrCreateConfiguration(InfinispanEmbeddedComponent target) {
if (target.getConfiguration() == null) {
- target.setConfiguration(new org.apache.camel.component.infinispan.InfinispanConfiguration());
+ target.setConfiguration(new org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration());
}
return target.getConfiguration();
}
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- InfinispanComponent target = (InfinispanComponent) obj;
+ InfinispanEmbeddedComponent target = (InfinispanEmbeddedComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "cachecontainer":
- case "cacheContainer": getOrCreateConfiguration(target).setCacheContainer(property(camelContext, org.infinispan.commons.api.BasicCacheContainer.class, value)); return true;
+ case "cacheContainer": getOrCreateConfiguration(target).setCacheContainer(property(camelContext, org.infinispan.manager.EmbeddedCacheManager.class, value)); return true;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": getOrCreateConfiguration(target).setCacheContainerConfiguration(property(camelContext, java.lang.Object.class, value)); return true;
+ case "cacheContainerConfiguration": getOrCreateConfiguration(target).setCacheContainerConfiguration(property(camelContext, org.infinispan.configuration.cache.Configuration.class, value)); return true;
case "clusteredlistener":
case "clusteredListener": getOrCreateConfiguration(target).setClusteredListener(property(camelContext, boolean.class, value)); return true;
case "command": getOrCreateConfiguration(target).setCommand(property(camelContext, java.lang.String.class, value)); return true;
- case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.infinispan.InfinispanConfiguration.class, value)); return true;
- case "configurationproperties":
- case "configurationProperties": getOrCreateConfiguration(target).setConfigurationProperties(property(camelContext, java.util.Map.class, value)); return true;
+ case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration.class, value)); return true;
case "configurationuri":
case "configurationUri": getOrCreateConfiguration(target).setConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
case "customlistener":
- case "customListener": getOrCreateConfiguration(target).setCustomListener(property(camelContext, org.apache.camel.component.infinispan.InfinispanCustomListener.class, value)); return true;
+ case "customListener": getOrCreateConfiguration(target).setCustomListener(property(camelContext, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener.class, value)); return true;
case "defaultvalue":
case "defaultValue": getOrCreateConfiguration(target).setDefaultValue(property(camelContext, java.lang.Object.class, value)); return true;
case "eventtypes":
case "eventTypes": getOrCreateConfiguration(target).setEventTypes(property(camelContext, java.lang.String.class, value)); return true;
case "flags": getOrCreateConfiguration(target).setFlags(property(camelContext, java.lang.String.class, value)); return true;
- case "hosts": getOrCreateConfiguration(target).setHosts(property(camelContext, java.lang.String.class, value)); return true;
case "key": getOrCreateConfiguration(target).setKey(property(camelContext, java.lang.Object.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "oldvalue":
case "oldValue": getOrCreateConfiguration(target).setOldValue(property(camelContext, java.lang.Object.class, value)); return true;
case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.infinispan.InfinispanOperation.class, value)); return true;
- case "password": getOrCreateConfiguration(target).setPassword(property(camelContext, java.lang.String.class, value)); return true;
case "querybuilder":
case "queryBuilder": getOrCreateConfiguration(target).setQueryBuilder(property(camelContext, org.apache.camel.component.infinispan.InfinispanQueryBuilder.class, value)); return true;
case "remappingfunction":
case "remappingFunction": getOrCreateConfiguration(target).setRemappingFunction(property(camelContext, java.util.function.BiFunction.class, value)); return true;
case "resultheader":
- case "resultHeader": getOrCreateConfiguration(target).setResultHeader(property(camelContext, java.lang.Object.class, value)); return true;
- case "saslmechanism":
- case "saslMechanism": getOrCreateConfiguration(target).setSaslMechanism(property(camelContext, java.lang.String.class, value)); return true;
- case "secure": getOrCreateConfiguration(target).setSecure(property(camelContext, boolean.class, value)); return true;
- case "securityrealm":
- case "securityRealm": getOrCreateConfiguration(target).setSecurityRealm(property(camelContext, java.lang.String.class, value)); return true;
- case "securityservername":
- case "securityServerName": getOrCreateConfiguration(target).setSecurityServerName(property(camelContext, java.lang.String.class, value)); return true;
+ case "resultHeader": getOrCreateConfiguration(target).setResultHeader(property(camelContext, java.lang.String.class, value)); return true;
case "sync": getOrCreateConfiguration(target).setSync(property(camelContext, boolean.class, value)); return true;
- case "username": getOrCreateConfiguration(target).setUsername(property(camelContext, java.lang.String.class, value)); return true;
case "value": getOrCreateConfiguration(target).setValue(property(camelContext, java.lang.Object.class, value)); return true;
default: return false;
}
@@ -81,7 +69,7 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
@Override
public String[] getAutowiredNames() {
- return new String[]{"cacheContainer"};
+ return new String[]{"cacheContainer","cacheContainerConfiguration"};
}
@Override
@@ -92,47 +80,35 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "bridgeerrorhandler":
case "bridgeErrorHandler": return boolean.class;
case "cachecontainer":
- case "cacheContainer": return org.infinispan.commons.api.BasicCacheContainer.class;
+ case "cacheContainer": return org.infinispan.manager.EmbeddedCacheManager.class;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": return java.lang.Object.class;
+ case "cacheContainerConfiguration": return org.infinispan.configuration.cache.Configuration.class;
case "clusteredlistener":
case "clusteredListener": return boolean.class;
case "command": return java.lang.String.class;
- case "configuration": return org.apache.camel.component.infinispan.InfinispanConfiguration.class;
- case "configurationproperties":
- case "configurationProperties": return java.util.Map.class;
+ case "configuration": return org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration.class;
case "configurationuri":
case "configurationUri": return java.lang.String.class;
case "customlistener":
- case "customListener": return org.apache.camel.component.infinispan.InfinispanCustomListener.class;
+ case "customListener": return org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener.class;
case "defaultvalue":
case "defaultValue": return java.lang.Object.class;
case "eventtypes":
case "eventTypes": return java.lang.String.class;
case "flags": return java.lang.String.class;
- case "hosts": return java.lang.String.class;
case "key": return java.lang.Object.class;
case "lazystartproducer":
case "lazyStartProducer": return boolean.class;
case "oldvalue":
case "oldValue": return java.lang.Object.class;
case "operation": return org.apache.camel.component.infinispan.InfinispanOperation.class;
- case "password": return java.lang.String.class;
case "querybuilder":
case "queryBuilder": return org.apache.camel.component.infinispan.InfinispanQueryBuilder.class;
case "remappingfunction":
case "remappingFunction": return java.util.function.BiFunction.class;
case "resultheader":
- case "resultHeader": return java.lang.Object.class;
- case "saslmechanism":
- case "saslMechanism": return java.lang.String.class;
- case "secure": return boolean.class;
- case "securityrealm":
- case "securityRealm": return java.lang.String.class;
- case "securityservername":
- case "securityServerName": return java.lang.String.class;
+ case "resultHeader": return java.lang.String.class;
case "sync": return boolean.class;
- case "username": return java.lang.String.class;
case "value": return java.lang.Object.class;
default: return null;
}
@@ -140,7 +116,7 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- InfinispanComponent target = (InfinispanComponent) obj;
+ InfinispanEmbeddedComponent target = (InfinispanEmbeddedComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": return target.isAutowiredEnabled();
@@ -154,8 +130,6 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "clusteredListener": return getOrCreateConfiguration(target).isClusteredListener();
case "command": return getOrCreateConfiguration(target).getCommand();
case "configuration": return target.getConfiguration();
- case "configurationproperties":
- case "configurationProperties": return getOrCreateConfiguration(target).getConfigurationProperties();
case "configurationuri":
case "configurationUri": return getOrCreateConfiguration(target).getConfigurationUri();
case "customlistener":
@@ -165,41 +139,22 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "eventtypes":
case "eventTypes": return getOrCreateConfiguration(target).getEventTypes();
case "flags": return getOrCreateConfiguration(target).getFlags();
- case "hosts": return getOrCreateConfiguration(target).getHosts();
case "key": return getOrCreateConfiguration(target).getKey();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
case "oldvalue":
case "oldValue": return getOrCreateConfiguration(target).getOldValue();
case "operation": return getOrCreateConfiguration(target).getOperation();
- case "password": return getOrCreateConfiguration(target).getPassword();
case "querybuilder":
case "queryBuilder": return getOrCreateConfiguration(target).getQueryBuilder();
case "remappingfunction":
case "remappingFunction": return getOrCreateConfiguration(target).getRemappingFunction();
case "resultheader":
case "resultHeader": return getOrCreateConfiguration(target).getResultHeader();
- case "saslmechanism":
- case "saslMechanism": return getOrCreateConfiguration(target).getSaslMechanism();
- case "secure": return getOrCreateConfiguration(target).isSecure();
- case "securityrealm":
- case "securityRealm": return getOrCreateConfiguration(target).getSecurityRealm();
- case "securityservername":
- case "securityServerName": return getOrCreateConfiguration(target).getSecurityServerName();
case "sync": return getOrCreateConfiguration(target).isSync();
- case "username": return getOrCreateConfiguration(target).getUsername();
case "value": return getOrCreateConfiguration(target).getValue();
default: return null;
}
}
-
- @Override
- public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "configurationproperties":
- case "configurationProperties": return java.lang.String.class;
- default: return null;
- }
- }
}
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
similarity index 67%
copy from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java
copy to components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
index 242a2b0..3dd246e 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java
+++ b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointConfigurer.java
@@ -1,5 +1,5 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.embedded;
import java.util.Map;
@@ -15,27 +15,25 @@ import org.apache.camel.support.component.PropertyConfigurerSupport;
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class InfinispanEmbeddedEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- InfinispanEndpoint target = (InfinispanEndpoint) obj;
+ InfinispanEmbeddedEndpoint target = (InfinispanEmbeddedEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "cachecontainer":
- case "cacheContainer": target.getConfiguration().setCacheContainer(property(camelContext, org.infinispan.commons.api.BasicCacheContainer.class, value)); return true;
+ case "cacheContainer": target.getConfiguration().setCacheContainer(property(camelContext, org.infinispan.manager.EmbeddedCacheManager.class, value)); return true;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": target.getConfiguration().setCacheContainerConfiguration(property(camelContext, java.lang.Object.class, value)); return true;
+ case "cacheContainerConfiguration": target.getConfiguration().setCacheContainerConfiguration(property(camelContext, org.infinispan.configuration.cache.Configuration.class, value)); return true;
case "clusteredlistener":
case "clusteredListener": target.getConfiguration().setClusteredListener(property(camelContext, boolean.class, value)); return true;
case "command": target.getConfiguration().setCommand(property(camelContext, java.lang.String.class, value)); return true;
- case "configurationproperties":
- case "configurationProperties": target.getConfiguration().setConfigurationProperties(property(camelContext, java.util.Map.class, value)); return true;
case "configurationuri":
case "configurationUri": target.getConfiguration().setConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
case "customlistener":
- case "customListener": target.getConfiguration().setCustomListener(property(camelContext, org.apache.camel.component.infinispan.InfinispanCustomListener.class, value)); return true;
+ case "customListener": target.getConfiguration().setCustomListener(property(camelContext, org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener.class, value)); return true;
case "defaultvalue":
case "defaultValue": target.getConfiguration().setDefaultValue(property(camelContext, java.lang.Object.class, value)); return true;
case "eventtypes":
@@ -45,29 +43,19 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "exchangepattern":
case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
case "flags": target.getConfiguration().setFlags(property(camelContext, java.lang.String.class, value)); return true;
- case "hosts": target.getConfiguration().setHosts(property(camelContext, java.lang.String.class, value)); return true;
case "key": target.getConfiguration().setKey(property(camelContext, java.lang.Object.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "oldvalue":
case "oldValue": target.getConfiguration().setOldValue(property(camelContext, java.lang.Object.class, value)); return true;
case "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.infinispan.InfinispanOperation.class, value)); return true;
- case "password": target.getConfiguration().setPassword(property(camelContext, java.lang.String.class, value)); return true;
case "querybuilder":
case "queryBuilder": target.getConfiguration().setQueryBuilder(property(camelContext, org.apache.camel.component.infinispan.InfinispanQueryBuilder.class, value)); return true;
case "remappingfunction":
case "remappingFunction": target.getConfiguration().setRemappingFunction(property(camelContext, java.util.function.BiFunction.class, value)); return true;
case "resultheader":
- case "resultHeader": target.getConfiguration().setResultHeader(property(camelContext, java.lang.Object.class, value)); return true;
- case "saslmechanism":
- case "saslMechanism": target.getConfiguration().setSaslMechanism(property(camelContext, java.lang.String.class, value)); return true;
- case "secure": target.getConfiguration().setSecure(property(camelContext, boolean.class, value)); return true;
- case "securityrealm":
- case "securityRealm": target.getConfiguration().setSecurityRealm(property(camelContext, java.lang.String.class, value)); return true;
- case "securityservername":
- case "securityServerName": target.getConfiguration().setSecurityServerName(property(camelContext, java.lang.String.class, value)); return true;
+ case "resultHeader": target.getConfiguration().setResultHeader(property(camelContext, java.lang.String.class, value)); return true;
case "sync": target.getConfiguration().setSync(property(camelContext, boolean.class, value)); return true;
- case "username": target.getConfiguration().setUsername(property(camelContext, java.lang.String.class, value)); return true;
case "value": target.getConfiguration().setValue(property(camelContext, java.lang.Object.class, value)); return true;
default: return false;
}
@@ -75,7 +63,7 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
@Override
public String[] getAutowiredNames() {
- return new String[]{"cacheContainer"};
+ return new String[]{"cacheContainer","cacheContainerConfiguration"};
}
@Override
@@ -84,18 +72,16 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "bridgeerrorhandler":
case "bridgeErrorHandler": return boolean.class;
case "cachecontainer":
- case "cacheContainer": return org.infinispan.commons.api.BasicCacheContainer.class;
+ case "cacheContainer": return org.infinispan.manager.EmbeddedCacheManager.class;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": return java.lang.Object.class;
+ case "cacheContainerConfiguration": return org.infinispan.configuration.cache.Configuration.class;
case "clusteredlistener":
case "clusteredListener": return boolean.class;
case "command": return java.lang.String.class;
- case "configurationproperties":
- case "configurationProperties": return java.util.Map.class;
case "configurationuri":
case "configurationUri": return java.lang.String.class;
case "customlistener":
- case "customListener": return org.apache.camel.component.infinispan.InfinispanCustomListener.class;
+ case "customListener": return org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener.class;
case "defaultvalue":
case "defaultValue": return java.lang.Object.class;
case "eventtypes":
@@ -105,29 +91,19 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "exchangepattern":
case "exchangePattern": return org.apache.camel.ExchangePattern.class;
case "flags": return java.lang.String.class;
- case "hosts": return java.lang.String.class;
case "key": return java.lang.Object.class;
case "lazystartproducer":
case "lazyStartProducer": return boolean.class;
case "oldvalue":
case "oldValue": return java.lang.Object.class;
case "operation": return org.apache.camel.component.infinispan.InfinispanOperation.class;
- case "password": return java.lang.String.class;
case "querybuilder":
case "queryBuilder": return org.apache.camel.component.infinispan.InfinispanQueryBuilder.class;
case "remappingfunction":
case "remappingFunction": return java.util.function.BiFunction.class;
case "resultheader":
- case "resultHeader": return java.lang.Object.class;
- case "saslmechanism":
- case "saslMechanism": return java.lang.String.class;
- case "secure": return boolean.class;
- case "securityrealm":
- case "securityRealm": return java.lang.String.class;
- case "securityservername":
- case "securityServerName": return java.lang.String.class;
+ case "resultHeader": return java.lang.String.class;
case "sync": return boolean.class;
- case "username": return java.lang.String.class;
case "value": return java.lang.Object.class;
default: return null;
}
@@ -135,7 +111,7 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- InfinispanEndpoint target = (InfinispanEndpoint) obj;
+ InfinispanEmbeddedEndpoint target = (InfinispanEmbeddedEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "bridgeerrorhandler":
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
@@ -146,8 +122,6 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "clusteredlistener":
case "clusteredListener": return target.getConfiguration().isClusteredListener();
case "command": return target.getConfiguration().getCommand();
- case "configurationproperties":
- case "configurationProperties": return target.getConfiguration().getConfigurationProperties();
case "configurationuri":
case "configurationUri": return target.getConfiguration().getConfigurationUri();
case "customlistener":
@@ -161,41 +135,22 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "exchangepattern":
case "exchangePattern": return target.getExchangePattern();
case "flags": return target.getConfiguration().getFlags();
- case "hosts": return target.getConfiguration().getHosts();
case "key": return target.getConfiguration().getKey();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
case "oldvalue":
case "oldValue": return target.getConfiguration().getOldValue();
case "operation": return target.getConfiguration().getOperation();
- case "password": return target.getConfiguration().getPassword();
case "querybuilder":
case "queryBuilder": return target.getConfiguration().getQueryBuilder();
case "remappingfunction":
case "remappingFunction": return target.getConfiguration().getRemappingFunction();
case "resultheader":
case "resultHeader": return target.getConfiguration().getResultHeader();
- case "saslmechanism":
- case "saslMechanism": return target.getConfiguration().getSaslMechanism();
- case "secure": return target.getConfiguration().isSecure();
- case "securityrealm":
- case "securityRealm": return target.getConfiguration().getSecurityRealm();
- case "securityservername":
- case "securityServerName": return target.getConfiguration().getSecurityServerName();
case "sync": return target.getConfiguration().isSync();
- case "username": return target.getConfiguration().getUsername();
case "value": return target.getConfiguration().getValue();
default: return null;
}
}
-
- @Override
- public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "configurationproperties":
- case "configurationProperties": return java.lang.String.class;
- default: return null;
- }
- }
}
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
similarity index 74%
copy from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java
copy to components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
index f8cd250..a6e5646 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java
+++ b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpointUriFactory.java
@@ -1,5 +1,5 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.embedded;
import java.net.URISyntaxException;
import java.util.Collections;
@@ -13,53 +13,43 @@ import org.apache.camel.spi.EndpointUriFactory;
/**
* Generated by camel build tools - do NOT edit this file!
*/
-public class InfinispanEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
+public class InfinispanEmbeddedEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
private static final String BASE = ":cacheName";
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(30);
- props.add("defaultValue");
- props.add("flags");
- props.add("secure");
- props.add("resultHeader");
- props.add("configurationUri");
- props.add("clusteredListener");
- props.add("password");
- props.add("cacheName");
- props.add("bridgeErrorHandler");
- props.add("oldValue");
- props.add("configurationProperties");
- props.add("value");
- props.add("key");
- props.add("securityServerName");
+ Set<String> props = new HashSet<>(22);
props.add("customListener");
- props.add("hosts");
- props.add("securityRealm");
+ props.add("defaultValue");
props.add("exchangePattern");
- props.add("saslMechanism");
+ props.add("flags");
props.add("eventTypes");
props.add("cacheContainer");
+ props.add("resultHeader");
props.add("sync");
props.add("command");
+ props.add("configurationUri");
+ props.add("clusteredListener");
props.add("lazyStartProducer");
+ props.add("cacheName");
+ props.add("bridgeErrorHandler");
props.add("remappingFunction");
+ props.add("oldValue");
props.add("cacheContainerConfiguration");
props.add("exceptionHandler");
props.add("operation");
+ props.add("value");
props.add("queryBuilder");
- props.add("username");
+ props.add("key");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
- Set<String> secretProps = new HashSet<>(1);
- secretProps.add("password");
- SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps);
+ SECRET_PROPERTY_NAMES = Collections.emptySet();
}
@Override
public boolean isEnabled(String scheme) {
- return "infinispan".equals(scheme);
+ return "infinispan-embedded".equals(scheme);
}
@Override
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
similarity index 85%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java
rename to components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
index 2c395ea..13da027 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanComponentConfigurer.java
+++ b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponentConfigurer.java
@@ -1,5 +1,5 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.remote;
import java.util.Map;
@@ -15,37 +15,35 @@ import org.apache.camel.support.component.PropertyConfigurerSupport;
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class InfinispanComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class InfinispanRemoteComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
- private org.apache.camel.component.infinispan.InfinispanConfiguration getOrCreateConfiguration(InfinispanComponent target) {
+ private org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration getOrCreateConfiguration(InfinispanRemoteComponent target) {
if (target.getConfiguration() == null) {
- target.setConfiguration(new org.apache.camel.component.infinispan.InfinispanConfiguration());
+ target.setConfiguration(new org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration());
}
return target.getConfiguration();
}
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- InfinispanComponent target = (InfinispanComponent) obj;
+ InfinispanRemoteComponent target = (InfinispanRemoteComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "cachecontainer":
- case "cacheContainer": getOrCreateConfiguration(target).setCacheContainer(property(camelContext, org.infinispan.commons.api.BasicCacheContainer.class, value)); return true;
+ case "cacheContainer": getOrCreateConfiguration(target).setCacheContainer(property(camelContext, org.infinispan.client.hotrod.RemoteCacheManager.class, value)); return true;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": getOrCreateConfiguration(target).setCacheContainerConfiguration(property(camelContext, java.lang.Object.class, value)); return true;
- case "clusteredlistener":
- case "clusteredListener": getOrCreateConfiguration(target).setClusteredListener(property(camelContext, boolean.class, value)); return true;
+ case "cacheContainerConfiguration": getOrCreateConfiguration(target).setCacheContainerConfiguration(property(camelContext, org.infinispan.client.hotrod.configuration.Configuration.class, value)); return true;
case "command": getOrCreateConfiguration(target).setCommand(property(camelContext, java.lang.String.class, value)); return true;
- case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.infinispan.InfinispanConfiguration.class, value)); return true;
+ case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration.class, value)); return true;
case "configurationproperties":
case "configurationProperties": getOrCreateConfiguration(target).setConfigurationProperties(property(camelContext, java.util.Map.class, value)); return true;
case "configurationuri":
case "configurationUri": getOrCreateConfiguration(target).setConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
case "customlistener":
- case "customListener": getOrCreateConfiguration(target).setCustomListener(property(camelContext, org.apache.camel.component.infinispan.InfinispanCustomListener.class, value)); return true;
+ case "customListener": getOrCreateConfiguration(target).setCustomListener(property(camelContext, org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener.class, value)); return true;
case "defaultvalue":
case "defaultValue": getOrCreateConfiguration(target).setDefaultValue(property(camelContext, java.lang.Object.class, value)); return true;
case "eventtypes":
@@ -64,7 +62,7 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "remappingfunction":
case "remappingFunction": getOrCreateConfiguration(target).setRemappingFunction(property(camelContext, java.util.function.BiFunction.class, value)); return true;
case "resultheader":
- case "resultHeader": getOrCreateConfiguration(target).setResultHeader(property(camelContext, java.lang.Object.class, value)); return true;
+ case "resultHeader": getOrCreateConfiguration(target).setResultHeader(property(camelContext, java.lang.String.class, value)); return true;
case "saslmechanism":
case "saslMechanism": getOrCreateConfiguration(target).setSaslMechanism(property(camelContext, java.lang.String.class, value)); return true;
case "secure": getOrCreateConfiguration(target).setSecure(property(camelContext, boolean.class, value)); return true;
@@ -72,7 +70,6 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "securityRealm": getOrCreateConfiguration(target).setSecurityRealm(property(camelContext, java.lang.String.class, value)); return true;
case "securityservername":
case "securityServerName": getOrCreateConfiguration(target).setSecurityServerName(property(camelContext, java.lang.String.class, value)); return true;
- case "sync": getOrCreateConfiguration(target).setSync(property(camelContext, boolean.class, value)); return true;
case "username": getOrCreateConfiguration(target).setUsername(property(camelContext, java.lang.String.class, value)); return true;
case "value": getOrCreateConfiguration(target).setValue(property(camelContext, java.lang.Object.class, value)); return true;
default: return false;
@@ -81,7 +78,7 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
@Override
public String[] getAutowiredNames() {
- return new String[]{"cacheContainer"};
+ return new String[]{"cacheContainer","cacheContainerConfiguration"};
}
@Override
@@ -92,19 +89,17 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "bridgeerrorhandler":
case "bridgeErrorHandler": return boolean.class;
case "cachecontainer":
- case "cacheContainer": return org.infinispan.commons.api.BasicCacheContainer.class;
+ case "cacheContainer": return org.infinispan.client.hotrod.RemoteCacheManager.class;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": return java.lang.Object.class;
- case "clusteredlistener":
- case "clusteredListener": return boolean.class;
+ case "cacheContainerConfiguration": return org.infinispan.client.hotrod.configuration.Configuration.class;
case "command": return java.lang.String.class;
- case "configuration": return org.apache.camel.component.infinispan.InfinispanConfiguration.class;
+ case "configuration": return org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration.class;
case "configurationproperties":
case "configurationProperties": return java.util.Map.class;
case "configurationuri":
case "configurationUri": return java.lang.String.class;
case "customlistener":
- case "customListener": return org.apache.camel.component.infinispan.InfinispanCustomListener.class;
+ case "customListener": return org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener.class;
case "defaultvalue":
case "defaultValue": return java.lang.Object.class;
case "eventtypes":
@@ -123,7 +118,7 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "remappingfunction":
case "remappingFunction": return java.util.function.BiFunction.class;
case "resultheader":
- case "resultHeader": return java.lang.Object.class;
+ case "resultHeader": return java.lang.String.class;
case "saslmechanism":
case "saslMechanism": return java.lang.String.class;
case "secure": return boolean.class;
@@ -131,7 +126,6 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "securityRealm": return java.lang.String.class;
case "securityservername":
case "securityServerName": return java.lang.String.class;
- case "sync": return boolean.class;
case "username": return java.lang.String.class;
case "value": return java.lang.Object.class;
default: return null;
@@ -140,7 +134,7 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- InfinispanComponent target = (InfinispanComponent) obj;
+ InfinispanRemoteComponent target = (InfinispanRemoteComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "autowiredenabled":
case "autowiredEnabled": return target.isAutowiredEnabled();
@@ -150,8 +144,6 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "cacheContainer": return getOrCreateConfiguration(target).getCacheContainer();
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": return getOrCreateConfiguration(target).getCacheContainerConfiguration();
- case "clusteredlistener":
- case "clusteredListener": return getOrCreateConfiguration(target).isClusteredListener();
case "command": return getOrCreateConfiguration(target).getCommand();
case "configuration": return target.getConfiguration();
case "configurationproperties":
@@ -186,7 +178,6 @@ public class InfinispanComponentConfigurer extends PropertyConfigurerSupport imp
case "securityRealm": return getOrCreateConfiguration(target).getSecurityRealm();
case "securityservername":
case "securityServerName": return getOrCreateConfiguration(target).getSecurityServerName();
- case "sync": return getOrCreateConfiguration(target).isSync();
case "username": return getOrCreateConfiguration(target).getUsername();
case "value": return getOrCreateConfiguration(target).getValue();
default: return null;
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
similarity index 86%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java
rename to components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
index 242a2b0..46f2c08 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointConfigurer.java
+++ b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointConfigurer.java
@@ -1,5 +1,5 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.remote;
import java.util.Map;
@@ -15,27 +15,25 @@ import org.apache.camel.support.component.PropertyConfigurerSupport;
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
-public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+public class InfinispanRemoteEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- InfinispanEndpoint target = (InfinispanEndpoint) obj;
+ InfinispanRemoteEndpoint target = (InfinispanRemoteEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "cachecontainer":
- case "cacheContainer": target.getConfiguration().setCacheContainer(property(camelContext, org.infinispan.commons.api.BasicCacheContainer.class, value)); return true;
+ case "cacheContainer": target.getConfiguration().setCacheContainer(property(camelContext, org.infinispan.client.hotrod.RemoteCacheManager.class, value)); return true;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": target.getConfiguration().setCacheContainerConfiguration(property(camelContext, java.lang.Object.class, value)); return true;
- case "clusteredlistener":
- case "clusteredListener": target.getConfiguration().setClusteredListener(property(camelContext, boolean.class, value)); return true;
+ case "cacheContainerConfiguration": target.getConfiguration().setCacheContainerConfiguration(property(camelContext, org.infinispan.client.hotrod.configuration.Configuration.class, value)); return true;
case "command": target.getConfiguration().setCommand(property(camelContext, java.lang.String.class, value)); return true;
case "configurationproperties":
case "configurationProperties": target.getConfiguration().setConfigurationProperties(property(camelContext, java.util.Map.class, value)); return true;
case "configurationuri":
case "configurationUri": target.getConfiguration().setConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
case "customlistener":
- case "customListener": target.getConfiguration().setCustomListener(property(camelContext, org.apache.camel.component.infinispan.InfinispanCustomListener.class, value)); return true;
+ case "customListener": target.getConfiguration().setCustomListener(property(camelContext, org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener.class, value)); return true;
case "defaultvalue":
case "defaultValue": target.getConfiguration().setDefaultValue(property(camelContext, java.lang.Object.class, value)); return true;
case "eventtypes":
@@ -58,7 +56,7 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "remappingfunction":
case "remappingFunction": target.getConfiguration().setRemappingFunction(property(camelContext, java.util.function.BiFunction.class, value)); return true;
case "resultheader":
- case "resultHeader": target.getConfiguration().setResultHeader(property(camelContext, java.lang.Object.class, value)); return true;
+ case "resultHeader": target.getConfiguration().setResultHeader(property(camelContext, java.lang.String.class, value)); return true;
case "saslmechanism":
case "saslMechanism": target.getConfiguration().setSaslMechanism(property(camelContext, java.lang.String.class, value)); return true;
case "secure": target.getConfiguration().setSecure(property(camelContext, boolean.class, value)); return true;
@@ -66,7 +64,6 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "securityRealm": target.getConfiguration().setSecurityRealm(property(camelContext, java.lang.String.class, value)); return true;
case "securityservername":
case "securityServerName": target.getConfiguration().setSecurityServerName(property(camelContext, java.lang.String.class, value)); return true;
- case "sync": target.getConfiguration().setSync(property(camelContext, boolean.class, value)); return true;
case "username": target.getConfiguration().setUsername(property(camelContext, java.lang.String.class, value)); return true;
case "value": target.getConfiguration().setValue(property(camelContext, java.lang.Object.class, value)); return true;
default: return false;
@@ -75,7 +72,7 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
@Override
public String[] getAutowiredNames() {
- return new String[]{"cacheContainer"};
+ return new String[]{"cacheContainer","cacheContainerConfiguration"};
}
@Override
@@ -84,18 +81,16 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "bridgeerrorhandler":
case "bridgeErrorHandler": return boolean.class;
case "cachecontainer":
- case "cacheContainer": return org.infinispan.commons.api.BasicCacheContainer.class;
+ case "cacheContainer": return org.infinispan.client.hotrod.RemoteCacheManager.class;
case "cachecontainerconfiguration":
- case "cacheContainerConfiguration": return java.lang.Object.class;
- case "clusteredlistener":
- case "clusteredListener": return boolean.class;
+ case "cacheContainerConfiguration": return org.infinispan.client.hotrod.configuration.Configuration.class;
case "command": return java.lang.String.class;
case "configurationproperties":
case "configurationProperties": return java.util.Map.class;
case "configurationuri":
case "configurationUri": return java.lang.String.class;
case "customlistener":
- case "customListener": return org.apache.camel.component.infinispan.InfinispanCustomListener.class;
+ case "customListener": return org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener.class;
case "defaultvalue":
case "defaultValue": return java.lang.Object.class;
case "eventtypes":
@@ -118,7 +113,7 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "remappingfunction":
case "remappingFunction": return java.util.function.BiFunction.class;
case "resultheader":
- case "resultHeader": return java.lang.Object.class;
+ case "resultHeader": return java.lang.String.class;
case "saslmechanism":
case "saslMechanism": return java.lang.String.class;
case "secure": return boolean.class;
@@ -126,7 +121,6 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "securityRealm": return java.lang.String.class;
case "securityservername":
case "securityServerName": return java.lang.String.class;
- case "sync": return boolean.class;
case "username": return java.lang.String.class;
case "value": return java.lang.Object.class;
default: return null;
@@ -135,7 +129,7 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- InfinispanEndpoint target = (InfinispanEndpoint) obj;
+ InfinispanRemoteEndpoint target = (InfinispanRemoteEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "bridgeerrorhandler":
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
@@ -143,8 +137,6 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "cacheContainer": return target.getConfiguration().getCacheContainer();
case "cachecontainerconfiguration":
case "cacheContainerConfiguration": return target.getConfiguration().getCacheContainerConfiguration();
- case "clusteredlistener":
- case "clusteredListener": return target.getConfiguration().isClusteredListener();
case "command": return target.getConfiguration().getCommand();
case "configurationproperties":
case "configurationProperties": return target.getConfiguration().getConfigurationProperties();
@@ -182,7 +174,6 @@ public class InfinispanEndpointConfigurer extends PropertyConfigurerSupport impl
case "securityRealm": return target.getConfiguration().getSecurityRealm();
case "securityservername":
case "securityServerName": return target.getConfiguration().getSecurityServerName();
- case "sync": return target.getConfiguration().isSync();
case "username": return target.getConfiguration().getUsername();
case "value": return target.getConfiguration().getValue();
default: return null;
diff --git a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
similarity index 89%
rename from components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java
rename to components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
index f8cd250..05fff13 100644
--- a/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/InfinispanEndpointUriFactory.java
+++ b/components/camel-infinispan/src/generated/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpointUriFactory.java
@@ -1,5 +1,5 @@
/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.remote;
import java.net.URISyntaxException;
import java.util.Collections;
@@ -13,20 +13,19 @@ import org.apache.camel.spi.EndpointUriFactory;
/**
* Generated by camel build tools - do NOT edit this file!
*/
-public class InfinispanEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
+public class InfinispanRemoteEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
private static final String BASE = ":cacheName";
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(30);
+ Set<String> props = new HashSet<>(28);
props.add("defaultValue");
props.add("flags");
props.add("secure");
props.add("resultHeader");
props.add("configurationUri");
- props.add("clusteredListener");
props.add("password");
props.add("cacheName");
props.add("bridgeErrorHandler");
@@ -42,7 +41,6 @@ public class InfinispanEndpointUriFactory extends org.apache.camel.support.compo
props.add("saslMechanism");
props.add("eventTypes");
props.add("cacheContainer");
- props.add("sync");
props.add("command");
props.add("lazyStartProducer");
props.add("remappingFunction");
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
index 264ec2d..93f4fdf 100644
--- a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component.properties
@@ -1,5 +1,5 @@
# Generated by camel build tools - do NOT edit this file!
-components=infinispan
+components=infinispan infinispan-embedded
groupId=org.apache.camel
artifactId=camel-infinispan
version=3.8.0-SNAPSHOT
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
index cae7803..036617c 100644
--- a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.infinispan.InfinispanComponent
+class=org.apache.camel.component.infinispan.remote.InfinispanRemoteComponent
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded
new file mode 100644
index 0000000..515946c
--- /dev/null
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/component/infinispan-embedded
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponent
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
index efed46a..dcaa2b0 100644
--- a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-component
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.infinispan.InfinispanComponentConfigurer
+class=org.apache.camel.component.infinispan.remote.InfinispanRemoteComponentConfigurer
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component
new file mode 100644
index 0000000..4fb54d1
--- /dev/null
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-component
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponentConfigurer
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint
new file mode 100644
index 0000000..fd077f7
--- /dev/null
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-embedded-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedEndpointConfigurer
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
index 3273ad7..47efe2b 100644
--- a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/configurer/infinispan-endpoint
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.infinispan.InfinispanEndpointConfigurer
+class=org.apache.camel.component.infinispan.remote.InfinispanRemoteEndpointConfigurer
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint
new file mode 100644
index 0000000..43c2898
--- /dev/null
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-embedded-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedEndpointUriFactory
diff --git a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
index fab9388..1db86b6 100644
--- a/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
+++ b/components/camel-infinispan/src/generated/resources/META-INF/services/org/apache/camel/urifactory/infinispan-endpoint
@@ -1,2 +1,2 @@
# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.infinispan.InfinispanEndpointUriFactory
+class=org.apache.camel.component.infinispan.remote.InfinispanRemoteEndpointUriFactory
diff --git a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json b/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
new file mode 100644
index 0000000..62c5705
--- /dev/null
+++ b/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/embedded/infinispan-embedded.json
@@ -0,0 +1,71 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "infinispan-embedded",
+ "title": "Infinispan Embedded",
+ "description": "Read and write from\/to Infinispan distributed key\/value store and data grid.",
+ "deprecated": false,
+ "firstVersion": "2.13.0",
+ "label": "cache,datagrid,clustering",
+ "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedComponent",
+ "supportLevel": "Stable",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-infinispan",
+ "version": "3.8.0-SNAPSHOT",
+ "scheme": "infinispan-embedded",
+ "extendsScheme": "",
+ "syntax": "infinispan-embedded:cacheName",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": false,
+ "lenientProperties": false
+ },
+ "componentProperties": {
+ "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
+ "queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
+ "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
+ "clusteredListener": { "kind": "property", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
+ "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
+ "customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom list [...]
+ "eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated b [...]
+ "sync": { "kind": "property", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
+ "defaultValue": { "kind": "property", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
+ "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
+ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
+ "oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
+ "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
+ "value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
+ "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
+ "cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
+ "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The C [...]
+ "configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
+ "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remot [...]
+ "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHead [...]
+ },
+ "properties": {
+ "cacheName": { "kind": "path", "displayName": "Cache Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name." },
+ "queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
+ "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
+ "clusteredListener": { "kind": "parameter", "displayName": "Clustered Listener", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the listener will be installed for the entire cluster" },
+ "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
+ "customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Returns the custom lis [...]
+ "eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated [...]
+ "sync": { "kind": "parameter", "displayName": "Sync", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "If true, the consumer will receive notifications synchronously" },
+ "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
+ "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
+ "defaultValue": { "kind": "parameter", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
+ "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
+ "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
+ "oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
+ "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
+ "value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
+ "cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.manager.EmbeddedCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to con [...]
+ "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.configuration.cache.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "The [...]
+ "configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
+ "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remo [...]
+ "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHea [...]
+ }
+}
diff --git a/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json b/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
new file mode 100644
index 0000000..6950d79
--- /dev/null
+++ b/components/camel-infinispan/src/generated/resources/org/apache/camel/component/infinispan/remote/infinispan.json
@@ -0,0 +1,83 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "infinispan",
+ "title": "Infinispan",
+ "description": "Read and write from\/to Infinispan distributed key\/value store and data grid.",
+ "deprecated": false,
+ "firstVersion": "2.13.0",
+ "label": "cache,datagrid,clustering",
+ "javaType": "org.apache.camel.component.infinispan.remote.InfinispanRemoteComponent",
+ "supportLevel": "Stable",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-infinispan",
+ "version": "3.8.0-SNAPSHOT",
+ "scheme": "infinispan",
+ "extendsScheme": "",
+ "syntax": "infinispan:cacheName",
+ "async": false,
+ "api": false,
+ "consumerOnly": false,
+ "producerOnly": false,
+ "lenientProperties": false
+ },
+ "componentProperties": {
+ "configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration" },
+ "hosts": { "kind": "property", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the host of the cache on Infinispan instance" },
+ "queryBuilder": { "kind": "property", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
+ "secure": { "kind": "property", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
+ "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
+ "command": { "kind": "property", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
+ "customListener": { "kind": "property", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in [...]
+ "eventTypes": { "kind": "property", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated by co [...]
+ "defaultValue": { "kind": "property", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
+ "key": { "kind": "property", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
+ "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
+ "oldValue": { "kind": "property", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
+ "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], [...]
+ "value": { "kind": "property", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
+ "password": { "kind": "property", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
+ "saslMechanism": { "kind": "property", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
+ "securityRealm": { "kind": "property", "displayName": "Security Realm", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the security realm to access the infinispan instance" },
+ "securityServerName": { "kind": "property", "displayName": "Security Server Name", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the security server name to access the infinispan instance" },
+ "username": { "kind": "property", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
+ "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
+ "cacheContainer": { "kind": "property", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.RemoteCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to connect" },
+ "cacheContainerConfiguration": { "kind": "property", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.configuration.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "T [...]
+ "configurationProperties": { "kind": "property", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for [...]
+ "configurationUri": { "kind": "property", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
+ "flags": { "kind": "property", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote ca [...]
+ "remappingFunction": { "kind": "property", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "resultHeader": { "kind": "property", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader = [...]
+ },
+ "properties": {
+ "cacheName": { "kind": "path", "displayName": "Cache Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name." },
+ "hosts": { "kind": "parameter", "displayName": "Hosts", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the host of the cache on Infinispan instance" },
+ "queryBuilder": { "kind": "parameter", "displayName": "Query Builder", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the query builder." },
+ "secure": { "kind": "parameter", "displayName": "Secure", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define if we are connecting to a secured Infinispan instance" },
+ "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
+ "command": { "kind": "parameter", "displayName": "Command", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": true, "autowired": false, "secret": false, "defaultValue": "PUT", "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "The operation to perform." },
+ "customListener": { "kind": "parameter", "displayName": "Custom Listener", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Returns the custom listener in [...]
+ "eventTypes": { "kind": "parameter", "displayName": "Event Types", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the set of event types to register by the consumer.Multiple event can be separated by c [...]
+ "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
+ "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
+ "defaultValue": { "kind": "parameter", "displayName": "Default Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific default value for some producer operations" },
+ "key": { "kind": "parameter", "displayName": "Key", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific key for producer operations" },
+ "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during sta [...]
+ "oldValue": { "kind": "parameter", "displayName": "Old Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific old value for some producer operations" },
+ "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ] [...]
+ "value": { "kind": "parameter", "displayName": "Value", "group": "producer", "label": "producer", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific value for producer operations" },
+ "password": { "kind": "parameter", "displayName": "Password", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the password to access the infinispan instance" },
+ "saslMechanism": { "kind": "parameter", "displayName": "Sasl Mechanism", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the SASL Mechanism to access the infinispan instance" },
+ "securityRealm": { "kind": "parameter", "displayName": "Security Realm", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the security realm to access the infinispan instance" },
+ "securityServerName": { "kind": "parameter", "displayName": "Security Server Name", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the security server name to access the infinispan instance" },
+ "username": { "kind": "parameter", "displayName": "Username", "group": " security", "label": "common, security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Define the username to access the infinispan instance" },
+ "cacheContainer": { "kind": "parameter", "displayName": "Cache Container", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.RemoteCacheManager", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Specifies the cache Container to con [...]
+ "cacheContainerConfiguration": { "kind": "parameter", "displayName": "Cache Container Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.infinispan.client.hotrod.configuration.Configuration", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": " [...]
+ "configurationProperties": { "kind": "parameter", "displayName": "Configuration Properties", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.String>", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Implementation specific properties for [...]
+ "configurationUri": { "kind": "parameter", "displayName": "Configuration Uri", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "An implementation specific URI for the CacheManager" },
+ "flags": { "kind": "parameter", "displayName": "Flags", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote c [...]
+ "remappingFunction": { "kind": "parameter", "displayName": "Remapping Function", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "java.util.function.BiFunction", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Set a specific remappingFunction to use in a compute operation" },
+ "resultHeader": { "kind": "parameter", "displayName": "Result Header", "group": "advanced", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration", "configurationField": "configuration", "description": "Store the operation result in a header instead of the message body. By default, resultHeader [...]
+ }
+}
diff --git a/components/camel-infinispan/src/main/docs/infinispan-component.adoc b/components/camel-infinispan/src/main/docs/infinispan-component.adoc
index 536546c..440016f 100644
--- a/components/camel-infinispan/src/main/docs/infinispan-component.adoc
+++ b/components/camel-infinispan/src/main/docs/infinispan-component.adoc
@@ -12,27 +12,11 @@ include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan
*{component-header}*
-This component allows you to interact with
-http://infinispan.org/[Infinispan] distributed data grid / cache.
-Infinispan is an extremely scalable, highly available key/value data
-store and data grid platform written in Java.
+This component allows you to interact with http://infinispan.org/[Infinispan] distributed data grid / cache using the Hot Rod procol.
+Infinispan is an extremely scalable, highly available key/value data store and data grid platform written in Java.
Infinispan requires at least Java 8.
-The `camel-infinispan` component includes the following features:
-
-* *Local Camel Consumer* - Receives cache change notifications and sends them to be processed.
-This can be done synchronously or asynchronously, and is also supported with a replicated or distributed cache.
-
-* *Local Camel Producer* - A producer creates and sends messages to an endpoint.
-The `camel-infinispan` producer uses ``GET``, ``PUT``, ``REMOVE``, and `CLEAR` operations.
-The local producer is also supported with a replicated or distributed cache.
-
-* *Remote Camel Producer* - In Remote Client-Server mode, the Camel producer can send messages using Hot Rod.
-
-* *Remote Camel Consumer* - In Client-Server mode, receives cache change notifications and sends them to be processed.
-The events are processed asynchronously.
-
If you use Maven, you must add the following dependency to your `pom.xml`:
[source,xml]
@@ -54,13 +38,8 @@ infinispan://cacheName?[options]
== URI Options
-The producer allows sending messages to a local infinispan cache
-configured in the registry, or to a remote cache using the HotRod
-protocol. The consumer allows listening for events from local infinispan cache
-accessible from the registry.
-
-If no cache configuration is provided, embedded cacheContainer is created directly in the component.
-
+The producer allows sending messages to a remote cache using the HotRod protocol.
+The consumer allows listening for events from a remote cache using the HotRod protocol.
// component options: START
The Infinispan component supports 29 options, which are listed below.
@@ -166,256 +145,156 @@ with the following path and query parameters:
This section lists all available operations, along with their header information.
.Put Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUT
-| *Context*: Embedded / Remote
-
-*Description*: Puts a key/value pair in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.PUTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENT
-| *Description*: Puts a key/value pair in the cache if it did not exist, optionally with expiration
-
-
-| InfinispanOperation.PUTIFABSENTASYNC
-| *Description*: Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUT | Puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTASYNC | Asynchronously puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTIFABSENT | Puts a key/value pair in the cache if it did not exist, optionally with expiration
+| InfinispanOperation.PUTIFABSENTASYNC | Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Put All Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.PUTALL
-| *Context*: Embedded / Remote
-
-*Description*: Adds multiple entries to a cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanMap
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit
-
-*Result Header*: None
-
-| CamelInfinispanOperation.PUTALLASYNC
-| *Description*: Asynchronously adds multiple entries to a cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.PUTALL | Adds multiple entries to a cache, optionally with expiration
+| CamelInfinispanOperation.PUTALLASYNC | Asynchronously adds multiple entries to a cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanMap
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+
.Get Operations
-[cols="40%,60%", frame="all", options="header"]
+[cols="40%,60%a", frame="all", options="header"]
|===
-|Operation Name
-|Description
-
-| InfinispanOperation.GET
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.GETORDEFAULT
-| *Context*: Embedded / Remote
-
-*Description*: Retrieves the value, or default value, associated with a specific key from the cache
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: None
+|Operation Name |Description
+| InfinispanOperation.GET | Retrieves the value associated with a specific key from the cache
+| InfinispanOperation.GETORDEFAULT | Retrieves the value, or default value, associated with a specific key from the cache
|===
+* *Required Headers*:
+** CamelInfinispanKey
+
.Contains Key Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSKEY
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific key
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.CONTAINSKEY | Determines whether a cache contains a specific key
|===
+* *Required Headers*
+** CamelInfinispanKey
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Contains Value Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CONTAINSVALUE | Determines whether a cache contains a specific value
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CONTAINSVALUE
-| *Context*: Embedded / Remote
-
-*Description*: Determines whether a cache contains a specific value
-
-*Required Headers*: CamelInfinispanKey
-*Optional Headers*: None
+* *Required Headers*:
+** CamelInfinispanKey
-*Result Headers*: None
-|===
.Remove Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REMOVE
-| *Context*: Embedded / Remote
-
-*Description*: Removes an entry from a cache, optionally only if the value matches a given one
-
-*Required Headers*: CamelInfinispanKey
-
-*Optional Headers*: CamelInfinispanValue
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REMOVEASYNC
-| *Description*: Asynchronously removes an entry from a cache, optionally only if the value matches a given one
-
+| Operation Name | Description
+| InfinispanOperation.REMOVE | Removes an entry from a cache, optionally only if the value matches a given one
+| InfinispanOperation.REMOVEASYNC | Asynchronously removes an entry from a cache, optionally only if the value matches a given one
|===
+* *Required Headers*:
+** CamelInfinispanKey
+* *Optional Headers*:
+** CamelInfinispanValue
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Replace Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.REPLACE
-| *Context*: Embedded / Remote
-
-*Description*: Conditionally replaces an entry in the cache, optionally with expiration
-
-*Required Headers*: CamelInfinispanKey, CamelInfinispanValue, CamelInfinispanOldValue
-
-*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
-
-*Result Header*: CamelInfinispanOperationResult
-
-| InfinispanOperation.REPLACEASYNC
-| *Description*: Asynchronously conditionally replaces an entry in the cache, optionally with expiration
-
+| Operation Name | Description
+| InfinispanOperation.REPLACE | Conditionally replaces an entry in the cache, optionally with expiration
+| InfinispanOperation.REPLACEASYNC | Asynchronously conditionally replaces an entry in the cache, optionally with expiration
|===
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+** CamelInfinispanOldValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Clear Operations
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.CLEAR
-| *Context*: Embedded / Remote
-
-*Description*: Clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
-
-| InfinispanOperation.CLEARASYNC
-| *Context*: Embedded / Remote
-
-*Description*: Asynchronously clears the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: None
+| Operation Name | Description
+| InfinispanOperation.CLEAR | Clears the cache
+| InfinispanOperation.CLEARASYNC | Asynchronously clears the cache
|===
.Size Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.SIZE
-| *Context*: Embedded / Remote
-
-*Description*: Returns the number of entries in the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.SIZE | Returns the number of entries in the cache
|===
+* *Result Header*
+** CamelInfinispanOperationResult
+
.Stats Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.STATS
-| *Context*: Embedded / Remote
-
-*Description*: Returns statistics about the cache
-
-*Required Headers*: None
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.STATS | Returns statistics about the cache
|===
+* *Result Header*:
+** CamelInfinispanOperationResult
+
.Query Operation
-[cols="40%,60%", options="header"]
+[cols="40%,60%a", options="header"]
|===
-| Operation Name
-| Description
-
-| InfinispanOperation.QUERY
-| *Context*: Remote
-
-*Description*: Executes a query on the cache
-
-*Required Headers*: CamelInfinispanQueryBuilder
-
-*Optional Headers*: None
-
-*Result Header*: CamelInfinispanOperationResult
+| Operation Name | Description
+| InfinispanOperation.QUERY | Executes a query on the cache
|===
+* *Required Headers*:
+** CamelInfinispanQueryBuilder
+* *Result Header*:
+** CamelInfinispanOperationResult
+
[NOTE]
====
-Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null result.
+Write methods like put(key, value) and remove(key) do not return the previous value by default.
====
-
-
== Message Headers
[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
@@ -426,439 +305,197 @@ Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null
|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
-|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event. Possible values defined here org.infinispan.notifications.cachelistener.event.Event.Type
-|CamelInfinispanIsPre |`null` |Boolean |Consumer |Infinispan fires two events for each operation: one before and one after the operation.
+|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event.
|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
-|CamelInfinispanIgnoreReturnValues |null |Boolean |Producer |If this header is set, the return value for cache operation returning something is ignored by the client application
|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
|=======================================================================
-== Examples
-
-* Retrieve a specific key from the default cache using a custom cache container:
-
-[source,java]
-----
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer");
-----
+== Examples
* Put a key/value into a named cache:
+
[source,java]
----
from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan:myCacheName");
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT) // <1>
+ .setHeader(InfinispanConstants.KEY).constant("123") // <2>
+ .to("infinispan:myCacheName&cacheContainer=#cacheContainer"); // <3>
----
-
-* Put a value with lifespan
-
-[source,java]
+<1> Set the operation to perform
+<2> Set the key used to identify the element in the cache
+<3> Use the configured cache manager `cacheContainer` from the registry to put an element to the cache named `myCacheName`
++
+It is possible to configure the lifetime and/or the idle time before the entry expires and gets evicted from the cache, as example:
++
+[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
.setHeader(InfinispanConstants.KEY).constant("123")
- .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L)
- .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString())
+ .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L) // <1>
+ .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString()) // <2>
.to("infinispan:myCacheName");
----
+<1> Set the lifespan of the entry
+<2> Set the time unit for the lifespan
-* Compute operation through a remapping function on the default cache using a custom cache container:
-
-[source,java]
-----
-@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainer=#cacheContainer&remappingFunction=#mappingFunction");
-----
-
-This will return oldValue + "replay".
-
-This can be done also as async operation, with the `InfinispanOperation.COMPUTEASYNC` operation
-
-* Retrieve a specific key from the remote cache using a cache container configuration with additional parameters (host, port and protocol version):
-
-[source,java]
-----
-org.infinispan.client.hotrod.configuration.Configuration cacheContainerConfiguration = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
- .addServer()
- .host("localhost")
- .port(9999)
- .version(org.infinispan.client.hotrod.ProtocolVersion.PROTOCOL_VERSION_25)
- .build();
-...
-
-from("direct:start")
- .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
- .setHeader(InfinispanConstants.KEY).constant("123")
- .to("infinispan?cacheContainerConfiguration=#cacheContainerConfiguration");
-----
-
-
-
-=== XML examples
-
-Routing can also be performed using XML configuration.
-The following example demonstrates `camel-infinispan` `local-camel-producer`, a camel route that sends data to an embedded cache created by the `local-cache` module.
-
-[source,java,options="nowrap"]
-----
-<camelContext id="local-producer" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="timer://local?fixedRate=true&period=5000"/>
- <setHeader headerName="CamelInfinispanKey">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanValue">
- <constant>CamelTimerCounter</constant>
- </setHeader>
- <to uri="infinispan://foo?cacheContainer=#cacheManager"/>
- <to uri="log:local-put?showAll=true"/>
- </route>
-</camelContext>
-----
-
-
-The provided example requires you to instantiate the [class]``cacheManager``.
-
-You can instantiate the [class]``cacheManager`` bean for Spring XML as follows:
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <constructor-arg type="java.lang.String" value="infinispan.xml"/>
-</bean>
-----
-
-
-The following demonstrates how to instantiate the [class]``cacheManager`` bean using Blueprint XML.
-
-[source,xml,options="nowrap"]
-----
-<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-----
-
-[NOTE]
-====
-Both the Spring XML and Blueprint XML examples use the configuration file [path]_infinispan.xml_
- for configuration of the cache. This file must be present on the classpath.
-====
-
-
-== Remote Query
-
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
-
-.Using only Java
-====
+* Queries
++
[source,java,options="nowrap"]
----
from("direct:start")
.setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
- .setHeader(InfinispanConstants.QUERY_BUILDER,
- new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class).having("name").like("%abc%")
- .build();
+ .setHeader(InfinispanConstants.QUERY_BUILDER, new InfinispanQueryBuilder() {
+ @Override
+ public Query build(QueryFactory<Query> qf) {
+ return qf.from(User.class).having("name").like("%abc%").build();
}
- })
- .to("infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache") ;
+ })
+ .to("infinispan:myCacheName?cacheContainer=#cacheManager") ;
----
-====
++
-.Using Blueprint and Java
+[NOTE]
====
-.Java [class]``RemoteCacheManagerFactory`` class:
-[source,java,options="nowrap"]
-----
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
- }
-}
-----
-.Java [class]``InfinispanQueryExample`` class:
-[source,java,options="nowrap"]
-----
-public class InfinispanQueryExample {
- public InfinispanQueryBuilder getBuilder() {
- return new InfinispanQueryBuilder() {
- public Query build(QueryFactory<Query> queryFactory) {
- return queryFactory.from(User.class)
- .having("name")
- .like("%abc%")
- .build();
- }
- }
- }
-}
-----
-.blueprint.xml:
-[source,xml,options="nowrap"]
-----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
-</bean>
-
-<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="direct:start"/>
- <setHeader headerName="CamelInfinispanOperation">
- <constant>CamelInfinispanOperationQuery</constant>
- </setHeader>
- <setHeader headerName="CamelInfinispanQueryBuilder">
- <method ref="queryBuilder" method="getBuilder"/>
- </setHeader>
- <to uri="infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache"/>
- </route>
-</camelContext>
-----
+The .proto descriptors for domain objects must be registered with the remote Data Grid server, see https://infinispan.org/docs/stable/titles/developing/developing.html#remote_query_example[Remote Query Example] in the official Infinispan documentation.
====
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-
-In addition, there are the following requirements:
-
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
-
-
-== Custom Listeners for Embedded Cache
-
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
-
-.Using Java
-
+* Custom Listeners
++
[source,java,options="nowrap"]
----
-from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener")
+from("infinispan://?cacheContainer=#cacheManager&customListener=#myCustomListener")
.to("mock:result");
----
-
-.Using Blueprint
-
-[source,xml,options="nowrap"]
-----
-<bean id="myCustomContainer" org.infinispan.manager.DefaultCacheManager"
- init-method="start" destroy-method="stop">
- <argument value="infinispan.xml" />
-</bean>
-
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
- <route>
- <from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
- </route>
-</camelContext>
-----
-
-
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
-
-[NOTE]
-====
-Custom filters and converters for embedded caches are currently not supported.
-====
++
+The instance of `myCustomListener` must exist and Camel should be able to look it up from the `Registry`.
+Users are encouraged to extend the `org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener` class and annotate the resulting class with `@ClientListener` which can be found found in package `org.infinispan.client.hotrod.annotation`.
-== Custom Listeners for Remote Cache
+== Using the Infinispan based idempotent repository
-Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
+In this section we will use the Infinispan based idempotent repository.
-.Using only Java
-====
-[source,java,options="nowrap"]
-----
-from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener")
- .to(mock:result);
+.Java Example
+[source,java]
----
-====
+InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
+conf.setHosts("localhost:1122")
-.Using Blueprint and Java
-====
-.Java class:
-[source,java,options="nowrap"]
-----
+InfinispanRemoteIdempotentRepository repo = new InfinispanRemoteIdempotentRepository("idempotent"); // <2>
+repo.setConfiguration(conf);
-public class RemoteCacheManagerFactory {
- ConfigurationBuilder clientBuilder;
- public RemoteCacheManagerFactory(String hostname, int port) {
- clientBuilder = new ConfigurationBuilder();
- clientBuilder.addServer()
- .host(hostname).port(port);
- }
- public RemoteCacheManager newRemoteCacheManager() {
- return new RemoteCacheManager(clientBuilder.build());
+context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .idempotentConsumer(header("MessageID"), repo) // <3>
+ .to("mock:result");
}
-}
+});
----
-.blueprint.xml:
-[source,xml,options="nowrap"]
+<1> Configure the cache
+<2> Configure the repository bean
+<3> Set the repository to the route
+
+.XML Example
+[source,xml]
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
-</bean>
-
-<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteIdempotentRepository" destroy-method="stop">
+ <constructor-arg value="idempotent"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
+ <property name="hosts" value="localhost:11222"/>
+ </bean>
+ </property>
</bean>
-<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
-<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
- <from uri="infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener"/>
- <to uri="mock:result"/>
+ <from uri="direct:start" />
+ <idempotentConsumer messageIdRepositoryRef="infinispanRepo"> <3>
+ <header>MessageID</header>
+ <to uri="mock:result" />
+ </idempotentConsumer>
</route>
</camelContext>
----
-====
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
-The instance of [class]``myCustomListener`` must exist.
-Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
+== Using the Infinispan based aggregation repository
-Remote listeners may also be associated with custom filters and converters as shown below:
-[source,java,options="nowrap"]
-----
-@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
- private static class MyCustomListener extends InfinispanRemoteCustomListener {
-}
-----
+In this section we will use the Infinispan based aggregation repository.
-In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
-[source,java,options="nowrap"]
+.Java Example
+[source,java]
----
-import org.infinispan.notifications.cachelistener.filter;
+InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
+conf.setHosts("localhost:1122")
-@NamedFactory(name = "static-converter-factory")
-public static class StaticConverterFactory implements CacheEventConverterFactory {
- @Override
- public CacheEventConverter<Integer, String, CustomEvent> getConverter(Object[] params) {
- ...
- }
+InfinispanRemoteAggregationRepository repo = new InfinispanRemoteAggregationRepository(); // <2>
+repo.setCacheName("aggregation");
+repo.setConfiguration(conf);
- static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
- @Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
- }
- }
-}
-
-@NamedFactory(name = "static-filter-factory")
-public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
- @Override
- public CacheEventFilter<Integer, String> getFilter(final Object[] params) {
- ...
- }
-
- static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
+context.addRoutes(new RouteBuilder() {
@Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
- String value, Metadata metadata, EventType eventType) {
- ...
+ public void configure() {
+ from("direct:start")
+ .aggregate(header("MessageID"))
+ .completionSize(3)
+ .aggregationRepository(repo) // <3>
+ .aggregationStrategyRef("myStrategy")
+ .to("mock:result");
}
- }
-}
-----
-
-Custom filters and converters must be registered with the server.
-.
-
-[NOTE]
-====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
-====
-
-[NOTE]
-====
-With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
-For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
-====
-
-== Using the Infinispan based idempotent repository
-
-In this section we will use the Infinispan based idempotent repository.
-
-First, we need to create a cacheManager and then configure our
-
-[source,java]
-----
-org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository:
+});
----
+<1> Configure the cache
+<2> Create the repository bean
+<3> Set the repository to the route
+.XML Example
[source,xml]
----
-<!-- set up the cache manager -->
-<bean id="cacheManager"
- class="org.infinispan.manager.DefaultCacheManager"
- init-method="start"
- destroy-method="stop"/>
-
-<!-- set up the repository -->
-<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository"
- factory-method="infinispanIdempotentRepository">
- <argument ref="cacheManager"/>
- <argument value="idempotent"/>
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository" destroy-method="stop">
+ <constructor-arg value="aggregation"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
+ <property name="hosts" value="localhost:11222"/>
+ </bean>
+ </property>
</bean>
-----
-Then we can create our Infinispan idempotent repository in the spring
-XML file as well:
-
-[source,xml]
-----
<camelContext xmlns="http://camel.apache.org/schema/spring">
- <route id="JpaMessageIdRepositoryTest">
+ <route>
<from uri="direct:start" />
- <idempotentConsumer messageIdRepositoryRef="infinispanStore">
- <header>messageId</header>
- <to uri="mock:result" />
- </idempotentConsumer>
+ <aggregate strategyRef="myStrategy"
+ completionSize="3"
+ aggregationRepositoryRef="infinispanRepo"> <3>
+ <correlationExpression>
+ <header>MessageID</header>
+ </correlationExpression>
+ <to uri="mock:result"/>
+ </aggregate>
</route>
</camelContext>
----
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
+
+[NOTE]
+====
+With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
+For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
+====
+
+
include::camel-spring-boot::page$infinispan-starter.adoc[]
diff --git a/components/camel-infinispan/src/main/docs/infinispan-component.adoc b/components/camel-infinispan/src/main/docs/infinispan-embedded-component.adoc
similarity index 85%
copy from components/camel-infinispan/src/main/docs/infinispan-component.adoc
copy to components/camel-infinispan/src/main/docs/infinispan-embedded-component.adoc
index 536546c..1b78ba5 100644
--- a/components/camel-infinispan/src/main/docs/infinispan-component.adoc
+++ b/components/camel-infinispan/src/main/docs/infinispan-embedded-component.adoc
@@ -1,12 +1,12 @@
-[[infinispan-component]]
-= Infinispan Component
-:docTitle: Infinispan
+[[infinispan-embedded-component]]
+= Infinispan Embedded Component
+:docTitle: Infinispan Embedded
:artifactId: camel-infinispan
:description: Read and write from/to Infinispan distributed key/value store and data grid.
:since: 2.13
:supportLevel: Stable
:component-header: Both producer and consumer are supported
-include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan.adoc[opts=optional]
+include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan-embedded.adoc[opts=optional]
*Since Camel {since}*
@@ -28,9 +28,6 @@ This can be done synchronously or asynchronously, and is also supported with a r
The `camel-infinispan` producer uses ``GET``, ``PUT``, ``REMOVE``, and `CLEAR` operations.
The local producer is also supported with a replicated or distributed cache.
-* *Remote Camel Producer* - In Remote Client-Server mode, the Camel producer can send messages using Hot Rod.
-
-* *Remote Camel Consumer* - In Client-Server mode, receives cache change notifications and sends them to be processed.
The events are processed asynchronously.
If you use Maven, you must add the following dependency to your `pom.xml`:
@@ -49,7 +46,7 @@ If you use Maven, you must add the following dependency to your `pom.xml`:
[source,java]
-------------------------------
-infinispan://cacheName?[options]
+infinispan-embedded://cacheName?[options]
-------------------------------
== URI Options
@@ -63,22 +60,20 @@ If no cache configuration is provided, embedded cacheContainer is created direct
// component options: START
-The Infinispan component supports 29 options, which are listed below.
+The Infinispan Embedded component supports 21 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *configuration* (common) | Component configuration | | InfinispanConfiguration
-| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
+| *configuration* (common) | Component configuration | | InfinispanEmbeddedConfiguration
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
| *key* (producer) | Set a specific key for producer operations | | Object
@@ -86,19 +81,13 @@ The Infinispan component supports 29 options, which are listed below.
| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
| *value* (producer) | Set a specific value for producer operations | | Object
-| *password* ( security) | Define the password to access the infinispan instance | | String
-| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
-| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
-| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
-| *username* ( security) | Define the username to access the infinispan instance | | String
| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
-| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// component options: END
@@ -106,10 +95,10 @@ The Infinispan component supports 29 options, which are listed below.
// endpoint options: START
-The Infinispan endpoint is configured using URI syntax:
+The Infinispan Embedded endpoint is configured using URI syntax:
----
-infinispan:cacheName
+infinispan-embedded:cacheName
----
with the following path and query parameters:
@@ -124,20 +113,18 @@ with the following path and query parameters:
|===
-=== Query Parameters (29 parameters):
+=== Query Parameters (21 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
-| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
-| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
| *command* (consumer) | *Deprecated* The operation to perform. | PUT | String
-| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanCustomListener
-| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer. Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED | | String
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
@@ -147,18 +134,12 @@ with the following path and query parameters:
| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
| *value* (producer) | Set a specific value for producer operations | | Object
-| *password* ( security) | Define the password to access the infinispan instance | | String
-| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
-| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
-| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
-| *username* ( security) | Define the username to access the infinispan instance | | String
-| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | BasicCacheContainer
-| *cacheContainerConfiguration* (advanced) | The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Object
-| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation | | BiFunction
-| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | Object
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
|===
// endpoint options: END
@@ -477,7 +458,7 @@ from("direct:start")
[source,java]
----
@BindToRegistry("mappingFunction")
-BiFunction<String, String, String> comp = (k, v) -> v + "replay";
+BiFunction<String, String, String> comp = (k, v) -> v + "replay";
from("direct:start")
.setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
@@ -562,7 +543,7 @@ Both the Spring XML and Blueprint XML examples use the configuration file [path]
== Remote Query
-When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
+When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
.Using only Java
====
@@ -583,10 +564,10 @@ from("direct:start")
.Using Blueprint and Java
====
-.Java [class]``RemoteCacheManagerFactory`` class:
+.Java [class]``RemoteCacheManagerFactory`` class:
[source,java,options="nowrap"]
----
-public class RemoteCacheManagerFactory {
+public class RemoteCacheManagerFactory {
ConfigurationBuilder clientBuilder;
public RemoteCacheManagerFactory(String hostname, int port) {
clientBuilder = new ConfigurationBuilder();
@@ -598,7 +579,7 @@ public class RemoteCacheManagerFactory {
}
}
----
-.Java [class]``InfinispanQueryExample`` class:
+.Java [class]``InfinispanQueryExample`` class:
[source,java,options="nowrap"]
----
public class InfinispanQueryExample {
@@ -614,17 +595,17 @@ public class InfinispanQueryExample {
}
}
----
-.blueprint.xml:
+.blueprint.xml:
[source,xml,options="nowrap"]
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
+<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
+ <argument value=”localhost”/>
+ <argument value="11222”/>
</bean>
-
+
<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+ factory-ref=”remoteCacheManagerFactory”
+ factory-method=“newRemoteCacheManager”>
</bean>
<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
@@ -644,18 +625,18 @@ public class InfinispanQueryExample {
----
====
-The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
+The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
-In addition, there are the following requirements:
+In addition, there are the following requirements:
-* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
-* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
-* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
+* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
+* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
+* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
== Custom Listeners for Embedded Cache
-Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
+Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
.Using Java
@@ -675,7 +656,7 @@ from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&
</bean>
<bean id="myCustomListener" class="org.example.com.CustomListener"/>
-
+
<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
@@ -687,18 +668,18 @@ from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&
The instance of [class]``myCustomListener`` must exist.
Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
-.
+.
[NOTE]
====
-Custom filters and converters for embedded caches are currently not supported.
+Custom filters and converters for embedded caches are currently not supported.
====
== Custom Listeners for Remote Cache
Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
-For instance:
+For instance:
.Using only Java
====
@@ -711,11 +692,11 @@ from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCus
.Using Blueprint and Java
====
-.Java class:
+.Java class:
[source,java,options="nowrap"]
----
-public class RemoteCacheManagerFactory {
+public class RemoteCacheManagerFactory {
ConfigurationBuilder clientBuilder;
public RemoteCacheManagerFactory(String hostname, int port) {
clientBuilder = new ConfigurationBuilder();
@@ -727,17 +708,17 @@ public class RemoteCacheManagerFactory {
}
}
----
-.blueprint.xml:
+.blueprint.xml:
[source,xml,options="nowrap"]
----
-<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
- <argument value=”localhost”/>
- <argument value="11222”/>
+<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
+ <argument value=”localhost”/>
+ <argument value="11222”/>
</bean>
-
+
<bean id=”cacheManager”
- factory-ref=”remoteCacheManagerFactory”
- factory-method=“newRemoteCacheManager”>
+ factory-ref=”remoteCacheManagerFactory”
+ factory-method=“newRemoteCacheManager”>
</bean>
<bean id="myCustomListener" class="org.example.com.CustomListener"/>
@@ -753,9 +734,9 @@ public class RemoteCacheManagerFactory {
The instance of [class]``myCustomListener`` must exist.
Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
-.
+.
-Remote listeners may also be associated with custom filters and converters as shown below:
+Remote listeners may also be associated with custom filters and converters as shown below:
[source,java,options="nowrap"]
----
@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
@@ -764,7 +745,7 @@ Remote listeners may also be associated with custom filters and converters as sh
----
In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
-A skeleton that implements the necessary methods is shown below:
+A skeleton that implements the necessary methods is shown below:
[source,java,options="nowrap"]
----
import org.infinispan.notifications.cachelistener.filter;
@@ -778,13 +759,13 @@ public static class StaticConverterFactory implements CacheEventConverterFactory
static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
@Override
- public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
+ public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
String value, Metadata metadata, EventType eventType) {
...
}
}
}
-
+
@NamedFactory(name = "static-filter-factory")
public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
@Override
@@ -794,7 +775,7 @@ public static class StaticCacheEventFilterFactory implements CacheEventFilterFac
static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
@Override
- public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
+ public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
String value, Metadata metadata, EventType eventType) {
...
}
@@ -803,11 +784,11 @@ public static class StaticCacheEventFilterFactory implements CacheEventFilterFac
----
Custom filters and converters must be registered with the server.
-.
+.
[NOTE]
====
-In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
+In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
====
[NOTE]
@@ -837,7 +818,7 @@ org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentR
<!-- set up the repository -->
<bean id="infinispanRepo"
- class="org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository"
+ class="org.apache.camel.component.infinispan.InfinispanIdempotentRepository"
factory-method="infinispanIdempotentRepository">
<argument ref="cacheManager"/>
<argument value="idempotent"/>
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanRemoteAggregationRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java
similarity index 67%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanRemoteAggregationRepository.java
rename to components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java
index ddbd9d9..3543a5d 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanRemoteAggregationRepository.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanAggregationRepository.java
@@ -14,90 +14,92 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.infinispan.processor.aggregate;
+package org.apache.camel.component.infinispan;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
import org.apache.camel.Exchange;
import org.apache.camel.spi.RecoverableAggregationRepository;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.support.DefaultExchangeHolder;
import org.apache.camel.support.service.ServiceSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.infinispan.client.hotrod.RemoteCacheManager;
-import org.infinispan.client.hotrod.configuration.Configuration;
import org.infinispan.commons.api.BasicCache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class InfinispanRemoteAggregationRepository extends ServiceSupport implements RecoverableAggregationRepository {
+public abstract class InfinispanAggregationRepository
+ extends ServiceSupport
+ implements RecoverableAggregationRepository, CamelContextAware {
- private static final Logger LOG = LoggerFactory.getLogger(InfinispanRemoteAggregationRepository.class.getName());
+ private static final Logger LOG = LoggerFactory.getLogger(InfinispanAggregationRepository.class);
+ private final String cacheName;
+
+ private CamelContext camelContext;
private boolean useRecovery = true;
- private RemoteCacheManager manager;
- private String cacheName;
private String deadLetterChannel;
private long recoveryInterval = 5000;
private int maximumRedeliveries = 3;
private boolean allowSerializedHeaders;
- private BasicCache<String, DefaultExchangeHolder> cache;
- private Configuration configuration;
-
- /**
- * Creates new {@link InfinispanRemoteAggregationRepository} that defaults to non-optimistic locking with
- * recoverable behavior and a local Infinispan cache.
- */
- public InfinispanRemoteAggregationRepository() {
- }
/**
- * Creates new {@link InfinispanRemoteAggregationRepository} that defaults to non-optimistic locking with
- * recoverable behavior and a local Infinispan cache.
- *
+ * Creates new {@link InfinispanAggregationRepository} that defaults to non-optimistic locking with recoverable
+ * behavior and a local Infinispan cache.
+ *
* @param cacheName cache name
*/
- public InfinispanRemoteAggregationRepository(final String cacheName) {
+ protected InfinispanAggregationRepository(String cacheName) {
this.cacheName = cacheName;
}
@Override
+ public CamelContext getCamelContext() {
+ return camelContext;
+ }
+
+ @Override
+ public void setCamelContext(CamelContext camelContext) {
+ this.camelContext = camelContext;
+ }
+
+ @Override
public Exchange add(final CamelContext camelContext, final String key, final Exchange exchange) {
LOG.trace("Adding an Exchange with ID {} for key {} in a thread-safe manner.", exchange.getExchangeId(), key);
DefaultExchangeHolder newHolder = DefaultExchangeHolder.marshal(exchange, true, allowSerializedHeaders);
- DefaultExchangeHolder oldHolder = cache.put(key, newHolder);
+ DefaultExchangeHolder oldHolder = getCache().put(key, newHolder);
return unmarshallExchange(camelContext, oldHolder);
}
@Override
public Exchange get(CamelContext camelContext, String key) {
- return unmarshallExchange(camelContext, cache.get(key));
+ return unmarshallExchange(camelContext, getCache().get(key));
}
@Override
public void remove(CamelContext camelContext, String key, Exchange exchange) {
LOG.trace("Removing an exchange with ID {} for key {}", exchange.getExchangeId(), key);
- cache.remove(key);
+ getCache().remove(key);
}
@Override
public void confirm(CamelContext camelContext, String exchangeId) {
LOG.trace("Confirming an exchange with ID {}.", exchangeId);
- cache.remove(exchangeId);
+ getCache().remove(exchangeId);
}
@Override
public Set<String> getKeys() {
- return Collections.unmodifiableSet(cache.keySet());
+ return Collections.unmodifiableSet(getCache().keySet());
}
@Override
public Set<String> scan(CamelContext camelContext) {
LOG.trace("Scanning for exchanges to recover in {} context", camelContext.getName());
- Set<String> scanned = Collections.unmodifiableSet(cache.keySet());
+ Set<String> scanned = Collections.unmodifiableSet(getCache().keySet());
LOG.trace("Found {} keys for exchanges to recover in {} context", scanned.size(), camelContext.getName());
return scanned;
}
@@ -105,7 +107,7 @@ public class InfinispanRemoteAggregationRepository extends ServiceSupport implem
@Override
public Exchange recover(CamelContext camelContext, String exchangeId) {
LOG.trace("Recovering an Exchange with ID {}.", exchangeId);
- return useRecovery ? unmarshallExchange(camelContext, cache.get(exchangeId)) : null;
+ return useRecovery ? unmarshallExchange(camelContext, getCache().get(exchangeId)) : null;
}
@Override
@@ -124,18 +126,13 @@ public class InfinispanRemoteAggregationRepository extends ServiceSupport implem
}
@Override
- public void setUseRecovery(boolean useRecovery) {
- this.useRecovery = useRecovery;
- }
-
- @Override
public boolean isUseRecovery() {
return useRecovery;
}
@Override
- public void setDeadLetterUri(String deadLetterUri) {
- this.deadLetterChannel = deadLetterUri;
+ public void setUseRecovery(boolean useRecovery) {
+ this.useRecovery = useRecovery;
}
@Override
@@ -144,8 +141,8 @@ public class InfinispanRemoteAggregationRepository extends ServiceSupport implem
}
@Override
- public void setMaximumRedeliveries(int maximumRedeliveries) {
- this.maximumRedeliveries = maximumRedeliveries;
+ public void setDeadLetterUri(String deadLetterUri) {
+ this.deadLetterChannel = deadLetterUri;
}
@Override
@@ -154,6 +151,11 @@ public class InfinispanRemoteAggregationRepository extends ServiceSupport implem
}
@Override
+ public void setMaximumRedeliveries(int maximumRedeliveries) {
+ this.maximumRedeliveries = maximumRedeliveries;
+ }
+
+ @Override
protected void doStart() throws Exception {
if (maximumRedeliveries < 0) {
throw new IllegalArgumentException("Maximum redelivery retries must be zero or a positive integer.");
@@ -161,23 +163,6 @@ public class InfinispanRemoteAggregationRepository extends ServiceSupport implem
if (recoveryInterval < 0) {
throw new IllegalArgumentException("Recovery interval must be zero or a positive integer.");
}
- if (ObjectHelper.isEmpty(configuration)) {
- manager = new RemoteCacheManager();
- manager.start();
- } else {
- manager = new RemoteCacheManager(configuration);
- manager.start();
- }
- if (ObjectHelper.isEmpty(cacheName)) {
- cache = manager.getCache();
- } else {
- cache = manager.getCache(cacheName);
- }
- }
-
- @Override
- protected void doStop() throws Exception {
- manager.stop();
}
protected Exchange unmarshallExchange(CamelContext camelContext, DefaultExchangeHolder holder) {
@@ -189,22 +174,10 @@ public class InfinispanRemoteAggregationRepository extends ServiceSupport implem
return exchange;
}
- public RemoteCacheManager getManager() {
- return manager;
- }
-
- public void setManager(RemoteCacheManager manager) {
- this.manager = manager;
- }
-
public String getCacheName() {
return cacheName;
}
- public void setCacheName(String cacheName) {
- this.cacheName = cacheName;
- }
-
public String getDeadLetterChannel() {
return deadLetterChannel;
}
@@ -221,19 +194,6 @@ public class InfinispanRemoteAggregationRepository extends ServiceSupport implem
this.allowSerializedHeaders = allowSerializedHeaders;
}
- public BasicCache<String, DefaultExchangeHolder> getCache() {
- return cache;
- }
+ protected abstract BasicCache<String, DefaultExchangeHolder> getCache();
- public void setCache(BasicCache<String, DefaultExchangeHolder> cache) {
- this.cache = cache;
- }
-
- public Configuration getConfiguration() {
- return configuration;
- }
-
- public void setConfiguration(Configuration configuration) {
- this.configuration = configuration;
- }
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java
index 227d449..f83c52d 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanComponent.java
@@ -16,92 +16,14 @@
*/
package org.apache.camel.component.infinispan;
-import java.util.Arrays;
-import java.util.Map;
-
import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
-import org.infinispan.configuration.global.GlobalConfigurationBuilder;
-import org.infinispan.manager.CacheContainer;
-import org.infinispan.manager.DefaultCacheManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Component("infinispan")
-public class InfinispanComponent extends DefaultComponent {
-
- private static final Logger LOG = LoggerFactory.getLogger(InfinispanComponent.class);
-
- private transient CacheContainer defaultCacheManager;
-
- @Metadata(description = "Component configuration")
- private InfinispanConfiguration configuration = new InfinispanConfiguration();
- public InfinispanComponent() {
+public abstract class InfinispanComponent extends DefaultComponent {
+ protected InfinispanComponent() {
}
- public InfinispanComponent(CamelContext camelContext) {
+ protected InfinispanComponent(CamelContext camelContext) {
super(camelContext);
}
-
- @Override
- protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- InfinispanConfiguration conf = configuration.copy();
- // init default embedded cache if config parameters aren't specified or cacheContainer is set using setMethod
- if (!isConfigProvided(parameters, conf)) {
- if (defaultCacheManager == null) {
- defaultCacheManager = new DefaultCacheManager(
- new GlobalConfigurationBuilder().defaultCacheName("default").build(),
- new org.infinispan.configuration.cache.ConfigurationBuilder().build());
- LOG.debug("Default cacheContainer has been created");
- }
- conf.setCacheContainer(defaultCacheManager);
- }
-
- InfinispanEndpoint endpoint = new InfinispanEndpoint(uri, remaining, this, conf);
- setProperties(endpoint, parameters);
- return endpoint;
- }
-
- public void setConfiguration(InfinispanConfiguration configuration) {
- this.configuration = configuration;
- }
-
- public InfinispanConfiguration getConfiguration() {
- return configuration;
- }
-
- /**
- * Determine if cache is configured
- */
- private boolean isConfigProvided(Map<String, Object> parameters, InfinispanConfiguration conf) {
- if (conf.getHosts() != null) {
- return true;
- }
- if (conf.getCacheContainer() != null) {
- return true;
- }
- if (conf.getCacheContainerConfiguration() != null) {
- return true;
- }
- if (conf.getConfigurationUri() != null) {
- return true;
- }
-
- String[] confParameters = new String[] { "hosts", "cacheContainerConfiguration", "configurationUri", "cacheContainer" };
- return Arrays.stream(confParameters).anyMatch(parameters::containsKey);
- }
-
- @Override
- protected void doShutdown() throws Exception {
- super.doShutdown();
-
- if (defaultCacheManager != null) {
- defaultCacheManager.stop();
- defaultCacheManager = null;
- }
- }
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
index c56c6ac..10824f3 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConfiguration.java
@@ -16,24 +16,11 @@
*/
package org.apache.camel.component.infinispan;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
import java.util.function.BiFunction;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
-import org.apache.camel.spi.UriParams;
-import org.infinispan.commons.api.BasicCacheContainer;
-import org.infinispan.context.Flag;
-@UriParams
-public class InfinispanConfiguration implements Cloneable {
- @UriParam
- private String hosts;
+public abstract class InfinispanConfiguration {
@UriParam(label = "producer", defaultValue = "PUT")
private InfinispanOperation operation = InfinispanOperation.PUT;
@UriParam(label = "producer")
@@ -47,43 +34,14 @@ public class InfinispanConfiguration implements Cloneable {
@Deprecated
@UriParam(label = "consumer", defaultValue = "PUT")
private String command = "PUT";
- @UriParam(label = "consumer", defaultValue = "true")
- private boolean sync = true;
- @UriParam(label = "consumer", javaType = "java.lang.String")
- private Set<String> eventTypes;
- @UriParam(label = "consumer")
- private InfinispanCustomListener customListener;
- @UriParam(label = "consumer", defaultValue = "false")
- private boolean clusteredListener;
- @UriParam
- private InfinispanQueryBuilder queryBuilder;
- @UriParam(label = "advanced", javaType = "java.lang.String")
- private Flag[] flags;
@UriParam(label = "advanced")
private String configurationUri;
@UriParam(label = "advanced")
- private Map<String, String> configurationProperties;
- @Metadata(autowired = true)
- @UriParam(label = "advanced")
- private BasicCacheContainer cacheContainer;
- @UriParam(label = "advanced")
- private Object cacheContainerConfiguration;
- @UriParam(label = "advanced")
- private Object resultHeader;
+ private String resultHeader;
@UriParam(label = "advanced")
private BiFunction remappingFunction;
- @UriParam(label = "common", defaultValue = "false")
- private boolean secure;
- @UriParam(label = "common, security")
- private String username;
- @UriParam(label = "common, security", secret = true)
- private String password;
- @UriParam(label = "common, security")
- private String saslMechanism;
- @UriParam(label = "common, security")
- private String securityRealm;
- @UriParam(label = "common, security")
- private String securityServerName;
+ @UriParam
+ private InfinispanQueryBuilder queryBuilder;
public String getCommand() {
return operation.toString();
@@ -119,133 +77,6 @@ public class InfinispanConfiguration implements Cloneable {
}
/**
- * Specifies the host of the cache on Infinispan instance
- */
- public String getHosts() {
- return hosts;
- }
-
- public void setHosts(String hosts) {
- this.hosts = hosts;
- }
-
- /**
- * Specifies the cache Container to connect
- */
- public BasicCacheContainer getCacheContainer() {
- return cacheContainer;
- }
-
- public void setCacheContainer(BasicCacheContainer cacheContainer) {
- this.cacheContainer = cacheContainer;
- }
-
- /**
- * If true, the consumer will receive notifications synchronously
- */
- public boolean isSync() {
- return sync;
- }
-
- public void setSync(boolean sync) {
- this.sync = sync;
- }
-
- /**
- * If true, the listener will be installed for the entire cluster
- */
- public boolean isClusteredListener() {
- return clusteredListener;
- }
-
- public void setClusteredListener(boolean clusteredListener) {
- this.clusteredListener = clusteredListener;
- }
-
- public Set<String> getEventTypes() {
- return eventTypes;
- }
-
- /**
- * Specifies the set of event types to register by the consumer. Multiple event can be separated by comma.
- * <p/>
- * The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED,
- * CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED,
- * TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED,
- * PARTITION_STATUS_CHANGED
- */
- public void setEventTypes(Set<String> eventTypes) {
- this.eventTypes = eventTypes;
- }
-
- /**
- * Specifies the set of event types to register by the consumer. Multiple event can be separated by comma.
- * <p/>
- * The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED,
- * CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED,
- * TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, DATA_REHASHED, TOPOLOGY_CHANGED,
- * PARTITION_STATUS_CHANGED
- */
- public void setEventTypes(String eventTypes) {
- this.eventTypes = new HashSet<>(Arrays.asList(eventTypes.split(",")));
- }
-
- /**
- * Returns the custom listener in use, if provided
- */
- public InfinispanCustomListener getCustomListener() {
- return customListener;
- }
-
- public void setCustomListener(InfinispanCustomListener customListener) {
- this.customListener = customListener;
- }
-
- public boolean hasCustomListener() {
- return customListener != null;
- }
-
- public InfinispanQueryBuilder getQueryBuilder() {
- return queryBuilder;
- }
-
- /**
- * Specifies the query builder.
- */
- public void setQueryBuilder(InfinispanQueryBuilder queryBuilder) {
- this.queryBuilder = queryBuilder;
- }
-
- public boolean hasQueryBuilder() {
- return queryBuilder != null;
- }
-
- public Flag[] getFlags() {
- return flags;
- }
-
- /**
- * A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote
- * caches.
- */
- public void setFlags(String flagsAsString) {
- String[] flagsArray = flagsAsString.split(",");
- this.flags = new Flag[flagsArray.length];
-
- for (int i = 0; i < flagsArray.length; i++) {
- this.flags[i] = Flag.valueOf(flagsArray[i]);
- }
- }
-
- public void setFlags(Flag... flags) {
- this.flags = flags;
- }
-
- public boolean hasFlags() {
- return flags != null && flags.length > 0;
- }
-
- /**
* An implementation specific URI for the CacheManager
*/
public String getConfigurationUri() {
@@ -256,50 +87,7 @@ public class InfinispanConfiguration implements Cloneable {
this.configurationUri = configurationUri;
}
- public Map<String, String> getConfigurationProperties() {
- return configurationProperties;
- }
-
- /**
- * Implementation specific properties for the CacheManager
- */
- public void setConfigurationProperties(Map<String, String> configurationProperties) {
- this.configurationProperties = configurationProperties;
- }
-
- /**
- * Adds an implementation specific property for the CacheManager
- */
- public void addConfigurationProperty(String key, String value) {
- if (this.configurationProperties == null) {
- this.configurationProperties = new HashMap<>();
- }
-
- this.configurationProperties.put(key, value);
- }
-
- public Object getCacheContainerConfiguration() {
- return cacheContainerConfiguration;
- }
-
- /**
- * The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types:
- * org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration;
- * org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration;
- */
- public void setCacheContainerConfiguration(Object cacheContainerConfiguration) {
- this.cacheContainerConfiguration = cacheContainerConfiguration;
- }
-
- public InfinispanConfiguration copy() {
- try {
- return (InfinispanConfiguration) super.clone();
- } catch (CloneNotSupportedException e) {
- throw new RuntimeCamelException(e);
- }
- }
-
- public Object getResultHeader() {
+ public String getResultHeader() {
return resultHeader;
}
@@ -310,7 +98,7 @@ public class InfinispanConfiguration implements Cloneable {
* message body is preserved. This value can be overridden by an in message header named:
* CamelInfinispanOperationResultHeader
*/
- public void setResultHeader(Object resultHeader) {
+ public void setResultHeader(String resultHeader) {
this.resultHeader = resultHeader;
}
@@ -369,70 +157,19 @@ public class InfinispanConfiguration implements Cloneable {
this.defaultValue = defaultValue;
}
- public boolean isSecure() {
- return secure;
- }
-
- /**
- * Define if we are connecting to a secured Infinispan instance
- */
- public void setSecure(boolean secure) {
- this.secure = secure;
- }
-
- public String getUsername() {
- return username;
- }
-
- /**
- * Define the username to access the infinispan instance
- */
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getPassword() {
- return password;
- }
-
- /**
- * Define the password to access the infinispan instance
- */
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getSaslMechanism() {
- return saslMechanism;
- }
-
- /**
- * Define the SASL Mechanism to access the infinispan instance
- */
- public void setSaslMechanism(String saslMechanism) {
- this.saslMechanism = saslMechanism;
- }
-
- public String getSecurityRealm() {
- return securityRealm;
+ public InfinispanQueryBuilder getQueryBuilder() {
+ return queryBuilder;
}
/**
- * Define the security realm to access the infinispan instance
+ * Specifies the query builder.
*/
- public void setSecurityRealm(String securityRealm) {
- this.securityRealm = securityRealm;
- }
-
- public String getSecurityServerName() {
- return securityServerName;
+ public void setQueryBuilder(InfinispanQueryBuilder queryBuilder) {
+ this.queryBuilder = queryBuilder;
}
- /**
- * Define the security server name to access the infinispan instance
- */
- public void setSecurityServerName(String securityServerName) {
- this.securityServerName = securityServerName;
+ public boolean hasQueryBuilder() {
+ return queryBuilder != null;
}
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java
index 9a1edfd..b92d0f2 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConstants.java
@@ -38,6 +38,11 @@ public interface InfinispanConstants {
String IGNORE_RETURN_VALUES = "CamelInfinispanIgnoreReturnValues";
String EVENT_DATA = "CamelInfinispanEventData";
String QUERY_BUILDER = "CamelInfinispanQueryBuilder";
+ String ENTRY_VERSION = "CamelInfinispanEntryVersion";
+ String COMMAND_RETRIED = "CamelInfinispanCommandRetried";
+ String ENTRY_CREATED = "CamelInfinispanEntryCreated";
+ String ORIGIN_LOCAL = "CamelInfinispanOriginLocal";
+ String CURRENT_STATE = "CamelInfinispanCurrentState";
String CACHE_ENTRY_JOINING = "CacheEntryJoining";
String CACHE_ENTRY_LEAVING = "CacheEntryLeaving";
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
index b2376a4..39f5f61 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
@@ -16,52 +16,52 @@
*/
package org.apache.camel.component.infinispan;
+import java.util.function.Consumer;
+
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
-import org.apache.camel.component.infinispan.embedded.InfinispanConsumerEmbeddedHandler;
-import org.apache.camel.component.infinispan.remote.InfinispanConsumerRemoteHandler;
-import org.apache.camel.component.infinispan.remote.InfinispanRemoteOperation;
import org.apache.camel.support.DefaultConsumer;
-import org.infinispan.client.hotrod.RemoteCache;
-import org.infinispan.client.hotrod.Search;
import org.infinispan.commons.api.BasicCache;
-import org.infinispan.query.api.continuous.ContinuousQuery;
-import org.infinispan.query.api.continuous.ContinuousQueryListener;
-import org.infinispan.query.dsl.Query;
+import org.infinispan.commons.api.BasicCacheContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class InfinispanConsumer extends DefaultConsumer {
- private static final transient Logger LOG = LoggerFactory.getLogger(InfinispanProducer.class);
- private final InfinispanConfiguration configuration;
- private final InfinispanManager manager;
- private final String cacheName;
- private InfinispanEventListener listener;
- private InfinispanConsumerHandler consumerHandler;
- private BasicCache<Object, Object> cache;
- private ContinuousQuery<Object, Object> continuousQuery;
+public abstract class InfinispanConsumer<
+ ContainerType extends BasicCacheContainer,
+ ManagerType extends InfinispanManager<ContainerType>,
+ ConfigurationType extends InfinispanConfiguration>
+ extends DefaultConsumer
+ implements InfinispanEventProcessor {
+
+ private static final Logger LOG = LoggerFactory.getLogger(InfinispanProducer.class);
+
+ protected final ConfigurationType configuration;
+ protected final ManagerType manager;
+ protected final String cacheName;
- public InfinispanConsumer(InfinispanEndpoint endpoint, Processor processor, String cacheName, InfinispanManager manager,
- InfinispanConfiguration configuration) {
+ protected InfinispanConsumer(InfinispanEndpoint endpoint, Processor processor, String cacheName, ManagerType manager,
+ ConfigurationType configuration) {
super(endpoint, processor);
this.cacheName = cacheName;
this.configuration = configuration;
this.manager = manager;
}
- public void processEvent(String eventType, boolean isPre, String cacheName, Object key) {
- processEvent(eventType, isPre, cacheName, key, null);
- }
-
- public void processEvent(String eventType, boolean isPre, String cacheName, Object key, Object eventData) {
+ @Override
+ public void processEvent(String eventType, String cacheName, Object key, Object eventData, Consumer<Exchange> consumer) {
Exchange exchange = getEndpoint().createExchange();
exchange.getMessage().setHeader(InfinispanConstants.EVENT_TYPE, eventType);
- exchange.getMessage().setHeader(InfinispanConstants.IS_PRE, isPre);
exchange.getMessage().setHeader(InfinispanConstants.CACHE_NAME, cacheName);
- exchange.getMessage().setHeader(InfinispanConstants.KEY, key);
+
+ if (key != null) {
+ exchange.getMessage().setHeader(InfinispanConstants.KEY, key);
+ }
if (eventData != null) {
exchange.getMessage().setHeader(InfinispanConstants.EVENT_DATA, eventData);
}
+ if (consumer != null) {
+ consumer.accept(exchange);
+ }
try {
getProcessor().process(exchange);
@@ -70,83 +70,15 @@ public class InfinispanConsumer extends DefaultConsumer {
}
}
- @Override
- protected void doStart() throws Exception {
- super.doStart();
- manager.start();
-
- cache = manager.getCache(cacheName);
- if (configuration.hasQueryBuilder()) {
- if (InfinispanUtil.isRemote(cache)) {
- RemoteCache<Object, Object> remoteCache = InfinispanUtil.asRemote(cache);
- Query query = InfinispanRemoteOperation.buildQuery(configuration.getQueryBuilder(), remoteCache);
-
- continuousQuery = Search.getContinuousQuery(remoteCache);
- continuousQuery.addContinuousQueryListener(query, new ContinuousQueryEventListener(cache.getName()));
- } else {
- throw new IllegalArgumentException(
- "Can't run continuous queries against embedded cache (" + cache.getName() + ")");
- }
- } else {
- if (manager.isCacheContainerEmbedded()) {
- consumerHandler = InfinispanConsumerEmbeddedHandler.INSTANCE;
- } else if (manager.isCacheContainerRemote()) {
- consumerHandler = InfinispanConsumerRemoteHandler.INSTANCE;
- } else {
- throw new UnsupportedOperationException(
- "Unsupported CacheContainer type " + manager.getCacheContainer().getClass().getName());
- }
-
- listener = consumerHandler.start(this);
- }
+ public <K, V> BasicCache<K, V> getCache() {
+ return manager.getCache(cacheName);
}
- @Override
- protected void doStop() throws Exception {
- if (continuousQuery != null) {
- continuousQuery.removeAllListeners();
- }
-
- if (consumerHandler != null) {
- consumerHandler.stop(this);
- }
-
- manager.stop();
- super.doStop();
- }
-
- public BasicCache<Object, Object> getCache() {
- return cache;
+ public <K, V, C extends BasicCache<K, V>> C getCache(Class<C> type) {
+ return type.cast(getCache());
}
- public InfinispanEventListener getListener() {
- return listener;
- }
-
- public InfinispanConfiguration getConfiguration() {
+ public ConfigurationType getConfiguration() {
return configuration;
}
-
- private class ContinuousQueryEventListener implements ContinuousQueryListener<Object, Object> {
- private final String cacheName;
-
- ContinuousQueryEventListener(String cacheName) {
- this.cacheName = cacheName;
- }
-
- @Override
- public void resultJoining(Object key, Object value) {
- processEvent(InfinispanConstants.CACHE_ENTRY_JOINING, false, cacheName, key, value);
- }
-
- @Override
- public void resultUpdated(Object key, Object value) {
- processEvent(InfinispanConstants.CACHE_ENTRY_UPDATED, false, cacheName, key, value);
- }
-
- @Override
- public void resultLeaving(Object key) {
- processEvent(InfinispanConstants.CACHE_ENTRY_LEAVING, false, cacheName, key);
- }
- }
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanCustomListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanCustomListener.java
deleted file mode 100644
index 295e9b2..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanCustomListener.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.component.infinispan;
-
-import java.util.Set;
-
-/**
- * This class is supposed to be extended by users and annotated with @Listener or @ClientListener and passed to the
- * consumer endpoint through the 'customListener' parameter.
- */
-public abstract class InfinispanCustomListener extends InfinispanEventListener {
-
- public InfinispanCustomListener(InfinispanConsumer infinispanConsumer, Set<String> eventTypes) {
- super(infinispanConsumer, eventTypes);
- }
-
- public InfinispanConsumer getInfinispanConsumer() {
- return infinispanConsumer;
- }
-
- @Override
- public void setInfinispanConsumer(InfinispanConsumer infinispanConsumer) {
- this.infinispanConsumer = infinispanConsumer;
- }
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
index 050f422..d3fb9fb 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
@@ -16,68 +16,15 @@
*/
package org.apache.camel.component.infinispan;
-import org.apache.camel.Category;
-import org.apache.camel.Consumer;
-import org.apache.camel.Processor;
-import org.apache.camel.Producer;
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.UriEndpoint;
-import org.apache.camel.spi.UriParam;
-import org.apache.camel.spi.UriPath;
+import org.apache.camel.Component;
import org.apache.camel.support.DefaultEndpoint;
/**
* Read and write from/to Infinispan distributed key/value store and data grid.
*/
-@UriEndpoint(firstVersion = "2.13.0", scheme = "infinispan", title = "Infinispan", syntax = "infinispan:cacheName",
- category = { Category.CACHE, Category.DATAGRID, Category.CLUSTERING })
-public class InfinispanEndpoint extends DefaultEndpoint {
+public abstract class InfinispanEndpoint extends DefaultEndpoint {
- @UriPath(description = "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name.")
- @Metadata(required = true)
- private final String cacheName;
- @UriParam
- private final InfinispanConfiguration configuration;
-
- private final InfinispanManager manager;
-
- public InfinispanEndpoint(String uri, String cacheName, InfinispanComponent component,
- InfinispanConfiguration configuration) {
- super(uri, component);
- this.cacheName = cacheName;
- this.configuration = configuration;
- this.manager = new InfinispanManager(component.getCamelContext(), configuration);
- }
-
- @Override
- protected void doStart() throws Exception {
- manager.start();
- super.doStart();
- }
-
- @Override
- protected void doStop() throws Exception {
- super.doStop();
- manager.stop();
- }
-
- @Override
- public Producer createProducer() throws Exception {
- return new InfinispanProducer(this, cacheName, manager, configuration);
- }
-
- @Override
- public Consumer createConsumer(Processor processor) throws Exception {
- InfinispanConsumer consumer = new InfinispanConsumer(this, processor, cacheName, manager, configuration);
- configureConsumer(consumer);
- return consumer;
- }
-
- public String getCacheName() {
- return cacheName;
- }
-
- public InfinispanConfiguration getConfiguration() {
- return configuration;
+ protected InfinispanEndpoint(String endpointUri, Component component) {
+ super(endpointUri, component);
}
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java
index 7850ac6..310811f 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventListener.java
@@ -16,31 +16,41 @@
*/
package org.apache.camel.component.infinispan;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.Set;
-public abstract class InfinispanEventListener {
- protected InfinispanConsumer infinispanConsumer;
- protected Set<String> eventTypes;
- protected String cacheName;
+public abstract class InfinispanEventListener<T> {
+ private final Set<T> events;
- public InfinispanEventListener(InfinispanConsumer infinispanConsumer, Set<String> eventTypes) {
- this.infinispanConsumer = infinispanConsumer;
- this.eventTypes = eventTypes;
- }
+ private InfinispanEventProcessor eventProcessor;
+ private String cacheName;
- public void setInfinispanConsumer(InfinispanConsumer infinispanConsumer) {
- this.infinispanConsumer = infinispanConsumer;
+ public InfinispanEventListener(Set<T> events) {
+ this.events = Collections.unmodifiableSet(new HashSet<>(events));
}
- public void setEventTypes(Set<String> eventTypes) {
- this.eventTypes = eventTypes;
+ public String getCacheName() {
+ return cacheName;
}
public void setCacheName(String cacheName) {
this.cacheName = cacheName;
}
- protected boolean isAccepted(String eventType) {
- return eventTypes == null || eventTypes.isEmpty() || eventTypes.contains(eventType);
+ public InfinispanEventProcessor getEventProcessor() {
+ return eventProcessor;
+ }
+
+ public void setEventProcessor(InfinispanEventProcessor eventProcessor) {
+ this.eventProcessor = eventProcessor;
+ }
+
+ public Set<T> getEvents() {
+ return events;
+ }
+
+ protected boolean isAccepted(T eventType) {
+ return events == null || events.isEmpty() || events.contains(eventType);
}
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumerHandler.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java
similarity index 78%
rename from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumerHandler.java
rename to components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java
index f860c88..5c27092 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumerHandler.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEventProcessor.java
@@ -16,8 +16,10 @@
*/
package org.apache.camel.component.infinispan;
-public interface InfinispanConsumerHandler {
- InfinispanEventListener start(InfinispanConsumer consumer);
+import java.util.function.Consumer;
- void stop(InfinispanConsumer consumer);
+import org.apache.camel.Exchange;
+
+public interface InfinispanEventProcessor {
+ void processEvent(String eventType, String cacheName, Object key, Object eventData, Consumer<Exchange> consumer);
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java
new file mode 100644
index 0000000..b815fc6
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanIdempotentRepository.java
@@ -0,0 +1,85 @@
+/*
+ * 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.component.infinispan;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.api.management.ManagedAttribute;
+import org.apache.camel.api.management.ManagedOperation;
+import org.apache.camel.spi.IdempotentRepository;
+import org.apache.camel.support.service.ServiceSupport;
+import org.infinispan.commons.api.BasicCache;
+
+public abstract class InfinispanIdempotentRepository
+ extends ServiceSupport
+ implements IdempotentRepository, CamelContextAware {
+
+ private CamelContext camelContext;
+
+ @Override
+ public CamelContext getCamelContext() {
+ return camelContext;
+ }
+
+ @Override
+ public void setCamelContext(CamelContext camelContext) {
+ this.camelContext = camelContext;
+ }
+
+ @Override
+ @ManagedOperation(description = "Adds the key to the store")
+ public boolean add(String key) {
+ // need to check first as put will update the entry lifetime so it can not expire its cache lifespan
+ if (getCache().containsKey(key)) {
+ // there is already an entry so return false
+ return false;
+ }
+
+ Boolean put = getCache().put(key, true);
+ return put == null;
+ }
+
+ @Override
+ @ManagedOperation(description = "Does the store contain the given key")
+ public boolean contains(String key) {
+ return getCache().containsKey(key);
+ }
+
+ @Override
+ @ManagedOperation(description = "Remove the key from the store")
+ public boolean remove(String key) {
+ return getCache().remove(key) != null;
+ }
+
+ @Override
+ @ManagedOperation(description = "Clear the store")
+ public void clear() {
+ getCache().clear();
+ }
+
+ @ManagedAttribute(description = "The processor name")
+ public String getCacheName() {
+ return getCache().getName();
+ }
+
+ @Override
+ public boolean confirm(String key) {
+ return true;
+ }
+
+ protected abstract BasicCache<String, Boolean> getCache();
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
index 8b4231b..3201b72 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
@@ -16,211 +16,40 @@
*/
package org.apache.camel.component.infinispan;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
-import org.apache.camel.support.service.ServiceSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.infinispan.cache.impl.CacheImpl;
-import org.infinispan.cache.impl.DecoratedCache;
-import org.infinispan.client.hotrod.RemoteCacheManager;
-import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
+import org.apache.camel.Service;
import org.infinispan.commons.api.BasicCache;
import org.infinispan.commons.api.BasicCacheContainer;
-import org.infinispan.commons.util.EnumUtil;
-import org.infinispan.configuration.global.GlobalConfigurationBuilder;
-import org.infinispan.manager.DefaultCacheManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.apache.camel.component.infinispan.InfinispanConstants.CACHE_MANAGER_CURRENT;
-
-public class InfinispanManager extends ServiceSupport {
- private static final transient Logger LOGGER = LoggerFactory.getLogger(InfinispanManager.class);
-
- private final InfinispanConfiguration configuration;
- private final CamelContext camelContext;
- private BasicCacheContainer cacheContainer;
- private boolean isManagedCacheContainer;
-
- public InfinispanManager() {
- this.camelContext = null;
- this.configuration = new InfinispanConfiguration();
- this.configuration.setCacheContainer(
- new DefaultCacheManager(new GlobalConfigurationBuilder().defaultCacheName("default").build()));
- }
-
- public InfinispanManager(InfinispanConfiguration configuration) {
- this(null, configuration);
- }
-
- public InfinispanManager(CamelContext camelContext, InfinispanConfiguration configuration) {
- this.camelContext = camelContext;
- this.configuration = configuration;
- }
-
- @Override
- public void doStart() throws Exception {
- cacheContainer = configuration.getCacheContainer();
-
- if (cacheContainer == null) {
- final Object containerConf = configuration.getCacheContainerConfiguration();
- // Check if a container configuration object has been provided so use
- // it and discard any other additional configuration.
- if (containerConf != null) {
- if (containerConf instanceof org.infinispan.client.hotrod.configuration.Configuration) {
- cacheContainer = new RemoteCacheManager(
- (org.infinispan.client.hotrod.configuration.Configuration) containerConf,
- true);
- } else if (containerConf instanceof org.infinispan.configuration.cache.Configuration) {
- cacheContainer = new DefaultCacheManager(
- new GlobalConfigurationBuilder().defaultCacheName("default").build(),
- (org.infinispan.configuration.cache.Configuration) containerConf,
- true);
- } else {
- throw new IllegalArgumentException(
- "Unsupported CacheContainer Configuration type: " + containerConf.getClass());
- }
- }
-
- // If the hosts properties has been configured, it means we want to
- // connect to a remote cache so set-up a RemoteCacheManager
- if (cacheContainer == null && configuration.getHosts() != null) {
- ConfigurationBuilder builder = new ConfigurationBuilder();
- builder.addServers(configuration.getHosts());
-
- if (camelContext != null && camelContext.getApplicationContextClassLoader() != null) {
- builder.classLoader(camelContext.getApplicationContextClassLoader());
- } else {
- builder.classLoader(Thread.currentThread().getContextClassLoader());
- }
-
- if (configuration.isSecure()) {
- if (ObjectHelper.isNotEmpty(configuration.getUsername())
- && ObjectHelper.isNotEmpty(configuration.getPassword())) {
- builder.security().authentication().username(configuration.getUsername())
- .password(configuration.getPassword());
- } else {
- throw new IllegalArgumentException(
- "If the Infinispan instance is secured, username and password are needed");
- }
- if (ObjectHelper.isNotEmpty(configuration.getSaslMechanism())) {
- builder.security().authentication().saslMechanism(configuration.getSaslMechanism());
- }
- if (ObjectHelper.isNotEmpty(configuration.getSecurityRealm())) {
- builder.security().authentication().realm(configuration.getSecurityRealm());
- }
- if (ObjectHelper.isNotEmpty(configuration.getSecurityServerName())) {
- builder.security().authentication().serverName(configuration.getSecurityServerName());
- }
- }
-
- Properties properties = new Properties();
- // Properties can be set either via a properties file or via
- // properties on configuration, if you set both they are merged
- // with properties defined on configuration overriding those from
- // file.
- if (ObjectHelper.isNotEmpty(configuration.getConfigurationUri())) {
- properties.putAll(InfinispanUtil.loadProperties(camelContext, configuration.getConfigurationUri()));
- }
- if (ObjectHelper.isNotEmpty(configuration.getConfigurationProperties())) {
- properties.putAll(configuration.getConfigurationProperties());
- }
- if (!properties.isEmpty()) {
- builder.withProperties(properties);
- }
+public interface InfinispanManager<C extends BasicCacheContainer> extends BasicCacheContainer, CamelContextAware, Service {
+ <K, V> BasicCache<K, V> getCache(String cacheName);
- cacheContainer = new RemoteCacheManager(builder.build(), true);
- }
-
- // Finally we can set-up a DefaultCacheManager if none of the methods
- // above was triggered. You can configure the cache using a configuration
- // file.
- if (cacheContainer == null) {
- if (ObjectHelper.isNotEmpty(configuration.getConfigurationUri())) {
- try (InputStream is = InfinispanUtil.openInputStream(camelContext, configuration.getConfigurationUri())) {
- cacheContainer = new DefaultCacheManager(is, true);
- }
- } else {
- cacheContainer = new DefaultCacheManager(
- new GlobalConfigurationBuilder().defaultCacheName("default").build(),
- new org.infinispan.configuration.cache.ConfigurationBuilder().build());
- }
- }
-
- isManagedCacheContainer = true;
- }
- }
-
- @Override
- public void doStop() throws Exception {
- if (isManagedCacheContainer) {
- cacheContainer.stop();
- }
- }
-
- public BasicCacheContainer getCacheContainer() {
- return cacheContainer;
- }
-
- public boolean isCacheContainerEmbedded() {
- return InfinispanUtil.isEmbedded(cacheContainer);
+ default <K, V, CacheType extends BasicCache<K, V>> CacheType getCache(String cacheName, Class<CacheType> type) {
+ return type.cast(getCache(cacheName));
}
- public boolean isCacheContainerRemote() {
- return InfinispanUtil.isRemote(cacheContainer);
- }
-
- public <K, V> BasicCache<K, V> getCache(String cacheName) {
- BasicCache<K, V> cache;
- if (ObjectHelper.isEmpty(cacheName) || CACHE_MANAGER_CURRENT.equals(cacheName)) {
- cache = cacheContainer.getCache();
- cacheName = cache.getName();
- } else {
- cache = cacheContainer.getCache(cacheName);
- }
-
- LOGGER.trace("Cache[{}]", cacheName);
-
- if (configuration.hasFlags() && InfinispanUtil.isEmbedded(cache)) {
- cache = new DecoratedCache(
- (CacheImpl) InfinispanUtil.asAdvanced(cache), EnumUtil.bitSetOf(configuration.getFlags()));
- }
+ default <K, V> BasicCache<K, V> getCache(Message message, String defaultCache) {
+ final String cacheName = message.getHeader(InfinispanConstants.CACHE_NAME, defaultCache, String.class);
+ final BasicCache<K, V> cache = getCache(cacheName);
return cache;
}
- public <K, V> BasicCache<K, V> getCache(String cacheName, boolean forceReturnValue) {
- if (isCacheContainerRemote()) {
- BasicCache<K, V> cache;
- if (ObjectHelper.isEmpty(cacheName)) {
- cache = InfinispanUtil.asRemote(cacheContainer).getCache(forceReturnValue);
- cacheName = cache.getName();
- } else {
- cache = InfinispanUtil.asRemote(cacheContainer).getCache(cacheName, forceReturnValue);
- }
-
- LOGGER.trace("Cache[{}]", cacheName);
-
- return cache;
- } else {
- return getCache(cacheName);
- }
+ default <K, V, CacheType extends BasicCache<K, V>> CacheType getCache(
+ Message message, String defaultCache, Class<CacheType> type) {
+ return type.cast(getCache(message, defaultCache));
}
- public <K, V> BasicCache<K, V> getCache(Exchange exchange, String defaultCache) {
- return getCache(exchange.getIn(), defaultCache);
+ default <K, V> BasicCache<K, V> getCache(Exchange exchange, String defaultCache) {
+ return getCache(exchange.getMessage(), defaultCache);
}
- public <K, V> BasicCache<K, V> getCache(Message message, String defaultCache) {
- BasicCache<K, V> cache = getCache(message.getHeader(InfinispanConstants.CACHE_NAME, defaultCache, String.class));
-
- return message.getHeader(InfinispanConstants.IGNORE_RETURN_VALUES) != null
- ? cache
- : InfinispanUtil.ignoreReturnValuesCache(cache);
+ default <K, V, CacheType extends BasicCache<K, V>> CacheType getCache(
+ Exchange exchange, String defaultCache, Class<CacheType> type) {
+ return type.cast(getCache(exchange, defaultCache));
}
+
+ C getCacheContainer();
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java
index 44b2fc3..1ad9dca 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanProducer.java
@@ -16,51 +16,68 @@
*/
package org.apache.camel.component.infinispan;
+import java.lang.reflect.Method;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import org.apache.camel.Message;
-import org.apache.camel.component.infinispan.remote.InfinispanRemoteOperation;
import org.apache.camel.spi.InvokeOnHeader;
+import org.apache.camel.spi.InvokeOnHeaders;
import org.apache.camel.support.HeaderSelectorProducer;
import org.apache.camel.util.ObjectHelper;
import org.infinispan.commons.api.BasicCache;
-import org.infinispan.query.dsl.Query;
-public class InfinispanProducer extends HeaderSelectorProducer {
+public abstract class InfinispanProducer<M extends InfinispanManager, C extends InfinispanConfiguration>
+ extends HeaderSelectorProducer {
+
private final String cacheName;
- private final InfinispanConfiguration configuration;
- private final InfinispanManager manager;
+ private final C configuration;
+ private final M manager;
- public InfinispanProducer(InfinispanEndpoint endpoint, String cacheName, InfinispanManager manager,
- InfinispanConfiguration configuration) {
- super(endpoint, InfinispanConstants.OPERATION, () -> configuration.getOperationOrDefault().name(), false);
+ protected InfinispanProducer(InfinispanEndpoint endpoint, String cacheName, M manager, C configuration) {
+ super(endpoint, InfinispanConstants.OPERATION, configuration.getOperationOrDefault()::name, false);
this.cacheName = cacheName;
this.configuration = configuration;
this.manager = manager;
}
+ protected String getCacheName() {
+ return cacheName;
+ }
+
+ protected C getConfiguration() {
+ return configuration;
+ }
+
+ protected M getManager() {
+ return manager;
+ }
+
+ @Override
+ protected void bind() {
+ for (final Method method : getClass().getMethods()) {
+ InvokeOnHeaders annotation = method.getAnnotation(InvokeOnHeaders.class);
+ if (annotation != null) {
+ for (InvokeOnHeader processor : annotation.value()) {
+ bind(processor, method);
+ }
+ } else {
+ bind(method.getAnnotation(InvokeOnHeader.class), method);
+ }
+ }
+ }
+
// ************************************
// Operations
// ************************************
@InvokeOnHeader("PUT")
- void onPut(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
+ public void onPut(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
final Object result;
if (hasLifespan(message)) {
@@ -83,20 +100,10 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("PUTASYNC")
- void onPutAsync(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
+ public void onPutAsync(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
final CompletableFuture<Object> result;
if (hasLifespan(message)) {
@@ -119,9 +126,9 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("PUTALL")
- void onPutAll(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Map<Object, Object> map = message.getHeader(InfinispanConstants.MAP, Map.class);
+ public void onPutAll(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Map<?, ?> map = message.getHeader(InfinispanConstants.MAP, Map.class);
if (hasLifespan(message)) {
long lifespan = message.getHeader(InfinispanConstants.LIFESPAN_TIME, long.class);
@@ -141,9 +148,9 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("PUTALLASYNC")
- void onPutAllAsync(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Map<Object, Object> map = message.getHeader(InfinispanConstants.MAP, Map.class);
+ public void onPutAllAsync(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Map<?, ?> map = message.getHeader(InfinispanConstants.MAP, Map.class);
final CompletableFuture<Void> result;
if (hasLifespan(message)) {
@@ -166,20 +173,10 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("PUTIFABSENT")
- void onPutIfAbsent(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
+ public void onPutIfAbsent(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
final Object result;
if (hasLifespan(message)) {
@@ -202,20 +199,10 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("PUTIFABSENTASYNC")
- void onPutIfAbsentAsync(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
+ public void onPutIfAbsentAsync(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
final CompletableFuture<Object> result;
if (hasLifespan(message)) {
@@ -238,82 +225,47 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("GET")
- void onGet(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
+ public void onGet(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
final Object result = cache.get(key);
setResult(message, result);
}
@InvokeOnHeader("GETORDEFAULT")
- void onGetOrDefault(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object defaultValue;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.DEFAULT_VALUE))) {
- defaultValue = message.getHeader(InfinispanConstants.DEFAULT_VALUE);
- } else {
- defaultValue = configuration.getDefaultValue();
- }
+ public void onGetOrDefault(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object defaultValue = message.getHeader(InfinispanConstants.DEFAULT_VALUE, configuration::getDefaultValue);
final Object result = cache.getOrDefault(key, defaultValue);
setResult(message, result);
}
@InvokeOnHeader("CONTAINSKEY")
- void onContainsKey(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
+ public void onContainsKey(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
final Object result = cache.containsKey(key);
setResult(message, result);
}
@InvokeOnHeader("CONTAINSVALUE")
- void onContainsValue(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object value;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
+ public void onContainsValue(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
final Object result = cache.containsValue(value);
setResult(message, result);
}
@InvokeOnHeader("REMOVE")
- void onRemove(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
+ public void onRemove(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
final Object result;
if (ObjectHelper.isEmpty(value)) {
@@ -326,20 +278,10 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("REMOVEASYNC")
- void onRemoveAsync(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
+ public void onRemoveAsync(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
final CompletableFuture<Object> resultRemoveAsyncKey;
final CompletableFuture<Boolean> resultRemoveAsyncKeyValue;
@@ -353,26 +295,11 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("REPLACE")
- void onReplace(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- final Object oldValue;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.OLD_VALUE))) {
- oldValue = message.getHeader(InfinispanConstants.OLD_VALUE);
- } else {
- oldValue = configuration.getOldValue();
- }
+ public void onReplace(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
+ final Object oldValue = message.getHeader(InfinispanConstants.OLD_VALUE, configuration::getOldValue);
final Object result;
if (hasLifespan(message)) {
@@ -407,26 +334,11 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("REPLACEASYNC")
- void onReplaceAsync(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- final Object value;
- final Object oldValue;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.VALUE))) {
- value = message.getHeader(InfinispanConstants.VALUE);
- } else {
- value = configuration.getValue();
- }
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.OLD_VALUE))) {
- oldValue = message.getHeader(InfinispanConstants.OLD_VALUE);
- } else {
- oldValue = configuration.getOldValue();
- }
+ public void onReplaceAsync(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
+ final Object value = message.getHeader(InfinispanConstants.VALUE, configuration::getValue);
+ final Object oldValue = message.getHeader(InfinispanConstants.OLD_VALUE, configuration::getOldValue);
final CompletableFuture<Object> resultWithNewValue;
final CompletableFuture<Boolean> resultWithNewAndOldValue;
@@ -468,72 +380,43 @@ public class InfinispanProducer extends HeaderSelectorProducer {
}
@InvokeOnHeader("SIZE")
- void onSize(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
+ public void onSize(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
final Object result = cache.size();
setResult(message, result);
}
@InvokeOnHeader("CLEAR")
- void onClear(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
+ public void onClear(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
cache.clear();
}
@InvokeOnHeader("CLEARASYNC")
- void onCLearAsync(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
+ public void onCLearAsync(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
final CompletableFuture<Void> result = cache.clearAsync();
setResult(message, result);
}
- @InvokeOnHeader("QUERY")
- void onQuery(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
-
- if (InfinispanUtil.isRemote(cache)) {
- final Query query = InfinispanRemoteOperation.buildQuery(configuration, cache, message);
-
- if (query != null) {
- setResult(message, query.list());
- }
- } else {
- throw new UnsupportedOperationException("Query is supported on remote cache only");
- }
- }
-
- @InvokeOnHeader("STATS")
- void onStats(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object result = InfinispanUtil.asAdvanced(cache).getStats();
-
- setResult(message, result);
- }
-
+ @SuppressWarnings("unchecked")
@InvokeOnHeader("COMPUTE")
- void onCompute(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
+ public void onCompute(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
final Object result = cache.compute(key, configuration.getRemappingFunction());
+
setResult(message, result);
}
+ @SuppressWarnings("unchecked")
@InvokeOnHeader("COMPUTEASYNC")
- void onComputeAsync(Message message) {
- final BasicCache<Object, Object> cache = manager.getCache(message, this.cacheName);
- final Object key;
- if (ObjectHelper.isNotEmpty(message.getHeader(InfinispanConstants.KEY))) {
- key = message.getHeader(InfinispanConstants.KEY);
- } else {
- key = configuration.getKey();
- }
+ public void onComputeAsync(Message message) {
+ final BasicCache<Object, Object> cache = getCache(message);
+ final Object key = message.getHeader(InfinispanConstants.KEY, configuration::getKey);
final CompletableFuture<Object> result = cache.computeAsync(key, configuration.getRemappingFunction());
+
setResult(message, result);
}
@@ -541,17 +424,21 @@ public class InfinispanProducer extends HeaderSelectorProducer {
// Helpers
// ************************************
- private boolean hasLifespan(Message message) {
+ protected <K, V> BasicCache<K, V> getCache(Message message) {
+ return manager.getCache(message, this.cacheName);
+ }
+
+ protected boolean hasLifespan(Message message) {
return !InfinispanUtil.isHeaderEmpty(message, InfinispanConstants.LIFESPAN_TIME)
&& !InfinispanUtil.isHeaderEmpty(message, InfinispanConstants.LIFESPAN_TIME_UNIT);
}
- private boolean hasMaxIdleTime(Message message) {
+ protected boolean hasMaxIdleTime(Message message) {
return !InfinispanUtil.isHeaderEmpty(message, InfinispanConstants.MAX_IDLE_TIME)
&& !InfinispanUtil.isHeaderEmpty(message, InfinispanConstants.MAX_IDLE_TIME_UNIT);
}
- private void setResult(Message message, Object result) {
+ protected void setResult(Message message, Object result) {
String resultHeader
= message.getHeader(InfinispanConstants.RESULT_HEADER, configuration::getResultHeader, String.class);
if (resultHeader != null) {
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java
index da4be95..7f64d2b 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanQueryBuilder.java
@@ -19,6 +19,11 @@ package org.apache.camel.component.infinispan;
import org.infinispan.query.dsl.Query;
import org.infinispan.query.dsl.QueryFactory;
+@FunctionalInterface
public interface InfinispanQueryBuilder {
Query build(QueryFactory queryFactory);
+
+ static InfinispanQueryBuilder create(String query) {
+ return qf -> qf.create(query);
+ }
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java
new file mode 100644
index 0000000..93f5fe5
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanRoutePolicy.java
@@ -0,0 +1,246 @@
+/*
+ * 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.component.infinispan;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Route;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.Service;
+import org.apache.camel.api.management.ManagedAttribute;
+import org.apache.camel.support.RoutePolicySupport;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.ReferenceCount;
+import org.apache.camel.util.StringHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class InfinispanRoutePolicy extends RoutePolicySupport implements CamelContextAware {
+ private static final Logger LOGGER = LoggerFactory.getLogger(InfinispanRoutePolicy.class);
+
+ private final AtomicBoolean leader;
+ private final Set<Route> startedRoutes;
+ private final Set<Route> stoppeddRoutes;
+ private final ReferenceCount refCount;
+
+ private CamelContext camelContext;
+ private boolean shouldStopRoute;
+ private String lockMapName;
+ private String lockKey;
+ private String lockValue;
+ private long lifespan;
+ private TimeUnit lifespanTimeUnit;
+ private Service service;
+
+ protected InfinispanRoutePolicy(String lockKey, String lockValue) {
+ this.stoppeddRoutes = new HashSet<>();
+ this.startedRoutes = new HashSet<>();
+ this.leader = new AtomicBoolean();
+ this.shouldStopRoute = true;
+ this.lockKey = lockKey;
+ this.lockValue = lockValue;
+ this.lifespan = 30;
+ this.lifespanTimeUnit = TimeUnit.SECONDS;
+ this.service = null;
+ this.refCount = ReferenceCount.on(this::startService, this::stopService);
+ }
+
+ @Override
+ public CamelContext getCamelContext() {
+ return camelContext;
+ }
+
+ @Override
+ public void setCamelContext(CamelContext camelContext) {
+ this.camelContext = camelContext;
+ }
+
+ @Override
+ public synchronized void onInit(Route route) {
+ super.onInit(route);
+
+ LOGGER.info("Route managed by {}. Setting route {} AutoStartup flag to false.", getClass(), route.getId());
+ route.setAutoStartup(false);
+
+ stoppeddRoutes.add(route);
+
+ this.refCount.retain();
+
+ startManagedRoutes();
+ }
+
+ @Override
+ public synchronized void doShutdown() {
+ this.refCount.release();
+ }
+
+ protected abstract Service createService();
+
+ // ****************************************
+ // Helpers
+ // ****************************************
+
+ private void startService() {
+ // validate
+ StringHelper.notEmpty(lockMapName, "lockMapName", this);
+ StringHelper.notEmpty(lockKey, "lockKey", this);
+ StringHelper.notEmpty(lockValue, "lockValue", this);
+ ObjectHelper.notNull(camelContext, "camelContext", this);
+
+ try {
+ if (lifespanTimeUnit.convert(lifespan, TimeUnit.SECONDS) < 2) {
+ throw new IllegalArgumentException("Lock lifespan can not be less that 2 seconds");
+ }
+
+ this.service = createService();
+ this.service.start();
+ } catch (Exception e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+
+ private void stopService() {
+ leader.set(false);
+
+ try {
+ if (this.service != null) {
+ this.service.stop();
+ }
+ } catch (Exception e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+
+ protected void setLeader(boolean isLeader) {
+ if (isLeader && leader.compareAndSet(false, isLeader)) {
+ LOGGER.info("Leadership taken (map={}, key={}, val={})", lockMapName, lockKey, lockValue);
+ startManagedRoutes();
+ } else if (!isLeader && leader.getAndSet(isLeader)) {
+ LOGGER.info("Leadership lost (map={}, key={} val={})", lockMapName, lockKey, lockValue);
+ stopManagedRoutes();
+ }
+ }
+
+ private synchronized void startManagedRoutes() {
+ if (!isLeader()) {
+ return;
+ }
+
+ try {
+ for (Route route : stoppeddRoutes) {
+ LOGGER.debug("Starting route {}", route.getId());
+ startRoute(route);
+ startedRoutes.add(route);
+ }
+
+ stoppeddRoutes.removeAll(startedRoutes);
+ } catch (Exception e) {
+ handleException(e);
+ }
+ }
+
+ private synchronized void stopManagedRoutes() {
+ if (isLeader()) {
+ return;
+ }
+
+ try {
+ for (Route route : startedRoutes) {
+ LOGGER.debug("Stopping route {}", route.getId());
+ stopRoute(route);
+ stoppeddRoutes.add(route);
+ }
+
+ startedRoutes.removeAll(stoppeddRoutes);
+ } catch (Exception e) {
+ handleException(e);
+ }
+ }
+
+ // *************************************************************************
+ // Getter/Setters
+ // *************************************************************************
+
+ @ManagedAttribute(description = "Whether to stop route when starting up and failed to become master")
+ public boolean isShouldStopRoute() {
+ return shouldStopRoute;
+ }
+
+ public void setShouldStopRoute(boolean shouldStopRoute) {
+ this.shouldStopRoute = shouldStopRoute;
+ }
+
+ @ManagedAttribute(description = "The lock map name")
+ public String getLockMapName() {
+ return lockMapName;
+ }
+
+ public void setLockMapName(String lockMapName) {
+ this.lockMapName = lockMapName;
+ }
+
+ @ManagedAttribute(description = "The lock key")
+ public String getLockKey() {
+ return lockKey;
+ }
+
+ public void setLockKey(String lockKey) {
+ this.lockKey = lockKey;
+ }
+
+ @ManagedAttribute(description = "The lock value")
+ public String getLockValue() {
+ return lockValue;
+ }
+
+ public void setLockValue(String lockValue) {
+ this.lockValue = lockValue;
+ }
+
+ @ManagedAttribute(description = "The key lifespan for the lock")
+ public long getLifespan() {
+ return lifespan;
+ }
+
+ public void setLifespan(long lifespan) {
+ this.lifespan = lifespan;
+ }
+
+ public void setLifespan(long lifespan, TimeUnit lifespanTimeUnit) {
+ this.lifespan = lifespan;
+ this.lifespanTimeUnit = lifespanTimeUnit;
+ }
+
+ @ManagedAttribute(description = "The key lifespan time unit for the lock")
+ public TimeUnit getLifespanTimeUnit() {
+ return lifespanTimeUnit;
+ }
+
+ public void setLifespanTimeUnit(TimeUnit lifespanTimeUnit) {
+ this.lifespanTimeUnit = lifespanTimeUnit;
+ }
+
+ @ManagedAttribute(description = "Is this route the master or a slave")
+ public boolean isLeader() {
+ return leader.get();
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
index d9cfa7a..95e6e1e 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanUtil.java
@@ -20,6 +20,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
+import java.util.concurrent.ScheduledExecutorService;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
@@ -27,75 +28,15 @@ import org.apache.camel.Message;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.util.ObjectHelper;
import org.infinispan.AdvancedCache;
-import org.infinispan.Cache;
-import org.infinispan.client.hotrod.RemoteCache;
-import org.infinispan.client.hotrod.RemoteCacheManager;
import org.infinispan.commons.api.BasicCache;
-import org.infinispan.commons.api.BasicCacheContainer;
-import org.infinispan.context.Flag;
-import org.infinispan.manager.EmbeddedCacheManager;
-public final class InfinispanUtil {
- private InfinispanUtil() {
- }
-
- public static boolean isEmbedded(BasicCacheContainer container) {
- try {
- return container instanceof EmbeddedCacheManager;
- } catch (Exception e) {
- return false;
- }
- }
-
- public static <K, V> boolean isEmbedded(BasicCache<K, V> cache) {
- try {
- return cache instanceof Cache;
- } catch (Exception e) {
- return false;
- }
- }
-
- public static boolean isRemote(BasicCacheContainer container) {
- try {
- return container instanceof RemoteCacheManager;
- } catch (Exception e) {
- return false;
- }
- }
-
- public static RemoteCacheManager asRemote(BasicCacheContainer container) {
- return RemoteCacheManager.class.cast(container);
- }
-
- public static <K, V> boolean isRemote(BasicCache<K, V> cache) {
- try {
- return cache instanceof RemoteCache;
- } catch (Exception e) {
- return false;
- }
- }
-
- @SuppressWarnings("unchecked")
- public static <K, V> Cache<K, V> asEmbedded(BasicCache<K, V> cache) {
- return Cache.class.cast(cache);
- }
-
- @SuppressWarnings("unchecked")
- public static <K, V> RemoteCache<K, V> asRemote(BasicCache<K, V> cache) {
- return RemoteCache.class.cast(cache);
+public class InfinispanUtil {
+ protected InfinispanUtil() {
}
@SuppressWarnings("unchecked")
public static <K, V> AdvancedCache<K, V> asAdvanced(BasicCache<K, V> cache) {
- return Cache.class.cast(cache).getAdvancedCache();
- }
-
- public static <K, V> BasicCache<K, V> ignoreReturnValuesCache(BasicCache<K, V> cache) {
- if (isEmbedded(cache)) {
- return ((Cache<K, V>) cache).getAdvancedCache().withFlags(new Flag[] { Flag.IGNORE_RETURN_VALUES });
- } else {
- return cache;
- }
+ return (AdvancedCache) cache;
}
public static boolean isInHeaderEmpty(Exchange exchange, String header) {
@@ -126,4 +67,10 @@ public final class InfinispanUtil {
return Thread.currentThread().getContextClassLoader().getResourceAsStream(uri);
}
+
+ public static ScheduledExecutorService newSingleThreadScheduledExecutor(CamelContext camelContext, Object source) {
+ return camelContext.getExecutorServiceManager().newSingleThreadScheduledExecutor(
+ source,
+ source.getClass().getSimpleName());
+ }
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanConsumerEmbeddedHandler.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanConsumerEmbeddedHandler.java
deleted file mode 100644
index 8919092..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanConsumerEmbeddedHandler.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.component.infinispan.embedded;
-
-import org.apache.camel.component.infinispan.InfinispanConfiguration;
-import org.apache.camel.component.infinispan.InfinispanConsumer;
-import org.apache.camel.component.infinispan.InfinispanConsumerHandler;
-import org.apache.camel.component.infinispan.InfinispanEventListener;
-import org.apache.camel.component.infinispan.InfinispanUtil;
-import org.infinispan.Cache;
-
-public final class InfinispanConsumerEmbeddedHandler implements InfinispanConsumerHandler {
- public static final InfinispanConsumerHandler INSTANCE = new InfinispanConsumerEmbeddedHandler();
-
- private InfinispanConsumerEmbeddedHandler() {
- }
-
- @Override
- public InfinispanEventListener start(InfinispanConsumer consumer) {
- Cache<?, ?> embeddedCache = InfinispanUtil.asEmbedded(consumer.getCache());
- InfinispanConfiguration configuration = consumer.getConfiguration();
- InfinispanEventListener listener;
- if (configuration.hasCustomListener()) {
- listener = configuration.getCustomListener();
- listener.setInfinispanConsumer(consumer);
- } else if (configuration.isClusteredListener()) {
- if (configuration.isSync()) {
- listener = new InfinispanSyncClusteredEventListener(consumer, configuration.getEventTypes());
- } else {
- listener = new InfinispanAsyncClusteredEventListener(consumer, configuration.getEventTypes());
- }
- } else {
- if (configuration.isSync()) {
- listener = new InfinispanSyncLocalEventListener(consumer, configuration.getEventTypes());
- } else {
- listener = new InfinispanAsyncLocalEventListener(consumer, configuration.getEventTypes());
- }
- }
- embeddedCache.addListener(listener);
- return listener;
- }
-
- @Override
- public void stop(InfinispanConsumer consumer) {
- Cache<?, ?> embeddedCache = InfinispanUtil.asEmbedded(consumer.getCache());
- embeddedCache.removeListener(consumer.getListener());
- }
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
new file mode 100644
index 0000000..45cd27c
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedAggregationRepository.java
@@ -0,0 +1,82 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.function.Supplier;
+
+import org.apache.camel.component.infinispan.InfinispanAggregationRepository;
+import org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository;
+import org.apache.camel.support.DefaultExchangeHolder;
+import org.apache.camel.support.service.ServiceHelper;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.function.Suppliers;
+import org.infinispan.commons.api.BasicCache;
+
+public class InfinispanEmbeddedAggregationRepository extends InfinispanAggregationRepository {
+ private final Supplier<BasicCache<String, DefaultExchangeHolder>> cache;
+
+ private InfinispanEmbeddedConfiguration configuration;
+ private InfinispanEmbeddedManager manager;
+
+ /**
+ * Creates new {@link InfinispanRemoteAggregationRepository} that defaults to non-optimistic locking with
+ * recoverable behavior and a local Infinispan cache.
+ *
+ * @param cacheName cache name
+ */
+ public InfinispanEmbeddedAggregationRepository(String cacheName) {
+ super(cacheName);
+
+ this.cache = Suppliers.memorize(() -> manager.getCache(getCacheName()));
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ if (ObjectHelper.isEmpty(configuration)) {
+ configuration = new InfinispanEmbeddedConfiguration();
+ }
+ if (ObjectHelper.isEmpty(manager)) {
+ manager = new InfinispanEmbeddedManager(configuration);
+ }
+
+ manager.setCamelContext(getCamelContext());
+
+ ServiceHelper.startService(manager);
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ super.doStop();
+
+ ServiceHelper.stopService(manager);
+ }
+
+ @Override
+ protected BasicCache<String, DefaultExchangeHolder> getCache() {
+ return cache.get();
+ }
+
+ public InfinispanEmbeddedConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(InfinispanEmbeddedConfiguration configuration) {
+ this.configuration = configuration;
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java
new file mode 100644
index 0000000..103662c
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedComponent.java
@@ -0,0 +1,57 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.component.infinispan.InfinispanComponent;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+
+@Component(InfinispanEmbeddedComponent.SCHEME)
+public class InfinispanEmbeddedComponent extends InfinispanComponent {
+ public static final String SCHEME = "infinispan-embedded";
+
+ @Metadata(description = "Component configuration")
+ private InfinispanEmbeddedConfiguration configuration = new InfinispanEmbeddedConfiguration();
+
+ public InfinispanEmbeddedComponent() {
+ }
+
+ public InfinispanEmbeddedComponent(CamelContext camelContext) {
+ super(camelContext);
+ }
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+ InfinispanEmbeddedConfiguration conf = configuration.clone();
+
+ InfinispanEmbeddedEndpoint endpoint = new InfinispanEmbeddedEndpoint(uri, remaining, this, conf);
+ setProperties(endpoint, parameters);
+ return endpoint;
+ }
+
+ public void setConfiguration(InfinispanEmbeddedConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public InfinispanEmbeddedConfiguration getConfiguration() {
+ return configuration;
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
new file mode 100644
index 0000000..e32a677
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConfiguration.java
@@ -0,0 +1,158 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.infinispan.InfinispanConfiguration;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.infinispan.configuration.cache.Configuration;
+import org.infinispan.context.Flag;
+import org.infinispan.manager.EmbeddedCacheManager;
+
+@UriParams
+public class InfinispanEmbeddedConfiguration extends InfinispanConfiguration implements Cloneable {
+
+ @Metadata(autowired = true)
+ @UriParam(label = "advanced")
+ private Configuration cacheContainerConfiguration;
+ @Metadata(autowired = true)
+ @UriParam(label = "advanced")
+ private EmbeddedCacheManager cacheContainer;
+ @UriParam(label = "consumer", defaultValue = "true")
+ private boolean sync = true;
+ @UriParam(label = "consumer", defaultValue = "false")
+ private boolean clusteredListener;
+ @UriParam(label = "consumer")
+ private String eventTypes;
+ @UriParam(label = "consumer")
+ private InfinispanEmbeddedCustomListener customListener;
+ @UriParam(label = "advanced", javaType = "java.lang.String")
+ private Flag[] flags;
+
+ /**
+ * Specifies the cache Container to connect
+ */
+ public EmbeddedCacheManager getCacheContainer() {
+ return cacheContainer;
+ }
+
+ public void setCacheContainer(EmbeddedCacheManager cacheContainer) {
+ this.cacheContainer = cacheContainer;
+ }
+
+ public Configuration getCacheContainerConfiguration() {
+ return cacheContainerConfiguration;
+ }
+
+ /**
+ * The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types:
+ * org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration;
+ * org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration;
+ */
+ public void setCacheContainerConfiguration(Configuration cacheContainerConfiguration) {
+ this.cacheContainerConfiguration = cacheContainerConfiguration;
+ }
+
+ /**
+ * If true, the consumer will receive notifications synchronously
+ */
+ public boolean isSync() {
+ return sync;
+ }
+
+ public void setSync(boolean sync) {
+ this.sync = sync;
+ }
+
+ /**
+ * If true, the listener will be installed for the entire cluster
+ */
+ public boolean isClusteredListener() {
+ return clusteredListener;
+ }
+
+ public void setClusteredListener(boolean clusteredListener) {
+ this.clusteredListener = clusteredListener;
+ }
+
+ public String getEventTypes() {
+ return eventTypes;
+ }
+
+ /**
+ * Specifies the set of event types to register by the consumer.Multiple event can be separated by comma.
+ * <p/>
+ * The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED,
+ * CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED,
+ * TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED,
+ * TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSISTENCE_AVAILABILITY_CHANGED
+ */
+ public void setEventTypes(String eventTypes) {
+ this.eventTypes = eventTypes;
+ }
+
+ /**
+ * Returns the custom listener in use, if provided
+ */
+ public InfinispanEmbeddedCustomListener getCustomListener() {
+ return customListener;
+ }
+
+ public void setCustomListener(InfinispanEmbeddedCustomListener customListener) {
+ this.customListener = customListener;
+ }
+
+ public boolean hasCustomListener() {
+ return customListener != null;
+ }
+
+ public Flag[] getFlags() {
+ return flags;
+ }
+
+ /**
+ * A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote
+ * caches.
+ */
+ public void setFlags(String flagsAsString) {
+ String[] flagsArray = flagsAsString.split(",");
+ this.flags = new Flag[flagsArray.length];
+
+ for (int i = 0; i < flagsArray.length; i++) {
+ this.flags[i] = Flag.valueOf(flagsArray[i]);
+ }
+ }
+
+ public void setFlags(Flag... flags) {
+ this.flags = flags;
+ }
+
+ public boolean hasFlags() {
+ return flags != null && flags.length > 0;
+ }
+
+ @Override
+ public InfinispanEmbeddedConfiguration clone() {
+ try {
+ return (InfinispanEmbeddedConfiguration) super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java
new file mode 100644
index 0000000..848a937
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedConsumer.java
@@ -0,0 +1,156 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.camel.Processor;
+import org.apache.camel.Service;
+import org.apache.camel.component.infinispan.InfinispanConstants;
+import org.apache.camel.component.infinispan.InfinispanConsumer;
+import org.apache.camel.component.infinispan.InfinispanEndpoint;
+import org.apache.camel.component.infinispan.InfinispanEventListener;
+import org.apache.camel.support.service.ServiceHelper;
+import org.apache.camel.support.service.ServiceSupport;
+import org.infinispan.Cache;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.notifications.cachelistener.event.Event;
+import org.infinispan.query.Search;
+import org.infinispan.query.api.continuous.ContinuousQuery;
+import org.infinispan.query.api.continuous.ContinuousQueryListener;
+import org.infinispan.query.dsl.Query;
+
+public class InfinispanEmbeddedConsumer
+ extends InfinispanConsumer<EmbeddedCacheManager, InfinispanEmbeddedManager, InfinispanEmbeddedConfiguration> {
+ private Service handler;
+
+ public InfinispanEmbeddedConsumer(
+ InfinispanEndpoint endpoint,
+ Processor processor,
+ String cacheName,
+ InfinispanEmbeddedManager manager,
+ InfinispanEmbeddedConfiguration configuration) {
+ super(endpoint, processor, cacheName, manager, configuration);
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ if (getConfiguration().hasQueryBuilder()) {
+ handler = new ContinuousQueryHandler();
+ } else {
+ handler = new ConsumerHandler();
+ }
+
+ ServiceHelper.startService(handler);
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ super.doStop();
+ ServiceHelper.stopService(handler);
+ }
+
+ // *********************************
+ //
+ // Handlers
+ //
+ // *********************************
+
+ private class ContinuousQueryHandler extends ServiceSupport implements ContinuousQueryListener<Object, Object> {
+ private ContinuousQuery<Object, Object> continuousQuery;
+
+ @Override
+ public void resultJoining(Object key, Object value) {
+ processEvent(InfinispanConstants.CACHE_ENTRY_JOINING, cacheName, key, value, null);
+ }
+
+ @Override
+ public void resultUpdated(Object key, Object value) {
+ processEvent(InfinispanConstants.CACHE_ENTRY_UPDATED, cacheName, key, value, null);
+ }
+
+ @Override
+ public void resultLeaving(Object key) {
+ processEvent(InfinispanConstants.CACHE_ENTRY_LEAVING, cacheName, key, null, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void doStart() {
+ Cache<Object, Object> remoteCache = getCache(Cache.class);
+ Query<?> query = InfinispanEmbeddedUtil.buildQuery(getConfiguration().getQueryBuilder(), remoteCache);
+
+ continuousQuery = Search.getContinuousQuery(remoteCache);
+ continuousQuery.addContinuousQueryListener(query, this);
+ }
+
+ @Override
+ public void doStop() {
+ if (continuousQuery != null) {
+ continuousQuery.removeAllListeners();
+ }
+ }
+ }
+
+ private class ConsumerHandler extends ServiceSupport {
+ private InfinispanEventListener<Event.Type> listener;
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void doStart() {
+ final Cache<?, ?> cache = getCache(Cache.class);
+ final InfinispanEmbeddedConfiguration configuration = getConfiguration();
+
+ this.listener = configuration.getCustomListener();
+
+ if (this.listener == null) {
+ Set<Event.Type> events = new HashSet<>();
+ if (configuration.getEventTypes() != null) {
+ String eventTypes = configuration.getEventTypes();
+ for (String event : eventTypes.split(",")) {
+ events.add(Event.Type.valueOf(event));
+ }
+ }
+
+ if (configuration.isClusteredListener()) {
+ listener = configuration.isSync()
+ ? new InfinispanEmbeddedEventListeners.ClusteredSync(events)
+ : new InfinispanEmbeddedEventListeners.ClusteredAsync(events);
+ } else {
+ listener = configuration.isSync()
+ ? new InfinispanEmbeddedEventListeners.LocalSync(events)
+ : new InfinispanEmbeddedEventListeners.LocalAsync(events);
+ }
+ }
+
+ listener.setCacheName(cache.getName());
+ listener.setEventProcessor(InfinispanEmbeddedConsumer.this);
+
+ cache.addListener(listener);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void doStop() {
+ getCache(Cache.class).removeListener(listener);
+ }
+ }
+
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java
index 8db6d99..9403772 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedCustomListener.java
@@ -16,32 +16,22 @@
*/
package org.apache.camel.component.infinispan.embedded;
-import org.apache.camel.component.infinispan.InfinispanCustomListener;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryCreated;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryExpired;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
-import org.infinispan.notifications.cachelistener.event.CacheEntryEvent;
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.camel.component.infinispan.InfinispanEventListener;
+import org.infinispan.notifications.cachelistener.event.Event;
/**
* This class is supposed to be extended by users and annotated with @Listener and passed to the consumer endpoint
* through the 'customListener' parameter.
*/
-public abstract class InfinispanEmbeddedCustomListener extends InfinispanCustomListener {
-
- public InfinispanEmbeddedCustomListener() {
- super(null, null);
+public abstract class InfinispanEmbeddedCustomListener extends InfinispanEventListener<Event.Type> {
+ protected InfinispanEmbeddedCustomListener() {
+ super(Collections.emptySet());
}
- @CacheEntryCreated
- @CacheEntryModified
- @CacheEntryRemoved
- @CacheEntryExpired
- public void processEvent(CacheEntryEvent<Object, Object> event) {
- if (isAccepted(event.getType().toString())) {
- infinispanConsumer.processEvent(event.getType().toString(), event.isPre(), event.getCache().getName(),
- event.getKey());
- }
+ protected InfinispanEmbeddedCustomListener(Set<Event.Type> events) {
+ super(events);
}
-
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java
similarity index 63%
copy from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
copy to components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java
index 050f422..107ee31 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEndpoint.java
@@ -14,61 +14,66 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.embedded;
import org.apache.camel.Category;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
+import org.apache.camel.component.infinispan.InfinispanComponent;
+import org.apache.camel.component.infinispan.InfinispanEndpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
-import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.support.service.ServiceHelper;
/**
* Read and write from/to Infinispan distributed key/value store and data grid.
*/
-@UriEndpoint(firstVersion = "2.13.0", scheme = "infinispan", title = "Infinispan", syntax = "infinispan:cacheName",
+@UriEndpoint(firstVersion = "2.13.0", scheme = "infinispan-embedded", title = "Infinispan Embedded",
+ syntax = "infinispan-embedded:cacheName",
category = { Category.CACHE, Category.DATAGRID, Category.CLUSTERING })
-public class InfinispanEndpoint extends DefaultEndpoint {
+public class InfinispanEmbeddedEndpoint extends InfinispanEndpoint {
@UriPath(description = "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name.")
@Metadata(required = true)
private final String cacheName;
@UriParam
- private final InfinispanConfiguration configuration;
+ private final InfinispanEmbeddedConfiguration configuration;
- private final InfinispanManager manager;
+ private final InfinispanEmbeddedManager manager;
- public InfinispanEndpoint(String uri, String cacheName, InfinispanComponent component,
- InfinispanConfiguration configuration) {
+ public InfinispanEmbeddedEndpoint(String uri, String cacheName, InfinispanComponent component,
+ InfinispanEmbeddedConfiguration configuration) {
super(uri, component);
this.cacheName = cacheName;
this.configuration = configuration;
- this.manager = new InfinispanManager(component.getCamelContext(), configuration);
+ this.manager = new InfinispanEmbeddedManager(component.getCamelContext(), configuration);
}
@Override
protected void doStart() throws Exception {
- manager.start();
super.doStart();
+ ServiceHelper.startService(manager);
}
@Override
protected void doStop() throws Exception {
super.doStop();
- manager.stop();
+ ServiceHelper.stopService(manager);
}
@Override
public Producer createProducer() throws Exception {
- return new InfinispanProducer(this, cacheName, manager, configuration);
+ return new InfinispanEmbeddedProducer(this, cacheName, manager, configuration);
}
@Override
public Consumer createConsumer(Processor processor) throws Exception {
- InfinispanConsumer consumer = new InfinispanConsumer(this, processor, cacheName, manager, configuration);
+ InfinispanEmbeddedConsumer consumer
+ = new InfinispanEmbeddedConsumer(this, processor, cacheName, manager, configuration);
+
configureConsumer(consumer);
return consumer;
}
@@ -77,7 +82,7 @@ public class InfinispanEndpoint extends DefaultEndpoint {
return cacheName;
}
- public InfinispanConfiguration getConfiguration() {
+ public InfinispanEmbeddedConfiguration getConfiguration() {
return configuration;
}
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java
new file mode 100644
index 0000000..bd97500
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListener.java
@@ -0,0 +1,193 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.camel.component.infinispan.InfinispanConstants;
+import org.apache.camel.component.infinispan.InfinispanEventListener;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryActivated;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryCreated;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryExpired;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryInvalidated;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryLoaded;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryPassivated;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryVisited;
+import org.infinispan.notifications.cachelistener.event.CacheEntryActivatedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryCreatedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryExpiredEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryInvalidatedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryLoadedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryPassivatedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryVisitedEvent;
+import org.infinispan.notifications.cachelistener.event.Event;
+
+public abstract class InfinispanEmbeddedEventListener extends InfinispanEventListener<Event.Type> {
+ protected InfinispanEmbeddedEventListener() {
+ super(Collections.emptySet());
+ }
+
+ protected InfinispanEmbeddedEventListener(Set<Event.Type> events) {
+ super(events);
+ }
+
+ @CacheEntryActivated
+ public void processEvent(CacheEntryActivatedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ });
+ }
+ }
+
+ @CacheEntryCreated
+ public void processEvent(CacheEntryCreatedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ e.getMessage().setHeader(InfinispanConstants.COMMAND_RETRIED, event.isCommandRetried());
+ });
+ }
+ }
+
+ @CacheEntryInvalidated
+ public void processEvent(CacheEntryInvalidatedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ });
+ }
+ }
+
+ @CacheEntryLoaded
+ public void processEvent(CacheEntryLoadedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ });
+ }
+ }
+
+ @CacheEntryModified
+ public void processEvent(CacheEntryModifiedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ e.getMessage().setHeader(InfinispanConstants.COMMAND_RETRIED, event.isCommandRetried());
+ e.getMessage().setHeader(InfinispanConstants.ENTRY_CREATED, event.isCreated());
+ e.getMessage().setHeader(InfinispanConstants.ORIGIN_LOCAL, event.isOriginLocal());
+ e.getMessage().setHeader(InfinispanConstants.CURRENT_STATE, event.isCurrentState());
+ });
+ }
+ }
+
+ @CacheEntryPassivated
+ public void processEvent(CacheEntryPassivatedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ e.getMessage().setHeader(InfinispanConstants.ORIGIN_LOCAL, event.isOriginLocal());
+ e.getMessage().setHeader(InfinispanConstants.CURRENT_STATE, event.isCurrentState());
+ });
+ }
+ }
+
+ @CacheEntryRemoved
+ public void processEvent(CacheEntryRemovedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ e.getMessage().setHeader(InfinispanConstants.COMMAND_RETRIED, event.isCommandRetried());
+ e.getMessage().setHeader(InfinispanConstants.ORIGIN_LOCAL, event.isOriginLocal());
+ e.getMessage().setHeader(InfinispanConstants.CURRENT_STATE, event.isCurrentState());
+ e.getMessage().setHeader(InfinispanConstants.OLD_VALUE, event.getOldValue());
+ });
+ }
+ }
+
+ @CacheEntryVisited
+ public void processEvent(CacheEntryVisitedEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ e.getMessage().setHeader(InfinispanConstants.ORIGIN_LOCAL, event.isOriginLocal());
+ e.getMessage().setHeader(InfinispanConstants.CURRENT_STATE, event.isCurrentState());
+ });
+ }
+ }
+
+ @CacheEntryExpired
+ public void processEvent(CacheEntryExpiredEvent<?, ?> event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ event.getCache().getName(),
+ event.getKey(),
+ event.getValue(),
+ e -> {
+ e.getMessage().setHeader(InfinispanConstants.IS_PRE, event.isPre());
+ e.getMessage().setHeader(InfinispanConstants.ORIGIN_LOCAL, event.isOriginLocal());
+ e.getMessage().setHeader(InfinispanConstants.CURRENT_STATE, event.isCurrentState());
+ });
+ }
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java
new file mode 100644
index 0000000..57ffaea
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedEventListeners.java
@@ -0,0 +1,67 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.Set;
+
+import org.infinispan.notifications.Listener;
+import org.infinispan.notifications.cachelistener.event.Event;
+
+public final class InfinispanEmbeddedEventListeners {
+ private InfinispanEmbeddedEventListeners() {
+ }
+
+ // ******************************************
+ //
+ // Clustered
+ //
+ // ******************************************
+
+ @Listener(clustered = true, sync = false)
+ public static class ClusteredAsync extends InfinispanEmbeddedEventListener {
+ public ClusteredAsync(Set<Event.Type> eventTypes) {
+ super(eventTypes);
+ }
+ }
+
+ @Listener(clustered = true, sync = true)
+ public static class ClusteredSync extends InfinispanEmbeddedEventListener {
+ public ClusteredSync(Set<Event.Type> eventTypes) {
+ super(eventTypes);
+ }
+ }
+
+ // ******************************************
+ //
+ // Local
+ //
+ // ******************************************
+
+ @Listener(clustered = false, sync = false)
+ public static class LocalAsync extends InfinispanEmbeddedEventListener {
+ public LocalAsync(Set<Event.Type> eventTypes) {
+ super(eventTypes);
+ }
+ }
+
+ @Listener(clustered = false, sync = true)
+ public static class LocalSync extends InfinispanEmbeddedEventListener {
+ public LocalSync(Set<Event.Type> eventTypes) {
+ super(eventTypes);
+ }
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java
new file mode 100644
index 0000000..b4abfc3
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedIdempotentRepository.java
@@ -0,0 +1,96 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.function.Supplier;
+
+import org.apache.camel.api.management.ManagedResource;
+import org.apache.camel.component.infinispan.InfinispanIdempotentRepository;
+import org.apache.camel.util.function.Suppliers;
+import org.infinispan.commons.api.BasicCache;
+import org.infinispan.manager.EmbeddedCacheManager;
+
+@ManagedResource(description = "Infinispan Embedded message id repository")
+public class InfinispanEmbeddedIdempotentRepository extends InfinispanIdempotentRepository {
+ private final String cacheName;
+ private final Supplier<BasicCache<String, Boolean>> cache;
+
+ private InfinispanEmbeddedConfiguration configuration;
+ private InfinispanEmbeddedManager manager;
+
+ public InfinispanEmbeddedIdempotentRepository(String cacheName) {
+ this.cacheName = cacheName;
+ this.cache = Suppliers.memorize(() -> manager.getCache(getCacheName()));
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ if (this.configuration == null) {
+ this.configuration = new InfinispanEmbeddedConfiguration();
+ }
+
+ this.manager = new InfinispanEmbeddedManager(configuration);
+ this.manager.setCamelContext(getCamelContext());
+ this.manager.start();
+ }
+
+ @Override
+ protected void doShutdown() throws Exception {
+ this.manager.shutdown();
+ super.doShutdown();
+ }
+
+ @Override
+ protected BasicCache<String, Boolean> getCache() {
+ return cache.get();
+ }
+
+ @Override
+ public String getCacheName() {
+ return this.cacheName;
+ }
+
+ public InfinispanEmbeddedConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(InfinispanEmbeddedConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public InfinispanEmbeddedManager getManager() {
+ return manager;
+ }
+
+ public void setManager(InfinispanEmbeddedManager manager) {
+ this.manager = manager;
+ }
+
+ public EmbeddedCacheManager getCacheContainer() {
+ return configuration != null ? configuration.getCacheContainer() : null;
+ }
+
+ public void setCacheContainer(EmbeddedCacheManager cacheContainer) {
+ if (this.configuration == null) {
+ this.configuration = new InfinispanEmbeddedConfiguration();
+ }
+
+ this.configuration.setCacheContainer(cacheContainer);
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java
new file mode 100644
index 0000000..bf17659
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedManager.java
@@ -0,0 +1,147 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.Set;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Message;
+import org.apache.camel.component.infinispan.InfinispanConstants;
+import org.apache.camel.component.infinispan.InfinispanManager;
+import org.apache.camel.component.infinispan.InfinispanUtil;
+import org.apache.camel.support.service.ServiceSupport;
+import org.apache.camel.util.ObjectHelper;
+import org.infinispan.Cache;
+import org.infinispan.commons.api.BasicCache;
+import org.infinispan.configuration.cache.Configuration;
+import org.infinispan.configuration.cache.ConfigurationBuilder;
+import org.infinispan.configuration.global.GlobalConfigurationBuilder;
+import org.infinispan.context.Flag;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
+
+import static org.apache.camel.component.infinispan.InfinispanConstants.CACHE_MANAGER_CURRENT;
+
+public class InfinispanEmbeddedManager extends ServiceSupport implements InfinispanManager<EmbeddedCacheManager> {
+ private final InfinispanEmbeddedConfiguration configuration;
+ private CamelContext camelContext;
+ private EmbeddedCacheManager cacheContainer;
+ private boolean isManagedCacheContainer;
+
+ public InfinispanEmbeddedManager() {
+ this(null, new InfinispanEmbeddedConfiguration());
+ }
+
+ public InfinispanEmbeddedManager(InfinispanEmbeddedConfiguration configuration) {
+ this(null, configuration);
+ }
+
+ public InfinispanEmbeddedManager(CamelContext camelContext, InfinispanEmbeddedConfiguration configuration) {
+ this.camelContext = camelContext;
+ this.configuration = configuration;
+ }
+
+ @Override
+ public CamelContext getCamelContext() {
+ return camelContext;
+ }
+
+ @Override
+ public void setCamelContext(CamelContext camelContext) {
+ this.camelContext = camelContext;
+ }
+
+ @Override
+ public void doStart() throws Exception {
+ cacheContainer = configuration.getCacheContainer();
+
+ if (cacheContainer == null) {
+ final Configuration containerConf = configuration.getCacheContainerConfiguration();
+ // Check if a container configuration object has been provided so use
+ // it and discard any other additional configuration.
+ if (containerConf != null) {
+ cacheContainer = new DefaultCacheManager(
+ new GlobalConfigurationBuilder().defaultCacheName("default").build(),
+ containerConf,
+ true);
+ } else {
+ if (ObjectHelper.isNotEmpty(configuration.getConfigurationUri())) {
+ cacheContainer = new DefaultCacheManager(
+ InfinispanUtil.openInputStream(camelContext, configuration.getConfigurationUri()),
+ true);
+ } else {
+ cacheContainer = new DefaultCacheManager(
+ new GlobalConfigurationBuilder().defaultCacheName("default").build(),
+ new ConfigurationBuilder().build());
+ }
+ }
+
+ isManagedCacheContainer = true;
+ }
+ }
+
+ @Override
+ public void doStop() throws Exception {
+ if (isManagedCacheContainer) {
+ cacheContainer.stop();
+ }
+ super.doStop();
+ }
+
+ @Override
+ public EmbeddedCacheManager getCacheContainer() {
+ return cacheContainer;
+ }
+
+ @Override
+ public <K, V> BasicCache<K, V> getCache() {
+ Cache<K, V> cache = cacheContainer.getCache();
+
+ return configuration.hasFlags()
+ ? cache.getAdvancedCache().withFlags(configuration.getFlags())
+ : cache;
+ }
+
+ @Override
+ public <K, V> BasicCache<K, V> getCache(String cacheName) {
+ Cache<K, V> cache;
+ if (ObjectHelper.isEmpty(cacheName) || CACHE_MANAGER_CURRENT.equals(cacheName)) {
+ cache = cacheContainer.getCache();
+ } else {
+ cache = cacheContainer.getCache(cacheName);
+ }
+
+ return configuration.hasFlags()
+ ? cache.getAdvancedCache().withFlags(configuration.getFlags())
+ : cache;
+ }
+
+ @Override
+ public <K, V> BasicCache<K, V> getCache(Message message, String defaultCache) {
+ final String cacheName = message.getHeader(InfinispanConstants.CACHE_NAME, defaultCache, String.class);
+ final Cache<K, V> cache = (Cache<K, V>) getCache(cacheName);
+
+ return message.getHeader(InfinispanConstants.IGNORE_RETURN_VALUES, false, boolean.class)
+ ? cache.getAdvancedCache().withFlags(Flag.IGNORE_RETURN_VALUES)
+ : cache;
+ }
+
+ @Override
+ public Set<String> getCacheNames() {
+ return cacheContainer.getCacheNames();
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java
new file mode 100644
index 0000000..354a2d5
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedProducer.java
@@ -0,0 +1,57 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import org.apache.camel.Message;
+import org.apache.camel.component.infinispan.InfinispanProducer;
+import org.apache.camel.spi.InvokeOnHeader;
+import org.infinispan.Cache;
+import org.infinispan.query.dsl.Query;
+
+public class InfinispanEmbeddedProducer extends InfinispanProducer<InfinispanEmbeddedManager, InfinispanEmbeddedConfiguration> {
+ public InfinispanEmbeddedProducer(
+ InfinispanEmbeddedEndpoint endpoint,
+ String cacheName,
+ InfinispanEmbeddedManager manager,
+ InfinispanEmbeddedConfiguration configuration) {
+ super(endpoint, cacheName, manager, configuration);
+ }
+
+ // ************************************
+ // Operations
+ // ************************************
+
+ @SuppressWarnings("unchecked")
+ @InvokeOnHeader("STATS")
+ public void onStats(Message message) {
+ final Cache<Object, Object> cache = getManager().getCache(message, getCacheName(), Cache.class);
+ final Object result = cache.getAdvancedCache().getStats();
+
+ setResult(message, result);
+ }
+
+ @SuppressWarnings("unchecked")
+ @InvokeOnHeader("QUERY")
+ public void onQuery(Message message) {
+ final Cache<Object, Object> cache = getManager().getCache(message, getCacheName(), Cache.class);
+ final Query<?> query = InfinispanEmbeddedUtil.buildQuery(getConfiguration(), cache, message);
+
+ if (query != null) {
+ setResult(message, query.execute().list());
+ }
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java
new file mode 100644
index 0000000..615a77c
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedRoutePolicy.java
@@ -0,0 +1,150 @@
+/*
+ * 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.component.infinispan.embedded;
+
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+
+import org.apache.camel.Service;
+import org.apache.camel.api.management.ManagedResource;
+import org.apache.camel.component.infinispan.InfinispanRoutePolicy;
+import org.apache.camel.support.service.ServiceSupport;
+import org.apache.camel.util.ObjectHelper;
+import org.infinispan.Cache;
+import org.infinispan.notifications.Listener;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryExpired;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
+import org.infinispan.notifications.cachelistener.event.CacheEntryEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ManagedResource(description = "Route policy using Infinispan Embedded as clustered lock")
+public class InfinispanEmbeddedRoutePolicy extends InfinispanRoutePolicy {
+ private static final Logger LOGGER = LoggerFactory.getLogger(InfinispanEmbeddedRoutePolicy.class);
+
+ private final InfinispanEmbeddedManager manager;
+
+ public InfinispanEmbeddedRoutePolicy(InfinispanEmbeddedConfiguration configuration) {
+ this(configuration, null, null);
+ }
+
+ public InfinispanEmbeddedRoutePolicy(InfinispanEmbeddedConfiguration configuration, String lockKey, String lockValue) {
+ super(lockKey, lockValue);
+
+ this.manager = new InfinispanEmbeddedManager(configuration);
+ }
+
+ @Override
+ protected Service createService() {
+ return new EmbeddedCacheService();
+ }
+
+ @Override
+ public void doStart() throws Exception {
+ super.doStart();
+ this.manager.start();
+ }
+
+ @Override
+ public void doStop() throws Exception {
+ super.doStop();
+ this.manager.stop();
+ }
+
+ // *************************************************************************
+ //
+ // *************************************************************************
+
+ @Listener(clustered = true, sync = false)
+ private final class EmbeddedCacheService extends ServiceSupport {
+ private Cache<String, String> cache;
+ private ScheduledExecutorService executorService;
+ private ScheduledFuture<?> future;
+
+ EmbeddedCacheService() {
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doStart() throws Exception {
+ this.executorService = getCamelContext().getExecutorServiceManager().newSingleThreadScheduledExecutor(this,
+ getClass().getSimpleName());
+ this.cache = manager.getCache(getLockMapName(), Cache.class);
+ this.cache.addListener(this);
+ this.future = executorService.scheduleAtFixedRate(this::run, 0, getLifespan() / 2, getLifespanTimeUnit());
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ if (cache != null) {
+ this.cache.removeListener(this);
+ this.cache.remove(getLockKey(), getLockValue());
+ }
+
+ if (future != null) {
+ future.cancel(true);
+ future = null;
+ }
+
+ getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService);
+ }
+
+ private void run() {
+ if (!isRunAllowed()) {
+ return;
+ }
+
+ if (isLeader()) {
+ // I'm still the leader, so refresh the key so it does not expire.
+ if (!cache.replace(getLockKey(), getLockValue(), getLockValue(), getLifespan(), getLifespanTimeUnit())) {
+ // Looks like I've lost the leadership.
+ setLeader(false);
+ }
+ }
+
+ if (!isLeader()) {
+ Object result = cache.putIfAbsent(getLockKey(), getLockValue(), getLifespan(), getLifespanTimeUnit());
+ if (result == null) {
+ // Acquired the key so I'm the leader.
+ setLeader(true);
+ } else if (ObjectHelper.equal(getLockValue(), result) && !isLeader()) {
+ // Hey, I may have recovered from failure (or reboot was really
+ // fast) and my key was still there so yeah, I'm the leader again!
+ setLeader(true);
+ } else {
+ setLeader(false);
+ }
+ }
+ }
+
+ @CacheEntryRemoved
+ public void onCacheEntryRemoved(CacheEntryEvent<Object, Object> event) {
+ LOGGER.debug("onCacheEntryExpired lock-key={}, event-key={}", getLockKey(), event.getKey());
+ if (ObjectHelper.equal(getLockKey(), event.getKey())) {
+ run();
+ }
+ }
+
+ @CacheEntryExpired
+ public void onCacheEntryExpired(CacheEntryEvent<Object, Object> event) {
+ LOGGER.debug("onCacheEntryExpired lock-key={}, event-key={}", getLockKey(), event.getKey());
+ if (ObjectHelper.equal(getLockKey(), event.getKey())) {
+ run();
+ }
+ }
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteOperation.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
similarity index 51%
copy from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteOperation.java
copy to components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
index c412742..1efe3b0 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteOperation.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanEmbeddedUtil.java
@@ -14,41 +14,46 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.infinispan.remote;
+package org.apache.camel.component.infinispan.embedded;
import org.apache.camel.Message;
import org.apache.camel.component.infinispan.InfinispanConfiguration;
import org.apache.camel.component.infinispan.InfinispanConstants;
import org.apache.camel.component.infinispan.InfinispanQueryBuilder;
import org.apache.camel.component.infinispan.InfinispanUtil;
-import org.infinispan.client.hotrod.RemoteCache;
-import org.infinispan.client.hotrod.Search;
-import org.infinispan.commons.api.BasicCache;
+import org.apache.camel.component.infinispan.remote.InfinispanRemoteManager;
+import org.infinispan.Cache;
+import org.infinispan.context.Flag;
+import org.infinispan.query.Search;
import org.infinispan.query.dsl.Query;
-public final class InfinispanRemoteOperation {
- private InfinispanRemoteOperation() {
+public final class InfinispanEmbeddedUtil extends InfinispanUtil {
+ protected InfinispanEmbeddedUtil() {
}
- public static Query buildQuery(InfinispanConfiguration configuration, BasicCache<Object, Object> cache, Message message) {
- InfinispanQueryBuilder queryBuilder
- = message.getHeader(InfinispanConstants.QUERY_BUILDER, InfinispanQueryBuilder.class);
- if (queryBuilder == null) {
- queryBuilder = configuration.getQueryBuilder();
- }
+ @SuppressWarnings("unchecked")
+ public static <K, V> Cache<K, V> getCacheWithFlags(InfinispanRemoteManager manager, String cacheName, Flag... flags) {
+ final Cache<K, V> cache = manager.getCache(cacheName, Cache.class);
- return buildQuery(queryBuilder, cache);
+ return flags == null || flags.length == 0 ? cache : cache.getAdvancedCache().withFlags(flags);
}
- public static Query buildQuery(InfinispanConfiguration configuration, BasicCache<Object, Object> cache) {
- return buildQuery(configuration.getQueryBuilder(), cache);
+ public static Query<?> buildQuery(
+ InfinispanConfiguration configuration, Cache<Object, Object> cache, Message message) {
+
+ InfinispanQueryBuilder builder = message.getHeader(InfinispanConstants.QUERY_BUILDER, InfinispanQueryBuilder.class);
+ if (builder == null) {
+ builder = configuration.getQueryBuilder();
+ }
+
+ return buildQuery(builder, cache);
}
- public static Query buildQuery(InfinispanQueryBuilder queryBuilder, BasicCache<Object, Object> cache) {
- return buildQuery(queryBuilder, InfinispanUtil.asRemote(cache));
+ public static Query<?> buildQuery(InfinispanConfiguration configuration, Cache<Object, Object> cache) {
+ return buildQuery(configuration.getQueryBuilder(), cache);
}
- public static Query buildQuery(InfinispanQueryBuilder queryBuilder, RemoteCache<Object, Object> cache) {
+ public static Query<?> buildQuery(InfinispanQueryBuilder queryBuilder, Cache<Object, Object> cache) {
return queryBuilder != null ? queryBuilder.build(Search.getQueryFactory(cache)) : null;
}
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncClusteredEventListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncClusteredEventListener.java
deleted file mode 100644
index 5a7aa88..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncClusteredEventListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.component.infinispan.embedded;
-
-import java.util.Set;
-
-import org.apache.camel.component.infinispan.InfinispanConsumer;
-import org.apache.camel.component.infinispan.InfinispanEventListener;
-import org.infinispan.notifications.Listener;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryCreated;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryExpired;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
-import org.infinispan.notifications.cachelistener.event.CacheEntryEvent;
-
-@Listener(clustered = true, sync = true)
-public class InfinispanSyncClusteredEventListener extends InfinispanEventListener {
- // clustered listeners only listen for post events
- private static final boolean IS_PRE = false;
-
- public InfinispanSyncClusteredEventListener(InfinispanConsumer infinispanConsumer, Set<String> eventTypes) {
- super(infinispanConsumer, eventTypes);
- }
-
- @CacheEntryCreated
- @CacheEntryModified
- @CacheEntryRemoved
- @CacheEntryExpired
- public void processEvent(CacheEntryEvent<Object, Object> event) {
- if (isAccepted(event.getType().toString())) {
- infinispanConsumer.processEvent(event.getType().toString(), IS_PRE, event.getCache().getName(), event.getKey());
- }
- }
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncLocalEventListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncLocalEventListener.java
deleted file mode 100644
index ab95ff5..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/embedded/InfinispanSyncLocalEventListener.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.component.infinispan.embedded;
-
-import java.util.Set;
-
-import org.apache.camel.component.infinispan.InfinispanConsumer;
-import org.apache.camel.component.infinispan.InfinispanEventListener;
-import org.infinispan.notifications.Listener;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryActivated;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryCreated;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryExpired;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryInvalidated;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryLoaded;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryPassivated;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryVisited;
-import org.infinispan.notifications.cachelistener.event.CacheEntryEvent;
-
-@Listener(clustered = false, sync = true)
-public class InfinispanSyncLocalEventListener extends InfinispanEventListener {
- public InfinispanSyncLocalEventListener(InfinispanConsumer infinispanConsumer, Set<String> eventTypes) {
- super(infinispanConsumer, eventTypes);
- }
-
- @CacheEntryActivated
- @CacheEntryCreated
- @CacheEntryInvalidated
- @CacheEntryLoaded
- @CacheEntryModified
- @CacheEntryPassivated
- @CacheEntryRemoved
- @CacheEntryVisited
- @CacheEntryExpired
- public void processEvent(CacheEntryEvent<Object, Object> event) {
- dispatch(event.getType().toString(), event.isPre(), event.getCache().getName(), event.getKey());
- }
-
- private void dispatch(String eventType, boolean isPre, String cacheName, Object key) {
- if (isAccepted(eventType)) {
- infinispanConsumer.processEvent(eventType, isPre, cacheName, key, null);
- }
- }
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java
deleted file mode 100644
index db90bfc..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * 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.component.infinispan.policy;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.Route;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.Service;
-import org.apache.camel.api.management.ManagedAttribute;
-import org.apache.camel.api.management.ManagedResource;
-import org.apache.camel.component.infinispan.InfinispanConfiguration;
-import org.apache.camel.component.infinispan.InfinispanManager;
-import org.apache.camel.component.infinispan.InfinispanUtil;
-import org.apache.camel.support.RoutePolicySupport;
-import org.apache.camel.support.service.ServiceSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.ReferenceCount;
-import org.apache.camel.util.StringHelper;
-import org.infinispan.Cache;
-import org.infinispan.client.hotrod.RemoteCache;
-import org.infinispan.client.hotrod.annotation.ClientCacheEntryExpired;
-import org.infinispan.client.hotrod.annotation.ClientCacheEntryRemoved;
-import org.infinispan.client.hotrod.annotation.ClientListener;
-import org.infinispan.client.hotrod.event.ClientCacheEntryExpiredEvent;
-import org.infinispan.client.hotrod.event.ClientCacheEntryRemovedEvent;
-import org.infinispan.commons.api.BasicCache;
-import org.infinispan.commons.api.BasicCacheContainer;
-import org.infinispan.notifications.Listener;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryExpired;
-import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
-import org.infinispan.notifications.cachelistener.event.CacheEntryEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@ManagedResource(description = "Route policy using Infinispan as clustered lock")
-public class InfinispanRoutePolicy extends RoutePolicySupport implements CamelContextAware {
- private static final Logger LOGGER = LoggerFactory.getLogger(InfinispanRoutePolicy.class);
-
- private final AtomicBoolean leader;
- private final Set<Route> startedRoutes;
- private final Set<Route> stoppeddRoutes;
- private final InfinispanManager manager;
- private final ReferenceCount refCount;
-
- private CamelContext camelContext;
- private ScheduledExecutorService executorService;
- private boolean shouldStopRoute;
- private String lockMapName;
- private String lockKey;
- private String lockValue;
- private long lifespan;
- private TimeUnit lifespanTimeUnit;
- private ScheduledFuture<?> future;
- private Service service;
-
- public InfinispanRoutePolicy(InfinispanConfiguration configuration) {
- this(new InfinispanManager(configuration), null, null);
- }
-
- public InfinispanRoutePolicy(InfinispanManager manager) {
- this(manager, null, null);
- }
-
- public InfinispanRoutePolicy(InfinispanManager manager, String lockKey, String lockValue) {
- this.manager = manager;
- this.stoppeddRoutes = new HashSet<>();
- this.startedRoutes = new HashSet<>();
- this.leader = new AtomicBoolean();
- this.shouldStopRoute = true;
- this.lockKey = lockKey;
- this.lockValue = lockValue;
- this.lifespan = 30;
- this.lifespanTimeUnit = TimeUnit.SECONDS;
- this.service = null;
- this.refCount = ReferenceCount.on(this::startService, this::stopService);
- }
-
- @Override
- public CamelContext getCamelContext() {
- return camelContext;
- }
-
- @Override
- public void setCamelContext(CamelContext camelContext) {
- this.camelContext = camelContext;
- }
-
- @Override
- public synchronized void onInit(Route route) {
- super.onInit(route);
-
- LOGGER.info("Route managed by {}. Setting route {} AutoStartup flag to false.", getClass(), route.getId());
- route.setAutoStartup(false);
-
- stoppeddRoutes.add(route);
-
- this.refCount.retain();
-
- startManagedRoutes();
- }
-
- @Override
- public synchronized void doShutdown() {
- this.refCount.release();
- }
-
- // ****************************************
- // Helpers
- // ****************************************
-
- private void startService() {
- // validate
- StringHelper.notEmpty(lockMapName, "lockMapName", this);
- StringHelper.notEmpty(lockKey, "lockKey", this);
- StringHelper.notEmpty(lockValue, "lockValue", this);
- ObjectHelper.notNull(camelContext, "camelContext", this);
-
- try {
- this.manager.start();
- this.executorService = getCamelContext().getExecutorServiceManager().newSingleThreadScheduledExecutor(this,
- "InfinispanRoutePolicy");
-
- if (lifespanTimeUnit.convert(lifespan, TimeUnit.SECONDS) < 2) {
- throw new IllegalArgumentException("Lock lifespan can not be less that 2 seconds");
- }
-
- if (manager.isCacheContainerEmbedded()) {
- BasicCache<String, String> cache = manager.getCache(lockMapName);
- this.service = new EmbeddedCacheService(InfinispanUtil.asEmbedded(cache));
- } else {
- // By default, previously existing values for java.util.Map operations
- // are not returned for remote caches but policy needs it so force it.
- BasicCache<String, String> cache = manager.getCache(lockMapName, true);
- this.service = new RemoteCacheService(InfinispanUtil.asRemote(cache));
- }
-
- service.start();
- } catch (Exception e) {
- throw new RuntimeCamelException(e);
- }
- }
-
- private void stopService() {
- leader.set(false);
-
- try {
- if (future != null) {
- future.cancel(true);
- future = null;
- }
-
- manager.stop();
-
- if (this.service != null) {
- this.service.stop();
- }
-
- getCamelContext().getExecutorServiceManager().shutdownGraceful(executorService);
- } catch (Exception e) {
- throw new RuntimeCamelException(e);
- }
- }
-
- private void setLeader(boolean isLeader) {
- if (isLeader && leader.compareAndSet(false, isLeader)) {
- LOGGER.info("Leadership taken (map={}, key={}, val={})", lockMapName, lockKey, lockValue);
- startManagedRoutes();
- } else if (!isLeader && leader.getAndSet(isLeader)) {
- LOGGER.info("Leadership lost (map={}, key={} val={})", lockMapName, lockKey, lockValue);
- stopManagedRoutes();
- }
- }
-
- private synchronized void startManagedRoutes() {
- if (!isLeader()) {
- return;
- }
-
- try {
- for (Route route : stoppeddRoutes) {
- LOGGER.debug("Starting route {}", route.getId());
- startRoute(route);
- startedRoutes.add(route);
- }
-
- stoppeddRoutes.removeAll(startedRoutes);
- } catch (Exception e) {
- handleException(e);
- }
- }
-
- private synchronized void stopManagedRoutes() {
- if (isLeader()) {
- return;
- }
-
- try {
- for (Route route : startedRoutes) {
- LOGGER.debug("Stopping route {}", route.getId());
- stopRoute(route);
- stoppeddRoutes.add(route);
- }
-
- startedRoutes.removeAll(stoppeddRoutes);
- } catch (Exception e) {
- handleException(e);
- }
- }
-
- // *************************************************************************
- // Getter/Setters
- // *************************************************************************
-
- @ManagedAttribute(description = "Whether to stop route when starting up and failed to become master")
- public boolean isShouldStopRoute() {
- return shouldStopRoute;
- }
-
- public void setShouldStopRoute(boolean shouldStopRoute) {
- this.shouldStopRoute = shouldStopRoute;
- }
-
- @ManagedAttribute(description = "The lock map name")
- public String getLockMapName() {
- return lockMapName;
- }
-
- public void setLockMapName(String lockMapName) {
- this.lockMapName = lockMapName;
- }
-
- @ManagedAttribute(description = "The lock key")
- public String getLockKey() {
- return lockKey;
- }
-
- public void setLockKey(String lockKey) {
- this.lockKey = lockKey;
- }
-
- @ManagedAttribute(description = "The lock value")
- public String getLockValue() {
- return lockValue;
- }
-
- public void setLockValue(String lockValue) {
- this.lockValue = lockValue;
- }
-
- @ManagedAttribute(description = "The key lifespan for the lock")
- public long getLifespan() {
- return lifespan;
- }
-
- public void setLifespan(long lifespan) {
- this.lifespan = lifespan;
- }
-
- public void setLifespan(long lifespan, TimeUnit lifespanTimeUnit) {
- this.lifespan = lifespan;
- this.lifespanTimeUnit = lifespanTimeUnit;
- }
-
- @ManagedAttribute(description = "The key lifespan time unit for the lock")
- public TimeUnit getLifespanTimeUnit() {
- return lifespanTimeUnit;
- }
-
- public void setLifespanTimeUnit(TimeUnit lifespanTimeUnit) {
- this.lifespanTimeUnit = lifespanTimeUnit;
- }
-
- @ManagedAttribute(description = "Is this route the master or a slave")
- public boolean isLeader() {
- return leader.get();
- }
-
- // *************************************************************************
- //
- // *************************************************************************
-
- @Listener(clustered = true, sync = false)
- private final class EmbeddedCacheService extends ServiceSupport implements Runnable {
- private Cache<String, String> cache;
- private ScheduledFuture<?> future;
-
- EmbeddedCacheService(Cache<String, String> cache) {
- this.cache = cache;
- this.future = null;
- }
-
- @Override
- protected void doStart() throws Exception {
- this.future = executorService.scheduleAtFixedRate(this::run, 0, lifespan / 2, lifespanTimeUnit);
- this.cache.addListener(this);
- }
-
- @Override
- protected void doStop() throws Exception {
- this.cache.removeListener(this);
- this.cache.remove(lockKey, lockValue);
-
- if (future != null) {
- future.cancel(true);
- future = null;
- }
- }
-
- @Override
- public void run() {
- if (!isRunAllowed()) {
- return;
- }
-
- if (isLeader()) {
- // I'm still the leader, so refresh the key so it does not expire.
- if (!cache.replace(lockKey, lockValue, lockValue, lifespan, lifespanTimeUnit)) {
- // Looks like I've lost the leadership.
- setLeader(false);
- }
- }
-
- if (!isLeader()) {
- Object result = cache.putIfAbsent(lockKey, lockValue, lifespan, lifespanTimeUnit);
- if (result == null) {
- // Acquired the key so I'm the leader.
- setLeader(true);
- } else if (ObjectHelper.equal(lockValue, result) && !isLeader()) {
- // Hey, I may have recovered from failure (or reboot was really
- // fast) and my key was still there so yeah, I'm the leader again!
- setLeader(true);
- } else {
- setLeader(false);
- }
- }
- }
-
- @CacheEntryRemoved
- public void onCacheEntryRemoved(CacheEntryEvent<Object, Object> event) {
- if (ObjectHelper.equal(lockKey, event.getKey())) {
- run();
- }
- }
-
- @CacheEntryExpired
- public void onCacheEntryExpired(CacheEntryEvent<Object, Object> event) {
- if (ObjectHelper.equal(lockKey, event.getKey())) {
- run();
- }
- }
- }
-
- @ClientListener
- private final class RemoteCacheService extends ServiceSupport implements Runnable {
- private RemoteCache<String, String> cache;
- private ScheduledFuture<?> future;
- private Long version;
-
- RemoteCacheService(RemoteCache<String, String> cache) {
- this.cache = cache;
- this.future = null;
- this.version = null;
- }
-
- @Override
- protected void doStart() throws Exception {
- this.future = executorService.scheduleAtFixedRate(this::run, 0, lifespan / 2, lifespanTimeUnit);
- this.cache.addClientListener(this);
- }
-
- @Override
- protected void doStop() throws Exception {
- this.cache.removeClientListener(this);
-
- if (this.version != null) {
- this.cache.removeWithVersion(lockKey, this.version);
- }
-
- if (future != null) {
- future.cancel(true);
- future = null;
- }
- }
-
- @Override
- public void run() {
- if (!isRunAllowed()) {
- return;
- }
-
- if (isLeader() && version != null) {
- LOGGER.debug("Lock refresh key={} with version={}", lockKey, version);
-
- // I'm still the leader, so refresh the key so it does not expire.
- if (!cache.replaceWithVersion(lockKey, lockValue, version, (int) lifespanTimeUnit.toSeconds(lifespan))) {
- setLeader(false);
- } else {
- version = cache.getWithMetadata(lockKey).getVersion();
- LOGGER.debug("Lock refreshed key={} with new version={}", lockKey, version);
- }
- }
-
- if (!isLeader()) {
- Object result = cache.putIfAbsent(lockKey, lockValue, lifespan, lifespanTimeUnit);
- if (result == null) {
- // Acquired the key so I'm the leader.
- setLeader(true);
-
- // Get the version
- version = cache.getWithMetadata(lockKey).getVersion();
-
- LOGGER.debug("Lock acquired key={} with version={}", lockKey, version);
- } else if (ObjectHelper.equal(lockValue, result) && !isLeader()) {
- // Hey, I may have recovered from failure (or reboot was really
- // fast) and my key was still there so yeah, I'm the leader again!
- setLeader(true);
-
- // Get the version
- version = cache.getWithMetadata(lockKey).getVersion();
-
- LOGGER.debug("Lock resumed key={} with version={}", lockKey, version);
- } else {
- setLeader(false);
- }
- }
- }
-
- @ClientCacheEntryRemoved
- public void onCacheEntryRemoved(ClientCacheEntryRemovedEvent<String> event) {
- if (ObjectHelper.equal(lockKey, event.getKey())) {
- run();
- }
- }
-
- @ClientCacheEntryExpired
- public void onCacheEntryExpired(ClientCacheEntryExpiredEvent<String> event) {
- if (ObjectHelper.equal(lockKey, event.getKey())) {
- run();
- }
- }
- }
-
- // *************************************************************************
- // Helpers
- // *************************************************************************
-
- public static InfinispanRoutePolicy withManager(BasicCacheContainer cacheContainer) {
- InfinispanConfiguration conf = new InfinispanConfiguration();
- conf.setCacheContainer(cacheContainer);
-
- return new InfinispanRoutePolicy(conf);
- }
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanLocalAggregationRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanLocalAggregationRepository.java
deleted file mode 100644
index 189ecfa..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/aggregate/InfinispanLocalAggregationRepository.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * 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.component.infinispan.processor.aggregate;
-
-import java.util.Collections;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.spi.RecoverableAggregationRepository;
-import org.apache.camel.support.DefaultExchange;
-import org.apache.camel.support.DefaultExchangeHolder;
-import org.apache.camel.support.service.ServiceSupport;
-import org.apache.camel.util.ObjectHelper;
-import org.infinispan.commons.api.BasicCache;
-import org.infinispan.configuration.cache.Configuration;
-import org.infinispan.configuration.global.GlobalConfigurationBuilder;
-import org.infinispan.manager.DefaultCacheManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class InfinispanLocalAggregationRepository extends ServiceSupport implements RecoverableAggregationRepository {
-
- private static final Logger LOG = LoggerFactory.getLogger(InfinispanLocalAggregationRepository.class.getName());
-
- private boolean useRecovery = true;
- private DefaultCacheManager manager;
- private String cacheName;
- private String deadLetterChannel;
- private long recoveryInterval = 5000;
- private int maximumRedeliveries = 3;
- private boolean allowSerializedHeaders;
- private BasicCache<String, DefaultExchangeHolder> cache;
- private Configuration configuration;
-
- /**
- * Creates new {@link InfinispanLocalAggregationRepository} that defaults to non-optimistic locking with recoverable
- * behavior and a local Infinispan cache.
- */
- public InfinispanLocalAggregationRepository() {
- }
-
- /**
- * Creates new {@link InfinispanLocalAggregationRepository} that defaults to non-optimistic locking with recoverable
- * behavior and a local Infinispan cache.
- *
- * @param cacheName cache name
- */
- public InfinispanLocalAggregationRepository(final String cacheName) {
- this.cacheName = cacheName;
- }
-
- @Override
- public Exchange add(final CamelContext camelContext, final String key, final Exchange exchange) {
- LOG.trace("Adding an Exchange with ID {} for key {} in a thread-safe manner.", exchange.getExchangeId(), key);
- DefaultExchangeHolder newHolder = DefaultExchangeHolder.marshal(exchange, true, allowSerializedHeaders);
- DefaultExchangeHolder oldHolder = cache.put(key, newHolder);
- return unmarshallExchange(camelContext, oldHolder);
- }
-
- @Override
- public Exchange get(CamelContext camelContext, String key) {
- return unmarshallExchange(camelContext, cache.get(key));
- }
-
- @Override
- public void remove(CamelContext camelContext, String key, Exchange exchange) {
- LOG.trace("Removing an exchange with ID {} for key {}", exchange.getExchangeId(), key);
- cache.remove(key);
- }
-
- @Override
- public void confirm(CamelContext camelContext, String exchangeId) {
- LOG.trace("Confirming an exchange with ID {}.", exchangeId);
- cache.remove(exchangeId);
- }
-
- @Override
- public Set<String> getKeys() {
- return Collections.unmodifiableSet(cache.keySet());
- }
-
- @Override
- public Set<String> scan(CamelContext camelContext) {
- LOG.trace("Scanning for exchanges to recover in {} context", camelContext.getName());
- Set<String> scanned = Collections.unmodifiableSet(cache.keySet());
- LOG.trace("Found {} keys for exchanges to recover in {} context", scanned.size(), camelContext.getName());
- return scanned;
- }
-
- @Override
- public Exchange recover(CamelContext camelContext, String exchangeId) {
- LOG.trace("Recovering an Exchange with ID {}.", exchangeId);
- return useRecovery ? unmarshallExchange(camelContext, cache.get(exchangeId)) : null;
- }
-
- @Override
- public void setRecoveryInterval(long interval, TimeUnit timeUnit) {
- this.recoveryInterval = timeUnit.toMillis(interval);
- }
-
- @Override
- public void setRecoveryInterval(long interval) {
- this.recoveryInterval = interval;
- }
-
- @Override
- public long getRecoveryIntervalInMillis() {
- return recoveryInterval;
- }
-
- @Override
- public void setUseRecovery(boolean useRecovery) {
- this.useRecovery = useRecovery;
- }
-
- @Override
- public boolean isUseRecovery() {
- return useRecovery;
- }
-
- @Override
- public void setDeadLetterUri(String deadLetterUri) {
- this.deadLetterChannel = deadLetterUri;
- }
-
- @Override
- public String getDeadLetterUri() {
- return deadLetterChannel;
- }
-
- @Override
- public void setMaximumRedeliveries(int maximumRedeliveries) {
- this.maximumRedeliveries = maximumRedeliveries;
- }
-
- @Override
- public int getMaximumRedeliveries() {
- return maximumRedeliveries;
- }
-
- @Override
- protected void doStart() throws Exception {
- if (maximumRedeliveries < 0) {
- throw new IllegalArgumentException("Maximum redelivery retries must be zero or a positive integer.");
- }
- if (recoveryInterval < 0) {
- throw new IllegalArgumentException("Recovery interval must be zero or a positive integer.");
- }
- if (ObjectHelper.isEmpty(configuration)) {
- manager = new DefaultCacheManager(new GlobalConfigurationBuilder().defaultCacheName("default").build());
- manager.start();
- } else {
- manager = new DefaultCacheManager(
- new GlobalConfigurationBuilder().defaultCacheName("default").build(), configuration);
- manager.start();
- }
- if (ObjectHelper.isEmpty(cacheName)) {
- cache = manager.getCache();
- } else {
- cache = manager.getCache(cacheName);
- }
- }
-
- @Override
- protected void doStop() throws Exception {
- manager.stop();
- }
-
- protected Exchange unmarshallExchange(CamelContext camelContext, DefaultExchangeHolder holder) {
- Exchange exchange = null;
- if (holder != null) {
- exchange = new DefaultExchange(camelContext);
- DefaultExchangeHolder.unmarshal(exchange, holder);
- }
- return exchange;
- }
-
- public DefaultCacheManager getManager() {
- return manager;
- }
-
- public void setManager(DefaultCacheManager manager) {
- this.manager = manager;
- }
-
- public String getCacheName() {
- return cacheName;
- }
-
- public void setCacheName(String cacheName) {
- this.cacheName = cacheName;
- }
-
- public String getDeadLetterChannel() {
- return deadLetterChannel;
- }
-
- public void setDeadLetterChannel(String deadLetterChannel) {
- this.deadLetterChannel = deadLetterChannel;
- }
-
- public boolean isAllowSerializedHeaders() {
- return allowSerializedHeaders;
- }
-
- public void setAllowSerializedHeaders(boolean allowSerializedHeaders) {
- this.allowSerializedHeaders = allowSerializedHeaders;
- }
-
- public BasicCache<String, DefaultExchangeHolder> getCache() {
- return cache;
- }
-
- public void setCache(BasicCache<String, DefaultExchangeHolder> cache) {
- this.cache = cache;
- }
-
- public Configuration getConfiguration() {
- return configuration;
- }
-
- public void setConfiguration(Configuration configuration) {
- this.configuration = configuration;
- }
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/idempotent/InfinispanIdempotentRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/idempotent/InfinispanIdempotentRepository.java
deleted file mode 100644
index 0c04aa6..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/processor/idempotent/InfinispanIdempotentRepository.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * 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.component.infinispan.processor.idempotent;
-
-import org.apache.camel.api.management.ManagedAttribute;
-import org.apache.camel.api.management.ManagedOperation;
-import org.apache.camel.api.management.ManagedResource;
-import org.apache.camel.component.infinispan.InfinispanUtil;
-import org.apache.camel.spi.IdempotentRepository;
-import org.apache.camel.support.service.ServiceSupport;
-import org.infinispan.client.hotrod.RemoteCacheManager;
-import org.infinispan.commons.api.BasicCache;
-import org.infinispan.commons.api.BasicCacheContainer;
-import org.infinispan.configuration.global.GlobalConfigurationBuilder;
-import org.infinispan.manager.DefaultCacheManager;
-
-@ManagedResource(description = "Infinispan based message id repository")
-public class InfinispanIdempotentRepository extends ServiceSupport implements IdempotentRepository {
- private final String cacheName;
- private final BasicCacheContainer cacheContainer;
- private final boolean isManagedCacheContainer;
- private BasicCache<String, Boolean> cache;
-
- public InfinispanIdempotentRepository(BasicCacheContainer cacheContainer, String cacheName) {
- this.cacheContainer = cacheContainer;
- this.cacheName = cacheName;
- this.isManagedCacheContainer = false;
- }
-
- public InfinispanIdempotentRepository(String cacheName) {
- this.cacheContainer = new DefaultCacheManager(new GlobalConfigurationBuilder().defaultCacheName("default").build());
- this.cacheName = cacheName;
- this.isManagedCacheContainer = true;
- }
-
- public InfinispanIdempotentRepository() {
- this(null);
- }
-
- public static InfinispanIdempotentRepository infinispanIdempotentRepository(
- BasicCacheContainer cacheContainer, String processorName) {
- return new InfinispanIdempotentRepository(cacheContainer, processorName);
- }
-
- public static InfinispanIdempotentRepository infinispanIdempotentRepository(String processorName) {
- return new InfinispanIdempotentRepository(processorName);
- }
-
- public static InfinispanIdempotentRepository infinispanIdempotentRepository() {
- return new InfinispanIdempotentRepository();
- }
-
- @Override
- @ManagedOperation(description = "Adds the key to the store")
- public boolean add(String key) {
- // need to check first as put will update the entry lifetime so it can not expire its cache lifespan
- if (getCache().containsKey(key)) {
- // there is already an entry so return false
- return false;
- }
-
- Boolean put = getCache().put(key, true);
- return put == null;
- }
-
- @Override
- @ManagedOperation(description = "Does the store contain the given key")
- public boolean contains(String key) {
- return getCache().containsKey(key);
- }
-
- @Override
- @ManagedOperation(description = "Remove the key from the store")
- public boolean remove(String key) {
- return getCache().remove(key) != null;
- }
-
- @Override
- @ManagedOperation(description = "Clear the store")
- public void clear() {
- getCache().clear();
- }
-
- @ManagedAttribute(description = "The processor name")
- public String getCacheName() {
- return cacheName;
- }
-
- @Override
- public boolean confirm(String key) {
- return true;
- }
-
- @Override
- protected void doStart() throws Exception {
- // noop
- }
-
- @Override
- protected void doStop() throws Exception {
- // noop
- }
-
- @Override
- protected void doShutdown() throws Exception {
- if (isManagedCacheContainer) {
- cacheContainer.stop();
- }
-
- super.doShutdown();
- }
-
- private BasicCache<String, Boolean> getCache() {
- if (cache == null) {
- // By default, previously existing values for java.util.Map operations
- // are not returned for remote caches but idempotent repository needs
- // them so force it.
- if (InfinispanUtil.isRemote(cacheContainer)) {
- RemoteCacheManager manager = InfinispanUtil.asRemote(cacheContainer);
- cache = cacheName != null
- ? manager.getCache(cacheName)
- : manager.getCache();
- } else {
- cache = cacheName != null
- ? cacheContainer.getCache(cacheName)
- : cacheContainer.getCache();
- }
- }
-
- return cache;
- }
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanConsumerRemoteHandler.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanConsumerRemoteHandler.java
deleted file mode 100644
index 602f151..0000000
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanConsumerRemoteHandler.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.component.infinispan.remote;
-
-import org.apache.camel.component.infinispan.InfinispanConfiguration;
-import org.apache.camel.component.infinispan.InfinispanConsumer;
-import org.apache.camel.component.infinispan.InfinispanConsumerHandler;
-import org.apache.camel.component.infinispan.InfinispanEventListener;
-import org.apache.camel.component.infinispan.InfinispanUtil;
-import org.infinispan.client.hotrod.RemoteCache;
-
-public final class InfinispanConsumerRemoteHandler implements InfinispanConsumerHandler {
- public static final InfinispanConsumerHandler INSTANCE = new InfinispanConsumerRemoteHandler();
-
- private InfinispanConsumerRemoteHandler() {
- }
-
- @Override
- public InfinispanEventListener start(InfinispanConsumer consumer) {
- if (consumer.getConfiguration().isSync()) {
- throw new UnsupportedOperationException("Sync listeners not supported for remote caches.");
- }
- RemoteCache<?, ?> remoteCache = InfinispanUtil.asRemote(consumer.getCache());
- InfinispanConfiguration configuration = consumer.getConfiguration();
- InfinispanEventListener listener;
- if (configuration.hasCustomListener()) {
- listener = configuration.getCustomListener();
- listener.setInfinispanConsumer(consumer);
- } else {
- listener = new InfinispanRemoteEventListener(consumer, configuration.getEventTypes());
- }
- remoteCache.addClientListener(listener);
- listener.setCacheName(remoteCache.getName());
- return listener;
- }
-
- @Override
- public void stop(InfinispanConsumer consumer) {
- InfinispanUtil.asRemote(consumer.getCache()).removeClientListener(consumer.getListener());
- }
-
-}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java
new file mode 100644
index 0000000..760703b
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteAggregationRepository.java
@@ -0,0 +1,104 @@
+/*
+ * 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.component.infinispan.remote;
+
+import java.util.function.Supplier;
+
+import org.apache.camel.component.infinispan.InfinispanAggregationRepository;
+import org.apache.camel.support.DefaultExchangeHolder;
+import org.apache.camel.support.service.ServiceHelper;
+import org.apache.camel.util.function.Suppliers;
+import org.infinispan.client.hotrod.Flag;
+import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
+import org.infinispan.commons.api.BasicCache;
+import org.infinispan.jboss.marshalling.core.JBossUserMarshaller;
+
+public class InfinispanRemoteAggregationRepository extends InfinispanAggregationRepository {
+ private final Supplier<BasicCache<String, DefaultExchangeHolder>> cache;
+
+ private InfinispanRemoteConfiguration configuration;
+ private InfinispanRemoteManager manager;
+
+ /**
+ * Creates new {@link InfinispanRemoteAggregationRepository} that defaults to non-optimistic locking with
+ * recoverable behavior and a local Infinispan cache.
+ *
+ * @param cacheName cache name
+ */
+ public InfinispanRemoteAggregationRepository(String cacheName) {
+ super(cacheName);
+
+ this.cache = Suppliers.memorize(
+ // for optimization reason, a remote cache does not return the previous value for operation
+ // such as Map::put and need to be explicitly forced
+ () -> InfinispanRemoteUtil.getCacheWithFlags(manager, getCacheName(), Flag.FORCE_RETURN_VALUE));
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ InfinispanRemoteConfiguration conf = configuration != null ? configuration : new InfinispanRemoteConfiguration();
+
+ //
+ // the Aggregation repository uses org.apache.camel.support.DefaultExchangeHolder as
+ // "wire format" which is based on java.io.Serializable. Starting from Infinispan 11
+ // the Jboss Marshaller has been removed for internal operation and deprecated thus
+ // to make DefaultExchangeHolder working, we need to explicit register JBoss Marshaller
+ //
+ // TODO: we should re-work DefaultExchangeHolder and make it possible to plug a custom
+ // serialization strategy (i.e. json, protobuf, avro)
+ //
+ if (conf.getCacheContainerConfiguration() == null) {
+ conf.setCacheContainerConfiguration(
+ new ConfigurationBuilder()
+ .marshaller(JBossUserMarshaller.class)
+ .build());
+ } else {
+ conf.setCacheContainerConfiguration(
+ new ConfigurationBuilder()
+ .read(conf.getCacheContainerConfiguration())
+ .marshaller(JBossUserMarshaller.class)
+ .build());
+ }
+
+ manager = new InfinispanRemoteManager(conf);
+ manager.setCamelContext(getCamelContext());
+
+ ServiceHelper.startService(manager);
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ super.doStop();
+
+ ServiceHelper.stopService(manager);
+ }
+
+ @Override
+ protected BasicCache<String, DefaultExchangeHolder> getCache() {
+ return cache.get();
+ }
+
+ public InfinispanRemoteConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(InfinispanRemoteConfiguration configuration) {
+ this.configuration = configuration;
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java
new file mode 100644
index 0000000..1131138
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteComponent.java
@@ -0,0 +1,57 @@
+/*
+ * 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.component.infinispan.remote;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.apache.camel.component.infinispan.InfinispanComponent;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+
+@Component(InfinispanRemoteComponent.SCHEME)
+public class InfinispanRemoteComponent extends InfinispanComponent {
+ public static final String SCHEME = "infinispan";
+
+ @Metadata(description = "Component configuration")
+ private InfinispanRemoteConfiguration configuration = new InfinispanRemoteConfiguration();
+
+ public InfinispanRemoteComponent() {
+ }
+
+ public InfinispanRemoteComponent(CamelContext camelContext) {
+ super(camelContext);
+ }
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+ InfinispanRemoteConfiguration conf = configuration.clone();
+ InfinispanRemoteEndpoint endpoint = new InfinispanRemoteEndpoint(uri, remaining, this, conf);
+ setProperties(endpoint, parameters);
+
+ return endpoint;
+ }
+
+ public void setConfiguration(InfinispanRemoteConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public InfinispanRemoteConfiguration getConfiguration() {
+ return configuration;
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
new file mode 100644
index 0000000..b06debb
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConfiguration.java
@@ -0,0 +1,247 @@
+/*
+ * 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.component.infinispan.remote;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.infinispan.InfinispanConfiguration;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.infinispan.client.hotrod.Flag;
+import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.client.hotrod.configuration.Configuration;
+
+@UriParams
+public class InfinispanRemoteConfiguration extends InfinispanConfiguration implements Cloneable {
+ @UriParam
+ private String hosts;
+ @UriParam(label = "common", defaultValue = "false")
+ private boolean secure;
+ @UriParam(label = "common, security")
+ private String username;
+ @UriParam(label = "common, security", secret = true)
+ private String password;
+ @UriParam(label = "common, security")
+ private String saslMechanism;
+ @UriParam(label = "common, security")
+ private String securityRealm;
+ @UriParam(label = "common, security")
+ private String securityServerName;
+ @Metadata(autowired = true)
+ @UriParam(label = "advanced")
+ private Configuration cacheContainerConfiguration;
+ @Metadata(autowired = true)
+ @UriParam(label = "advanced")
+ private RemoteCacheManager cacheContainer;
+ @UriParam(label = "advanced")
+ private Map<String, String> configurationProperties;
+ @UriParam(label = "consumer")
+ private String eventTypes;
+ @UriParam(label = "consumer")
+ private InfinispanRemoteCustomListener customListener;
+ @UriParam(label = "advanced", javaType = "java.lang.String")
+ private Flag[] flags;
+
+ public Configuration getCacheContainerConfiguration() {
+ return cacheContainerConfiguration;
+ }
+
+ /**
+ * The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types:
+ * org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration;
+ * org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration;
+ */
+ public void setCacheContainerConfiguration(Configuration cacheContainerConfiguration) {
+ this.cacheContainerConfiguration = cacheContainerConfiguration;
+ }
+
+ /**
+ * Specifies the cache Container to connect
+ */
+ public RemoteCacheManager getCacheContainer() {
+ return cacheContainer;
+ }
+
+ public void setCacheContainer(RemoteCacheManager cacheContainer) {
+ this.cacheContainer = cacheContainer;
+ }
+
+ /**
+ * Specifies the host of the cache on Infinispan instance
+ */
+ public String getHosts() {
+ return hosts;
+ }
+
+ public void setHosts(String hosts) {
+ this.hosts = hosts;
+ }
+
+ public boolean isSecure() {
+ return secure;
+ }
+
+ /**
+ * Define if we are connecting to a secured Infinispan instance
+ */
+ public void setSecure(boolean secure) {
+ this.secure = secure;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * Define the username to access the infinispan instance
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Define the password to access the infinispan instance
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getSaslMechanism() {
+ return saslMechanism;
+ }
+
+ /**
+ * Define the SASL Mechanism to access the infinispan instance
+ */
+ public void setSaslMechanism(String saslMechanism) {
+ this.saslMechanism = saslMechanism;
+ }
+
+ public String getSecurityRealm() {
+ return securityRealm;
+ }
+
+ /**
+ * Define the security realm to access the infinispan instance
+ */
+ public void setSecurityRealm(String securityRealm) {
+ this.securityRealm = securityRealm;
+ }
+
+ public String getSecurityServerName() {
+ return securityServerName;
+ }
+
+ /**
+ * Define the security server name to access the infinispan instance
+ */
+ public void setSecurityServerName(String securityServerName) {
+ this.securityServerName = securityServerName;
+ }
+
+ public Map<String, String> getConfigurationProperties() {
+ return configurationProperties;
+ }
+
+ /**
+ * Implementation specific properties for the CacheManager
+ */
+ public void setConfigurationProperties(Map<String, String> configurationProperties) {
+ this.configurationProperties = configurationProperties;
+ }
+
+ /**
+ * Adds an implementation specific property for the CacheManager
+ */
+ public void addConfigurationProperty(String key, String value) {
+ if (this.configurationProperties == null) {
+ this.configurationProperties = new HashMap<>();
+ }
+
+ this.configurationProperties.put(key, value);
+ }
+
+ public String getEventTypes() {
+ return eventTypes;
+ }
+
+ /**
+ * Specifies the set of event types to register by the consumer.Multiple event can be separated by comma.
+ * <p/>
+ * The possible event types are: CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED,
+ * CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER
+ */
+ public void setEventTypes(String eventTypes) {
+ this.eventTypes = eventTypes;
+ }
+
+ /**
+ * Returns the custom listener in use, if provided
+ */
+ public InfinispanRemoteCustomListener getCustomListener() {
+ return customListener;
+ }
+
+ public void setCustomListener(InfinispanRemoteCustomListener customListener) {
+ this.customListener = customListener;
+ }
+
+ public boolean hasCustomListener() {
+ return customListener != null;
+ }
+
+ public Flag[] getFlags() {
+ return flags;
+ }
+
+ /**
+ * A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote
+ * caches.
+ */
+ public void setFlags(String flagsAsString) {
+ String[] flagsArray = flagsAsString.split(",");
+ this.flags = new Flag[flagsArray.length];
+
+ for (int i = 0; i < flagsArray.length; i++) {
+ this.flags[i] = Flag.valueOf(flagsArray[i]);
+ }
+ }
+
+ public void setFlags(Flag... flags) {
+ this.flags = flags;
+ }
+
+ public boolean hasFlags() {
+ return flags != null && flags.length > 0;
+ }
+
+ @Override
+ public InfinispanRemoteConfiguration clone() {
+ try {
+ return (InfinispanRemoteConfiguration) super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new RuntimeCamelException(e);
+ }
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java
new file mode 100644
index 0000000..45a4db3
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteConsumer.java
@@ -0,0 +1,148 @@
+/*
+ * 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.component.infinispan.remote;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.camel.Processor;
+import org.apache.camel.Service;
+import org.apache.camel.component.infinispan.InfinispanConstants;
+import org.apache.camel.component.infinispan.InfinispanConsumer;
+import org.apache.camel.component.infinispan.InfinispanEndpoint;
+import org.apache.camel.component.infinispan.InfinispanEventListener;
+import org.apache.camel.support.service.ServiceHelper;
+import org.apache.camel.support.service.ServiceSupport;
+import org.infinispan.client.hotrod.RemoteCache;
+import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.client.hotrod.Search;
+import org.infinispan.client.hotrod.event.ClientEvent;
+import org.infinispan.query.api.continuous.ContinuousQuery;
+import org.infinispan.query.api.continuous.ContinuousQueryListener;
+import org.infinispan.query.dsl.Query;
+
+public class InfinispanRemoteConsumer
+ extends InfinispanConsumer<RemoteCacheManager, InfinispanRemoteManager, InfinispanRemoteConfiguration> {
+ private Service handler;
+
+ public InfinispanRemoteConsumer(
+ InfinispanEndpoint endpoint,
+ Processor processor,
+ String cacheName,
+ InfinispanRemoteManager manager,
+ InfinispanRemoteConfiguration configuration) {
+
+ super(endpoint, processor, cacheName, manager, configuration);
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ if (getConfiguration().hasQueryBuilder()) {
+ handler = new ContinuousQueryHandler();
+ } else {
+ handler = new ConsumerHandler();
+ }
+
+ ServiceHelper.startService(handler);
+ }
+
+ @Override
+ protected void doStop() throws Exception {
+ super.doStop();
+ ServiceHelper.stopService(handler);
+ }
+
+ // *********************************
+ //
+ // Handlers
+ //
+ // *********************************
+
+ private class ContinuousQueryHandler extends ServiceSupport implements ContinuousQueryListener<Object, Object> {
+ private ContinuousQuery<Object, Object> continuousQuery;
+
+ @Override
+ public void resultJoining(Object key, Object value) {
+ processEvent(InfinispanConstants.CACHE_ENTRY_JOINING, cacheName, key, value, null);
+ }
+
+ @Override
+ public void resultUpdated(Object key, Object value) {
+ processEvent(InfinispanConstants.CACHE_ENTRY_UPDATED, cacheName, key, value, null);
+ }
+
+ @Override
+ public void resultLeaving(Object key) {
+ processEvent(InfinispanConstants.CACHE_ENTRY_LEAVING, cacheName, key, null, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void doStart() {
+ RemoteCache<Object, Object> remoteCache = getCache(RemoteCache.class);
+ Query<?> query = InfinispanRemoteUtil.buildQuery(getConfiguration().getQueryBuilder(), remoteCache);
+
+ continuousQuery = Search.getContinuousQuery(remoteCache);
+ continuousQuery.addContinuousQueryListener(query, this);
+ }
+
+ @Override
+ public void doStop() {
+ if (continuousQuery != null) {
+ continuousQuery.removeAllListeners();
+ }
+ }
+ }
+
+ private class ConsumerHandler extends ServiceSupport {
+ private InfinispanEventListener<ClientEvent.Type> listener;
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void doStart() {
+ final RemoteCache<?, ?> cache = getCache(RemoteCache.class);
+ final InfinispanRemoteConfiguration configuration = getConfiguration();
+
+ listener = configuration.getCustomListener();
+ if (listener == null) {
+ Set<ClientEvent.Type> events = new HashSet<>();
+ if (configuration.getEventTypes() != null) {
+ String eventTypes = configuration.getEventTypes();
+ for (String event : eventTypes.split(",")) {
+ events.add(ClientEvent.Type.valueOf(event));
+ }
+ }
+
+ listener = new InfinispanRemoteEventListener(events);
+ }
+
+ listener.setCacheName(cache.getName());
+ listener.setEventProcessor(InfinispanRemoteConsumer.this);
+
+ cache.addClientListener(listener);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void doStop() {
+ getCache(RemoteCache.class).removeClientListener(listener);
+ }
+
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java
index a251cbb..2e6c9fd 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteCustomListener.java
@@ -16,12 +16,10 @@
*/
package org.apache.camel.component.infinispan.remote;
-import org.apache.camel.component.infinispan.InfinispanCustomListener;
-import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated;
-import org.infinispan.client.hotrod.annotation.ClientCacheEntryExpired;
-import org.infinispan.client.hotrod.annotation.ClientCacheEntryModified;
-import org.infinispan.client.hotrod.annotation.ClientCacheEntryRemoved;
-import org.infinispan.client.hotrod.annotation.ClientCacheFailover;
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.camel.component.infinispan.InfinispanEventListener;
import org.infinispan.client.hotrod.event.ClientCacheEntryCreatedEvent;
import org.infinispan.client.hotrod.event.ClientCacheEntryCustomEvent;
import org.infinispan.client.hotrod.event.ClientCacheEntryModifiedEvent;
@@ -32,23 +30,27 @@ import org.infinispan.client.hotrod.event.ClientEvent;
* This class is supposed to be extended by users and annotated with @ClientListener and passed to the consumer endpoint
* through the 'customListener' parameter.
*/
-public abstract class InfinispanRemoteCustomListener extends InfinispanCustomListener {
- public InfinispanRemoteCustomListener() {
- super(null, null);
+public abstract class InfinispanRemoteCustomListener extends InfinispanEventListener<ClientEvent.Type> {
+ protected InfinispanRemoteCustomListener() {
+ super(Collections.emptySet());
+ }
+
+ protected InfinispanRemoteCustomListener(Set<ClientEvent.Type> events) {
+ super(events);
}
- @ClientCacheEntryCreated
- @ClientCacheEntryModified
- @ClientCacheEntryRemoved
- @ClientCacheEntryExpired
- @ClientCacheFailover
- public void processClientEvent(ClientEvent event) {
- if (isAccepted(event.getType().toString())) {
- infinispanConsumer.processEvent(event.getType().toString(), false, cacheName, getKey(event), getEventData(event));
+ protected void processEvent(ClientEvent event) {
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(
+ event.getType().toString(),
+ getCacheName(),
+ getKey(event),
+ getEventData(event),
+ null);
}
}
- private Object getKey(ClientEvent event) {
+ protected static Object getKey(ClientEvent event) {
if (event instanceof ClientCacheEntryCreatedEvent) {
return ((ClientCacheEntryCreatedEvent<?>) event).getKey();
} else if (event instanceof ClientCacheEntryModifiedEvent) {
@@ -59,7 +61,7 @@ public abstract class InfinispanRemoteCustomListener extends InfinispanCustomLis
return null;
}
- private Object getEventData(ClientEvent e) {
+ protected static Object getEventData(ClientEvent e) {
if (e instanceof ClientCacheEntryCustomEvent) {
return ((ClientCacheEntryCustomEvent<?>) e).getEventData();
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java
similarity index 68%
copy from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
copy to components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java
index 050f422..9f360cc 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanEndpoint.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEndpoint.java
@@ -14,61 +14,65 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.remote;
import org.apache.camel.Category;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
+import org.apache.camel.component.infinispan.InfinispanComponent;
+import org.apache.camel.component.infinispan.InfinispanEndpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
-import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.support.service.ServiceHelper;
/**
* Read and write from/to Infinispan distributed key/value store and data grid.
*/
@UriEndpoint(firstVersion = "2.13.0", scheme = "infinispan", title = "Infinispan", syntax = "infinispan:cacheName",
category = { Category.CACHE, Category.DATAGRID, Category.CLUSTERING })
-public class InfinispanEndpoint extends DefaultEndpoint {
+public class InfinispanRemoteEndpoint extends InfinispanEndpoint {
@UriPath(description = "The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name.")
@Metadata(required = true)
private final String cacheName;
@UriParam
- private final InfinispanConfiguration configuration;
+ private final InfinispanRemoteConfiguration configuration;
- private final InfinispanManager manager;
+ private final InfinispanRemoteManager manager;
- public InfinispanEndpoint(String uri, String cacheName, InfinispanComponent component,
- InfinispanConfiguration configuration) {
+ public InfinispanRemoteEndpoint(String uri, String cacheName, InfinispanComponent component,
+ InfinispanRemoteConfiguration configuration) {
super(uri, component);
+
this.cacheName = cacheName;
this.configuration = configuration;
- this.manager = new InfinispanManager(component.getCamelContext(), configuration);
+ this.manager = new InfinispanRemoteManager(component.getCamelContext(), configuration);
}
@Override
protected void doStart() throws Exception {
- manager.start();
super.doStart();
+ ServiceHelper.startService(manager);
}
@Override
protected void doStop() throws Exception {
super.doStop();
- manager.stop();
+ ServiceHelper.stopService(manager);
}
@Override
public Producer createProducer() throws Exception {
- return new InfinispanProducer(this, cacheName, manager, configuration);
+ return new InfinispanRemoteProducer(this, cacheName, manager, configuration);
}
@Override
public Consumer createConsumer(Processor processor) throws Exception {
- InfinispanConsumer consumer = new InfinispanConsumer(this, processor, cacheName, manager, configuration);
+ InfinispanRemoteConsumer consumer = new InfinispanRemoteConsumer(this, processor, cacheName, manager, configuration);
+
configureConsumer(consumer);
return consumer;
}
@@ -77,7 +81,7 @@ public class InfinispanEndpoint extends DefaultEndpoint {
return cacheName;
}
- public InfinispanConfiguration getConfiguration() {
+ public InfinispanRemoteConfiguration getConfiguration() {
return configuration;
}
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java
index 7774030..ac19bb5 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteEventListener.java
@@ -18,7 +18,7 @@ package org.apache.camel.component.infinispan.remote;
import java.util.Set;
-import org.apache.camel.component.infinispan.InfinispanConsumer;
+import org.apache.camel.component.infinispan.InfinispanConstants;
import org.apache.camel.component.infinispan.InfinispanEventListener;
import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated;
import org.infinispan.client.hotrod.annotation.ClientCacheEntryExpired;
@@ -31,50 +31,54 @@ import org.infinispan.client.hotrod.event.ClientCacheEntryExpiredEvent;
import org.infinispan.client.hotrod.event.ClientCacheEntryModifiedEvent;
import org.infinispan.client.hotrod.event.ClientCacheEntryRemovedEvent;
import org.infinispan.client.hotrod.event.ClientCacheFailoverEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.infinispan.client.hotrod.event.ClientEvent;
@ClientListener
-public class InfinispanRemoteEventListener extends InfinispanEventListener {
- private final transient Logger logger = LoggerFactory.getLogger(this.getClass());
-
- public InfinispanRemoteEventListener(InfinispanConsumer infinispanConsumer, Set<String> eventTypes) {
- super(infinispanConsumer, eventTypes);
+public class InfinispanRemoteEventListener extends InfinispanEventListener<ClientEvent.Type> {
+ public InfinispanRemoteEventListener(Set<ClientEvent.Type> events) {
+ super(events);
}
@ClientCacheEntryCreated
public void processEvent(ClientCacheEntryCreatedEvent<Object> event) {
- logger.trace("Received ClientEvent [{}]", event);
- dispatch(event.getType().toString(), false, cacheName, event.getKey());
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(event.getType().toString(), getCacheName(), event.getKey(), null, e -> {
+ e.getMessage().setHeader(InfinispanConstants.ENTRY_VERSION, event.getVersion());
+ e.getMessage().setHeader(InfinispanConstants.COMMAND_RETRIED, event.isCommandRetried());
+ });
+ }
}
@ClientCacheEntryModified
public void processEvent(ClientCacheEntryModifiedEvent<Object> event) {
- logger.trace("Received ClientEvent [{}]", event);
- dispatch(event.getType().toString(), false, cacheName, event.getKey());
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(event.getType().toString(), getCacheName(), event.getKey(), null, e -> {
+ e.getMessage().setHeader(InfinispanConstants.ENTRY_VERSION, event.getVersion());
+ e.getMessage().setHeader(InfinispanConstants.COMMAND_RETRIED, event.isCommandRetried());
+ });
+ }
}
@ClientCacheEntryRemoved
public void processEvent(ClientCacheEntryRemovedEvent<Object> event) {
- logger.trace("Received ClientEvent [{}]", event);
- dispatch(event.getType().toString(), false, cacheName, event.getKey());
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(event.getType().toString(), getCacheName(), event.getKey(), null, e -> {
+ e.getMessage().setHeader(InfinispanConstants.COMMAND_RETRIED, event.isCommandRetried());
+ });
+ }
}
@ClientCacheFailover
public void processEvent(ClientCacheFailoverEvent event) {
- logger.trace("Received ClientEvent [{}]", event);
- dispatch(event.getType().toString(), false, cacheName, null);
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(event.getType().toString(), getCacheName(), null, null, null);
+ }
}
@ClientCacheEntryExpired
public void processEvent(ClientCacheEntryExpiredEvent<Object> event) {
- logger.trace("Received ClientEvent [{}]", event);
- dispatch(event.getType().toString(), false, cacheName, event.getKey());
- }
-
- private void dispatch(String eventType, boolean isPre, String cacheName, Object key) {
- if (isAccepted(eventType)) {
- infinispanConsumer.processEvent(eventType, isPre, cacheName, key, null);
+ if (isAccepted(event.getType())) {
+ getEventProcessor().processEvent(event.getType().toString(), getCacheName(), event.getKey(), null, null);
}
}
}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java
new file mode 100644
index 0000000..7832f53
--- /dev/null
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteIdempotentRepository.java
@@ -0,0 +1,100 @@
+/*
+ * 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.component.infinispan.remote;
+
+import java.util.function.Supplier;
+
+import org.apache.camel.api.management.ManagedResource;
+import org.apache.camel.component.infinispan.InfinispanIdempotentRepository;
+import org.apache.camel.util.function.Suppliers;
+import org.infinispan.client.hotrod.Flag;
+import org.infinispan.client.hotrod.RemoteCache;
+import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.commons.api.BasicCache;
+
+import static org.apache.camel.component.infinispan.remote.InfinispanRemoteUtil.getCacheWithFlags;
+
+@ManagedResource(description = "Infinispan Remote message id repository")
+public class InfinispanRemoteIdempotentRepository extends InfinispanIdempotentRepository {
+ private final String cacheName;
+ private final Supplier<RemoteCache<String, Boolean>> cache;
+
+ private InfinispanRemoteConfiguration configuration;
+ private InfinispanRemoteManager manager;
+
+ public InfinispanRemoteIdempotentRepository(String cacheName) {
+ this.cacheName = cacheName;
+ this.cache = Suppliers.memorize(() -> getCacheWithFlags(manager, cacheName, Flag.FORCE_RETURN_VALUE));
+ }
+
+ @Override
+ protected void doStart() throws Exception {
+ super.doStart();
+
+ if (this.configuration == null) {
+ this.configuration = new InfinispanRemoteConfiguration();
+ }
+
+ this.manager = new InfinispanRemoteManager(configuration);
+ this.manager.setCamelContext(getCamelContext());
+ this.manager.start();
+ }
+
+ @Override
+ protected void doShutdown() throws Exception {
+ this.manager.shutdown();
+ super.doShutdown();
+ }
+
+ @Override
+ protected BasicCache<String, Boolean> getCache() {
+ return cache.get();
+ }
+
+ @Override
+ public String getCacheName() {
+ return this.cacheName;
+ }
+
+ public InfinispanRemoteConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(InfinispanRemoteConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public InfinispanRemoteManager getManager() {
+ return manager;
+ }
+
+ public void setManager(InfinispanRemoteManager manager) {
+ this.manager = manager;
+ }
+
+ public RemoteCacheManager getCacheContainer() {
+ return configuration != null ? configuration.getCacheContainer() : null;
+ }
+
+ public void setCacheContainer(RemoteCacheManager cacheContainer) {
+ if (this.configuration == null) {
+ this.configuration = new InfinispanRemoteConfiguration();
+ }
+
+ this.configuration.setCacheContainer(cacheContainer);
+ }
+}
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java
similarity index 50%
copy from components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
copy to components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java
index 8b4231b..a3d7152 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/InfinispanManager.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteManager.java
@@ -14,81 +14,68 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.infinispan;
+package org.apache.camel.component.infinispan.remote;
-import java.io.InputStream;
import java.util.Properties;
+import java.util.Set;
import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
+import org.apache.camel.component.infinispan.InfinispanManager;
+import org.apache.camel.component.infinispan.InfinispanUtil;
import org.apache.camel.support.service.ServiceSupport;
import org.apache.camel.util.ObjectHelper;
-import org.infinispan.cache.impl.CacheImpl;
-import org.infinispan.cache.impl.DecoratedCache;
+import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.client.hotrod.configuration.Configuration;
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.infinispan.commons.api.BasicCache;
-import org.infinispan.commons.api.BasicCacheContainer;
-import org.infinispan.commons.util.EnumUtil;
-import org.infinispan.configuration.global.GlobalConfigurationBuilder;
-import org.infinispan.manager.DefaultCacheManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import static org.apache.camel.component.infinispan.InfinispanConstants.CACHE_MANAGER_CURRENT;
-public class InfinispanManager extends ServiceSupport {
- private static final transient Logger LOGGER = LoggerFactory.getLogger(InfinispanManager.class);
-
- private final InfinispanConfiguration configuration;
- private final CamelContext camelContext;
- private BasicCacheContainer cacheContainer;
+public class InfinispanRemoteManager extends ServiceSupport implements InfinispanManager<RemoteCacheManager> {
+ private final InfinispanRemoteConfiguration configuration;
+ private CamelContext camelContext;
+ private RemoteCacheManager cacheContainer;
private boolean isManagedCacheContainer;
- public InfinispanManager() {
- this.camelContext = null;
- this.configuration = new InfinispanConfiguration();
- this.configuration.setCacheContainer(
- new DefaultCacheManager(new GlobalConfigurationBuilder().defaultCacheName("default").build()));
+ public InfinispanRemoteManager() {
+ this(null, new InfinispanRemoteConfiguration());
}
- public InfinispanManager(InfinispanConfiguration configuration) {
... 13817 lines suppressed ...
[camel] 03/06: CAMEL-12489 - camel-infinspan: split remote and
embedded components (fix findings)
Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit b334a5ed1e948ca77daaab22b271cf9d1d148e1f
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Mon Jan 25 11:03:51 2021 +0100
CAMEL-12489 - camel-infinspan: split remote and embedded components (fix findings)
---
.../camel/catalog/docs/infinispan-component.adoc | 495 ++++++++++++
.../docs/infinispan-embedded-component.adoc | 843 +++++++++++++++++++++
.../component/infinispan/InfinispanConsumer.java | 6 +-
.../remote/InfinispanRemoteProducerTest.java | 2 +-
.../remote/InfinispanRemoteTestSupport.java | 6 +-
...inispanRemoteIdempotentRepositoryCamelTest.java | 4 +-
...nispanRemoteIdempotentRepositorySpringTest.java | 1 +
...ispanRemoteIdempotentRepositoryTestSupport.java | 3 +-
.../camel/maven/packaging/PrepareCatalogMojo.java | 113 +--
9 files changed, 1410 insertions(+), 63 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
new file mode 100644
index 0000000..0ba396c
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-component.adoc
@@ -0,0 +1,495 @@
+[[infinispan-component]]
+= Infinispan Component
+:docTitle: Infinispan
+:artifactId: camel-infinispan
+:description: Read and write from/to Infinispan distributed key/value store and data grid.
+:since: 2.13
+:supportLevel: Stable
+:component-header: Both producer and consumer are supported
+include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan.adoc[opts=optional]
+
+*Since Camel {since}*
+
+*{component-header}*
+
+This component allows you to interact with http://infinispan.org/[Infinispan] distributed data grid / cache using the Hot Rod procol.
+Infinispan is an extremely scalable, highly available key/value data store and data grid platform written in Java.
+
+Infinispan requires at least Java 8.
+
+If you use Maven, you must add the following dependency to your `pom.xml`:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+== URI format
+
+[source,java]
+-------------------------------
+infinispan://cacheName?[options]
+-------------------------------
+
+== URI Options
+
+The producer allows sending messages to a remote cache using the HotRod protocol.
+The consumer allows listening for events from a remote cache using the HotRod protocol.
+
+// component options: START
+The Infinispan component supports 26 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *configuration* (common) | Component configuration | | InfinispanRemoteConfiguration
+| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
+| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
+| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanRemoteCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER | | String
+| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
+| *key* (producer) | Set a specific key for producer operations | | Object
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
+| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
+| *value* (producer) | Set a specific value for producer operations | | Object
+| *password* ( security) | Define the password to access the infinispan instance | | String
+| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
+| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
+| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
+| *username* ( security) | Define the username to access the infinispan instance | | String
+| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
+| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
+| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
+|===
+// component options: END
+
+
+
+
+// endpoint options: START
+The Infinispan endpoint is configured using URI syntax:
+
+----
+infinispan:cacheName
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *cacheName* | *Required* The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name. | | String
+|===
+
+
+=== Query Parameters (26 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *hosts* (common) | Specifies the host of the cache on Infinispan instance | | String
+| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
+| *secure* (common) | Define if we are connecting to a secured Infinispan instance | false | boolean
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanRemoteCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CLIENT_CACHE_ENTRY_CREATED, CLIENT_CACHE_ENTRY_MODIFIED, CLIENT_CACHE_ENTRY_REMOVED, CLIENT_CACHE_ENTRY_EXPIRED, CLIENT_CACHE_FAILOVER | | String
+| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
+| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
+| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
+| *key* (producer) | Set a specific key for producer operations | | Object
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
+| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
+| *value* (producer) | Set a specific value for producer operations | | Object
+| *password* ( security) | Define the password to access the infinispan instance | | String
+| *saslMechanism* ( security) | Define the SASL Mechanism to access the infinispan instance | | String
+| *securityRealm* ( security) | Define the security realm to access the infinispan instance | | String
+| *securityServerName* ( security) | Define the security server name to access the infinispan instance | | String
+| *username* ( security) | Define the username to access the infinispan instance | | String
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | RemoteCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *configurationProperties* (advanced) | Implementation specific properties for the CacheManager | | Map
+| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
+| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
+|===
+// endpoint options: END
+
+== Camel Operations
+This section lists all available operations, along with their header information.
+
+.Put Operations
+[cols="40%,60%a", frame="all", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.PUT | Puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTASYNC | Asynchronously puts a key/value pair in the cache, optionally with expiration
+| InfinispanOperation.PUTIFABSENT | Puts a key/value pair in the cache if it did not exist, optionally with expiration
+| InfinispanOperation.PUTIFABSENTASYNC | Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
+|===
+
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
+.Put All Operations
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.PUTALL | Adds multiple entries to a cache, optionally with expiration
+| CamelInfinispanOperation.PUTALLASYNC | Asynchronously adds multiple entries to a cache, optionally with expiration
+|===
+
+* *Required Headers*:
+** CamelInfinispanMap
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+
+.Get Operations
+[cols="40%,60%a", frame="all", options="header"]
+|===
+|Operation Name |Description
+| InfinispanOperation.GET | Retrieves the value associated with a specific key from the cache
+| InfinispanOperation.GETORDEFAULT | Retrieves the value, or default value, associated with a specific key from the cache
+|===
+
+* *Required Headers*:
+** CamelInfinispanKey
+
+.Contains Key Operation
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CONTAINSKEY | Determines whether a cache contains a specific key
+|===
+
+* *Required Headers*
+** CamelInfinispanKey
+* *Result Header*
+** CamelInfinispanOperationResult
+
+.Contains Value Operation
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CONTAINSVALUE | Determines whether a cache contains a specific value
+|===
+
+* *Required Headers*:
+** CamelInfinispanKey
+
+
+.Remove Operations
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.REMOVE | Removes an entry from a cache, optionally only if the value matches a given one
+| InfinispanOperation.REMOVEASYNC | Asynchronously removes an entry from a cache, optionally only if the value matches a given one
+|===
+
+* *Required Headers*:
+** CamelInfinispanKey
+* *Optional Headers*:
+** CamelInfinispanValue
+* *Result Header*:
+** CamelInfinispanOperationResult
+
+.Replace Operations
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.REPLACE | Conditionally replaces an entry in the cache, optionally with expiration
+| InfinispanOperation.REPLACEASYNC | Asynchronously conditionally replaces an entry in the cache, optionally with expiration
+|===
+
+* *Required Headers*:
+** CamelInfinispanKey
+** CamelInfinispanValue
+** CamelInfinispanOldValue
+* *Optional Headers*:
+** CamelInfinispanLifespanTime
+** CamelInfinispanLifespanTimeUnit
+** CamelInfinispanMaxIdleTime
+** CamelInfinispanMaxIdleTimeUnit
+* *Result Header*:
+** CamelInfinispanOperationResult
+
+.Clear Operations
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.CLEAR | Clears the cache
+| InfinispanOperation.CLEARASYNC | Asynchronously clears the cache
+|===
+
+.Size Operation
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.SIZE | Returns the number of entries in the cache
+|===
+
+* *Result Header*
+** CamelInfinispanOperationResult
+
+.Stats Operation
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.STATS | Returns statistics about the cache
+|===
+
+* *Result Header*:
+** CamelInfinispanOperationResult
+
+.Query Operation
+[cols="40%,60%a", options="header"]
+|===
+| Operation Name | Description
+| InfinispanOperation.QUERY | Executes a query on the cache
+|===
+
+* *Required Headers*:
+** CamelInfinispanQueryBuilder
+* *Result Header*:
+** CamelInfinispanOperationResult
+
+[NOTE]
+====
+Write methods like put(key, value) and remove(key) do not return the previous value by default.
+====
+
+== Message Headers
+
+[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
+|=======================================================================
+|Name |Default Value |Type |Context |Description
+|CamelInfinispanCacheName |`null` |String |Shared |The cache participating in the operation or event.
+|CamelInfinispanOperation |`PUT` |InfinispanOperation |Producer |The operation to perform.
+|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
+|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
+|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
+|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event.
+|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
+|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
+|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
+|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
+|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
+|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
+|=======================================================================
+
+
+== Examples
+
+* Put a key/value into a named cache:
++
+[source,java]
+----
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT) // <1>
+ .setHeader(InfinispanConstants.KEY).constant("123") // <2>
+ .to("infinispan:myCacheName&cacheContainer=#cacheContainer"); // <3>
+----
+<1> Set the operation to perform
+<2> Set the key used to identify the element in the cache
+<3> Use the configured cache manager `cacheContainer` from the registry to put an element to the cache named `myCacheName`
++
+It is possible to configure the lifetime and/or the idle time before the entry expires and gets evicted from the cache, as example:
++
+[source,java,options="nowrap"]
+----
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
+ .setHeader(InfinispanConstants.KEY).constant("123")
+ .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L) // <1>
+ .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString()) // <2>
+ .to("infinispan:myCacheName");
+----
+<1> Set the lifespan of the entry
+<2> Set the time unit for the lifespan
+
+* Queries
++
+[source,java,options="nowrap"]
+----
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
+ .setHeader(InfinispanConstants.QUERY_BUILDER, new InfinispanQueryBuilder() {
+ @Override
+ public Query build(QueryFactory<Query> qf) {
+ return qf.from(User.class).having("name").like("%abc%").build();
+ }
+ })
+ .to("infinispan:myCacheName?cacheContainer=#cacheManager") ;
+----
++
+
+[NOTE]
+====
+The .proto descriptors for domain objects must be registered with the remote Data Grid server, see https://infinispan.org/docs/stable/titles/developing/developing.html#remote_query_example[Remote Query Example] in the official Infinispan documentation.
+====
+
+* Custom Listeners
++
+[source,java,options="nowrap"]
+----
+from("infinispan://?cacheContainer=#cacheManager&customListener=#myCustomListener")
+ .to("mock:result");
+----
++
+The instance of `myCustomListener` must exist and Camel should be able to look it up from the `Registry`.
+Users are encouraged to extend the `org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener` class and annotate the resulting class with `@ClientListener` which can be found found in package `org.infinispan.client.hotrod.annotation`.
+
+
+== Using the Infinispan based idempotent repository
+
+In this section we will use the Infinispan based idempotent repository.
+
+.Java Example
+[source,java]
+----
+InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
+conf.setHosts("localhost:1122")
+
+InfinispanRemoteIdempotentRepository repo = new InfinispanRemoteIdempotentRepository("idempotent"); // <2>
+repo.setConfiguration(conf);
+
+context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .idempotentConsumer(header("MessageID"), repo) // <3>
+ .to("mock:result");
+ }
+});
+----
+<1> Configure the cache
+<2> Configure the repository bean
+<3> Set the repository to the route
+
+.XML Example
+[source,xml]
+----
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteIdempotentRepository" destroy-method="stop">
+ <constructor-arg value="idempotent"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
+ <property name="hosts" value="localhost:11222"/>
+ </bean>
+ </property>
+</bean>
+
+<camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:start" />
+ <idempotentConsumer messageIdRepositoryRef="infinispanRepo"> <3>
+ <header>MessageID</header>
+ <to uri="mock:result" />
+ </idempotentConsumer>
+ </route>
+</camelContext>
+----
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
+
+== Using the Infinispan based aggregation repository
+
+In this section we will use the Infinispan based aggregation repository.
+
+.Java Example
+[source,java]
+----
+InfinispanRemoteConfiguration conf = new InfinispanRemoteConfiguration(); // <1>
+conf.setHosts("localhost:1122")
+
+InfinispanRemoteAggregationRepository repo = new InfinispanRemoteAggregationRepository(); // <2>
+repo.setCacheName("aggregation");
+repo.setConfiguration(conf);
+
+context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .aggregate(header("MessageID"))
+ .completionSize(3)
+ .aggregationRepository(repo) // <3>
+ .aggregationStrategyRef("myStrategy")
+ .to("mock:result");
+ }
+});
+----
+<1> Configure the cache
+<2> Create the repository bean
+<3> Set the repository to the route
+
+.XML Example
+[source,xml]
+----
+<bean id="infinispanRepo" class="org.apache.camel.component.infinispan.remote.InfinispanRemoteAggregationRepository" destroy-method="stop">
+ <constructor-arg value="aggregation"/> <1>
+ <property name="configuration"> <2>
+ <bean class="org.apache.camel.component.infinispan.remote.InfinispanRemoteConfiguration">
+ <property name="hosts" value="localhost:11222"/>
+ </bean>
+ </property>
+</bean>
+
+<camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:start" />
+ <aggregate strategyRef="myStrategy"
+ completionSize="3"
+ aggregationRepositoryRef="infinispanRepo"> <3>
+ <correlationExpression>
+ <header>MessageID</header>
+ </correlationExpression>
+ <to uri="mock:result"/>
+ </aggregate>
+ </route>
+</camelContext>
+----
+<1> Set the name of the cache that will be used by the repository
+<2> Configure the repository bean
+<3> Set the repository to the route
+
+[NOTE]
+====
+With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
+For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
+====
+
+
+
+
+include::camel-spring-boot::page$infinispan-starter.adoc[]
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
new file mode 100644
index 0000000..3b2f7f3
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/infinispan-embedded-component.adoc
@@ -0,0 +1,843 @@
+[[infinispan-embedded-component]]
+= Infinispan Embedded Component
+:docTitle: Infinispan Embedded
+:artifactId: camel-infinispan-embedded
+:description: Read and write from/to Infinispan distributed key/value store and data grid.
+:since: 2.13
+:supportLevel: Stable
+:component-header: Both producer and consumer are supported
+include::{cq-version}@camel-quarkus:ROOT:partial$reference/components/infinispan-embedded.adoc[opts=optional]
+
+*Since Camel {since}*
+
+*{component-header}*
+
+This component allows you to interact with
+http://infinispan.org/[Infinispan] distributed data grid / cache.
+Infinispan is an extremely scalable, highly available key/value data
+store and data grid platform written in Java.
+
+Infinispan requires at least Java 8.
+
+The `camel-infinispan` component includes the following features:
+
+* *Local Camel Consumer* - Receives cache change notifications and sends them to be processed.
+This can be done synchronously or asynchronously, and is also supported with a replicated or distributed cache.
+
+* *Local Camel Producer* - A producer creates and sends messages to an endpoint.
+The `camel-infinispan` producer uses ``GET``, ``PUT``, ``REMOVE``, and `CLEAR` operations.
+The local producer is also supported with a replicated or distributed cache.
+
+The events are processed asynchronously.
+
+If you use Maven, you must add the following dependency to your `pom.xml`:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-infinispan-embedded</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+== URI format
+
+[source,java]
+-------------------------------
+infinispan-embedded://cacheName?[options]
+-------------------------------
+
+== URI Options
+
+The producer allows sending messages to a local infinispan cache
+configured in the registry, or to a remote cache using the HotRod
+protocol. The consumer allows listening for events from local infinispan cache
+accessible from the registry.
+
+If no cache configuration is provided, embedded cacheContainer is created directly in the component.
+
+
+// component options: START
+The Infinispan Embedded component supports 20 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *configuration* (common) | Component configuration | | InfinispanEmbeddedConfiguration
+| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
+| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
+| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
+| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
+| *key* (producer) | Set a specific key for producer operations | | Object
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
+| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
+| *value* (producer) | Set a specific value for producer operations | | Object
+| *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
+| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
+|===
+// component options: END
+
+
+
+
+// endpoint options: START
+The Infinispan Embedded endpoint is configured using URI syntax:
+
+----
+infinispan-embedded:cacheName
+----
+
+with the following path and query parameters:
+
+=== Path Parameters (1 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *cacheName* | *Required* The name of the cache to use. Use current to use the existing cache name from the currently configured cached manager. Or use default for the default cache manager name. | | String
+|===
+
+
+=== Query Parameters (20 parameters):
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *queryBuilder* (common) | Specifies the query builder. | | InfinispanQueryBuilder
+| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
+| *clusteredListener* (consumer) | If true, the listener will be installed for the entire cluster | false | boolean
+| *customListener* (consumer) | Returns the custom listener in use, if provided | | InfinispanEmbeddedCustomListener
+| *eventTypes* (consumer) | Specifies the set of event types to register by the consumer.Multiple event can be separated by comma. The possible event types are: CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED, CACHE_ENTRY_VISITED, CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED, CACHE_ENTRY_MODIFIED, TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED, CACHE_ENTRY_EXPIRED, DATA_REHASHED, TOPOLOGY_CHANGED, PARTITION_STATUS_CHANGED, PERSIS [...]
+| *sync* (consumer) | If true, the consumer will receive notifications synchronously | true | boolean
+| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler
+| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. There are 3 enums and the value can be one of: InOnly, InOut, InOptionalOut | | ExchangePattern
+| *defaultValue* (producer) | Set a specific default value for some producer operations | | Object
+| *key* (producer) | Set a specific key for producer operations | | Object
+| *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
+| *oldValue* (producer) | Set a specific old value for some producer operations | | Object
+| *operation* (producer) | The operation to perform. There are 21 enums and the value can be one of: PUT, PUTASYNC, PUTALL, PUTALLASYNC, PUTIFABSENT, PUTIFABSENTASYNC, GET, GETORDEFAULT, CONTAINSKEY, CONTAINSVALUE, REMOVE, REMOVEASYNC, REPLACE, REPLACEASYNC, SIZE, CLEAR, CLEARASYNC, QUERY, STATS, COMPUTE, COMPUTEASYNC | PUT | InfinispanOperation
+| *value* (producer) | Set a specific value for producer operations | | Object
+| *cacheContainer* (advanced) | *Autowired* Specifies the cache Container to connect | | EmbeddedCacheManager
+| *cacheContainerConfiguration* (advanced) | *Autowired* The CacheContainer configuration. Uses if the cacheContainer is not defined. Must be the following types: org.infinispan.client.hotrod.configuration.Configuration - for remote cache interaction configuration; org.infinispan.configuration.cache.Configuration - for embedded cache interaction configuration; | | Configuration
+| *configurationUri* (advanced) | An implementation specific URI for the CacheManager | | String
+| *flags* (advanced) | A comma separated list of Flag to be applied by default on each cache invocation, not applicable to remote caches. | | String
+| *remappingFunction* (advanced) | Set a specific remappingFunction to use in a compute operation. | | BiFunction
+| *resultHeader* (advanced) | Store the operation result in a header instead of the message body. By default, resultHeader == null and the query result is stored in the message body, any existing content in the message body is discarded. If resultHeader is set, the value is used as the name of the header to store the query result and the original message body is preserved. This value can be overridden by an in message header named: CamelInfinispanOperationResultHeader | | String
+|===
+// endpoint options: END
+
+== Camel Operations
+This section lists all available operations, along with their header information.
+
+.Put Operations
+[cols="40%,60%", frame="all", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.PUT
+| *Context*: Embedded / Remote
+
+*Description*: Puts a key/value pair in the cache, optionally with expiration
+
+*Required Headers*: CamelInfinispanKey, CamelInfinispanValue
+
+*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
+
+*Result Header*: CamelInfinispanOperationResult
+
+| InfinispanOperation.PUTASYNC
+| *Description*: Asynchronously puts a key/value pair in the cache, optionally with expiration
+
+
+| InfinispanOperation.PUTIFABSENT
+| *Description*: Puts a key/value pair in the cache if it did not exist, optionally with expiration
+
+
+| InfinispanOperation.PUTIFABSENTASYNC
+| *Description*: Asynchronously puts a key/value pair in the cache if it did not exist, optionally with expiration
+
+|===
+
+.Put All Operations
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.PUTALL
+| *Context*: Embedded / Remote
+
+*Description*: Adds multiple entries to a cache, optionally with expiration
+
+*Required Headers*: CamelInfinispanMap
+
+*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit
+
+*Result Header*: None
+
+| CamelInfinispanOperation.PUTALLASYNC
+| *Description*: Asynchronously adds multiple entries to a cache, optionally with expiration
+
+|===
+
+.Get Operations
+[cols="40%,60%", frame="all", options="header"]
+|===
+|Operation Name
+|Description
+
+| InfinispanOperation.GET
+| *Context*: Embedded / Remote
+
+*Description*: Retrieves the value associated with a specific key from the cache
+
+*Required Headers*: CamelInfinispanKey
+
+*Optional Headers*: None
+
+*Result Header*: None
+
+| InfinispanOperation.GETORDEFAULT
+| *Context*: Embedded / Remote
+
+*Description*: Retrieves the value, or default value, associated with a specific key from the cache
+
+*Required Headers*: CamelInfinispanKey
+
+*Optional Headers*: None
+
+*Result Header*: None
+|===
+
+.Contains Key Operation
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.CONTAINSKEY
+| *Context*: Embedded / Remote
+
+*Description*: Determines whether a cache contains a specific key
+
+*Required Headers*: CamelInfinispanKey
+
+*Optional Headers*: None
+
+*Result Header*: CamelInfinispanOperationResult
+|===
+
+.Contains Value Operation
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.CONTAINSVALUE
+| *Context*: Embedded / Remote
+
+*Description*: Determines whether a cache contains a specific value
+
+*Required Headers*: CamelInfinispanKey
+
+*Optional Headers*: None
+
+*Result Headers*: None
+|===
+
+.Remove Operations
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.REMOVE
+| *Context*: Embedded / Remote
+
+*Description*: Removes an entry from a cache, optionally only if the value matches a given one
+
+*Required Headers*: CamelInfinispanKey
+
+*Optional Headers*: CamelInfinispanValue
+
+*Result Header*: CamelInfinispanOperationResult
+
+| InfinispanOperation.REMOVEASYNC
+| *Description*: Asynchronously removes an entry from a cache, optionally only if the value matches a given one
+
+|===
+
+.Replace Operations
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.REPLACE
+| *Context*: Embedded / Remote
+
+*Description*: Conditionally replaces an entry in the cache, optionally with expiration
+
+*Required Headers*: CamelInfinispanKey, CamelInfinispanValue, CamelInfinispanOldValue
+
+*Optional Headers*: CamelInfinispanLifespanTime, CamelInfinispanLifespanTimeUnit, CamelInfinispanMaxIdleTime, CamelInfinispanMaxIdleTimeUnit, CamelInfinispanIgnoreReturnValues
+
+*Result Header*: CamelInfinispanOperationResult
+
+| InfinispanOperation.REPLACEASYNC
+| *Description*: Asynchronously conditionally replaces an entry in the cache, optionally with expiration
+
+|===
+
+.Clear Operations
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.CLEAR
+| *Context*: Embedded / Remote
+
+*Description*: Clears the cache
+
+*Required Headers*: None
+
+*Optional Headers*: None
+
+*Result Header*: None
+
+| InfinispanOperation.CLEARASYNC
+| *Context*: Embedded / Remote
+
+*Description*: Asynchronously clears the cache
+
+*Required Headers*: None
+
+*Optional Headers*: None
+
+*Result Header*: None
+|===
+
+.Size Operation
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.SIZE
+| *Context*: Embedded / Remote
+
+*Description*: Returns the number of entries in the cache
+
+*Required Headers*: None
+
+*Optional Headers*: None
+
+*Result Header*: CamelInfinispanOperationResult
+|===
+
+.Stats Operation
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.STATS
+| *Context*: Embedded / Remote
+
+*Description*: Returns statistics about the cache
+
+*Required Headers*: None
+
+*Optional Headers*: None
+
+*Result Header*: CamelInfinispanOperationResult
+|===
+
+.Query Operation
+[cols="40%,60%", options="header"]
+|===
+| Operation Name
+| Description
+
+| InfinispanOperation.QUERY
+| *Context*: Remote
+
+*Description*: Executes a query on the cache
+
+*Required Headers*: CamelInfinispanQueryBuilder
+
+*Optional Headers*: None
+
+*Result Header*: CamelInfinispanOperationResult
+|===
+
+[NOTE]
+====
+Any operations that take `CamelInfinispanIgnoreReturnValues` will receive a null result.
+====
+
+
+
+== Message Headers
+
+[width="100%",cols="10%,10%,10%,10%,60%",options="header",]
+|=======================================================================
+|Name |Default Value |Type |Context |Description
+|CamelInfinispanCacheName |`null` |String |Shared |The cache participating in the operation or event.
+|CamelInfinispanOperation |`PUT` |InfinispanOperation |Producer |The operation to perform.
+|CamelInfinispanMap |`null` |Map |Producer |A Map to use in case of CamelInfinispanOperationPutAll operation
+|CamelInfinispanKey |`null` |Object |Shared |The key to perform the operation to or the key generating the event.
+|CamelInfinispanValue |`null` |Object |Producer |The value to use for the operation.
+|CamelInfinispanEventType |`null` |String |Consumer |The type of the received event. Possible values defined here org.infinispan.notifications.cachelistener.event.Event.Type
+|CamelInfinispanIsPre |`null` |Boolean |Consumer |Infinispan fires two events for each operation: one before and one after the operation.
+|CamelInfinispanLifespanTime |`null` |long |Producer |The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.
+|CamelInfinispanTimeUnit |`null` |String |Producer |The Time Unit of an entry Lifespan Time.
+|CamelInfinispanMaxIdleTime |`null` |long |Producer |The maximum amount of time an entry is allowed to be idle for before it is considered as expired.
+|CamelInfinispanMaxIdleTimeUnit |`null` |String |Producer |The Time Unit of an entry Max Idle Time.
+|CamelInfinispanQueryBuilder |null |InfinispanQueryBuilder |Producer |The QueryBuilde to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one
+|CamelInfinispanIgnoreReturnValues |null |Boolean |Producer |If this header is set, the return value for cache operation returning something is ignored by the client application
+|CamelInfinispanOperationResultHeader |null |String |Producer |Store the operation result in a header instead of the message body
+|=======================================================================
+
+== Examples
+
+* Retrieve a specific key from the default cache using a custom cache container:
+
+[source,java]
+----
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
+ .setHeader(InfinispanConstants.KEY).constant("123")
+ .to("infinispan?cacheContainer=#cacheContainer");
+----
+
+
+* Put a key/value into a named cache:
++
+[source,java]
+----
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
+ .setHeader(InfinispanConstants.KEY).constant("123")
+ .to("infinispan:myCacheName");
+----
+
+* Put a value with lifespan
+
+[source,java]
+----
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
+ .setHeader(InfinispanConstants.KEY).constant("123")
+ .setHeader(InfinispanConstants.LIFESPAN_TIME).constant(100L)
+ .setHeader(InfinispanConstants.LIFESPAN_TIME_UNIT.constant(TimeUnit.MILLISECONDS.toString())
+ .to("infinispan:myCacheName");
+----
+
+* Compute operation through a remapping function on the default cache using a custom cache container:
+
+[source,java]
+----
+@BindToRegistry("mappingFunction")
+BiFunction<String, String, String> comp = (k, v) -> v + "replay";
+
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.COMPUTE)
+ .setHeader(InfinispanConstants.KEY).constant("123")
+ .to("infinispan?cacheContainer=#cacheContainer&remappingFunction=#mappingFunction");
+----
+
+This will return oldValue + "replay".
+
+This can be done also as async operation, with the `InfinispanOperation.COMPUTEASYNC` operation
+
+* Retrieve a specific key from the remote cache using a cache container configuration with additional parameters (host, port and protocol version):
+
+[source,java]
+----
+org.infinispan.client.hotrod.configuration.Configuration cacheContainerConfiguration = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder()
+ .addServer()
+ .host("localhost")
+ .port(9999)
+ .version(org.infinispan.client.hotrod.ProtocolVersion.PROTOCOL_VERSION_25)
+ .build();
+...
+
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
+ .setHeader(InfinispanConstants.KEY).constant("123")
+ .to("infinispan?cacheContainerConfiguration=#cacheContainerConfiguration");
+----
+
+
+
+=== XML examples
+
+Routing can also be performed using XML configuration.
+The following example demonstrates `camel-infinispan` `local-camel-producer`, a camel route that sends data to an embedded cache created by the `local-cache` module.
+
+[source,java,options="nowrap"]
+----
+<camelContext id="local-producer" xmlns="http://camel.apache.org/schema/blueprint">
+ <route>
+ <from uri="timer://local?fixedRate=true&period=5000"/>
+ <setHeader headerName="CamelInfinispanKey">
+ <constant>CamelTimerCounter</constant>
+ </setHeader>
+ <setHeader headerName="CamelInfinispanValue">
+ <constant>CamelTimerCounter</constant>
+ </setHeader>
+ <to uri="infinispan://foo?cacheContainer=#cacheManager"/>
+ <to uri="log:local-put?showAll=true"/>
+ </route>
+</camelContext>
+----
+
+
+The provided example requires you to instantiate the [class]``cacheManager``.
+
+You can instantiate the [class]``cacheManager`` bean for Spring XML as follows:
+
+[source,xml,options="nowrap"]
+----
+<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
+ <constructor-arg type="java.lang.String" value="infinispan.xml"/>
+</bean>
+----
+
+
+The following demonstrates how to instantiate the [class]``cacheManager`` bean using Blueprint XML.
+
+[source,xml,options="nowrap"]
+----
+<bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager" init-method="start" destroy-method="stop">
+ <argument value="infinispan.xml" />
+</bean>
+----
+
+[NOTE]
+====
+Both the Spring XML and Blueprint XML examples use the configuration file [path]_infinispan.xml_
+ for configuration of the cache. This file must be present on the classpath.
+====
+
+
+== Remote Query
+
+When executing remote queries the cacheManager must be an instance of ``RemoteCacheManager``, and an example configuration utilizing a `RemoteCacheManager` is found below for both Java and blueprint.xml:
+
+.Using only Java
+====
+[source,java,options="nowrap"]
+----
+from("direct:start")
+ .setHeader(InfinispanConstants.OPERATION, InfinispanConstants.QUERY)
+ .setHeader(InfinispanConstants.QUERY_BUILDER,
+ new InfinispanQueryBuilder() {
+ public Query build(QueryFactory<Query> queryFactory) {
+ return queryFactory.from(User.class).having("name").like("%abc%")
+ .build();
+ }
+ })
+ .to("infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache") ;
+----
+====
+
+.Using Blueprint and Java
+====
+.Java [class]``RemoteCacheManagerFactory`` class:
+[source,java,options="nowrap"]
+----
+public class RemoteCacheManagerFactory {
+ ConfigurationBuilder clientBuilder;
+ public RemoteCacheManagerFactory(String hostname, int port) {
+ clientBuilder = new ConfigurationBuilder();
+ clientBuilder.addServer()
+ .host(hostname).port(port);
+ }
+ public RemoteCacheManager newRemoteCacheManager() {
+ return new RemoteCacheManager(clientBuilder.build());
+ }
+}
+----
+.Java [class]``InfinispanQueryExample`` class:
+[source,java,options="nowrap"]
+----
+public class InfinispanQueryExample {
+ public InfinispanQueryBuilder getBuilder() {
+ return new InfinispanQueryBuilder() {
+ public Query build(QueryFactory<Query> queryFactory) {
+ return queryFactory.from(User.class)
+ .having("name")
+ .like("%abc%")
+ .build();
+ }
+ }
+ }
+}
+----
+.blueprint.xml:
+[source,xml,options="nowrap"]
+----
+<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
+ <argument value=”localhost”/>
+ <argument value="11222”/>
+</bean>
+
+<bean id=”cacheManager”
+ factory-ref=”remoteCacheManagerFactory”
+ factory-method=“newRemoteCacheManager”>
+</bean>
+
+<bean id="queryBuilder" class="org.example.com.InfinispanQueryExample"/>
+
+<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+ <route>
+ <from uri="direct:start"/>
+ <setHeader headerName="CamelInfinispanOperation">
+ <constant>CamelInfinispanOperationQuery</constant>
+ </setHeader>
+ <setHeader headerName="CamelInfinispanQueryBuilder">
+ <method ref="queryBuilder" method="getBuilder"/>
+ </setHeader>
+ <to uri="infinispan://localhost?cacheContainer=#cacheManager&cacheName=remote_query_cache"/>
+ </route>
+</camelContext>
+----
+====
+
+The `remote_query_cache` is an arbitrary name for a cache that holds the data, and the results of the query will be a list of domain objects stored as a `CamelInfinispanOperationResult` header.
+
+In addition, there are the following requirements:
+
+* The [class]``RemoteCacheManager`` must be configured to use [class]``ProtoStreamMarshaller``.
+* The [class]``ProtoStreamMarshaller`` must be registered with the [class]``RemoteCacheManager``'s serialization context.
+* The .proto descriptors for domain objects must be registered with the remote Data Grid server.
+
+
+== Custom Listeners for Embedded Cache
+
+Custom Listeners for an embedded cache can be registered through the [parameter]``customListener`` parameter as shown below:
+
+.Using Java
+
+[source,java,options="nowrap"]
+----
+from("infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener")
+ .to("mock:result");
+----
+
+.Using Blueprint
+
+[source,xml,options="nowrap"]
+----
+<bean id="myCustomContainer" org.infinispan.manager.DefaultCacheManager"
+ init-method="start" destroy-method="stop">
+ <argument value="infinispan.xml" />
+</bean>
+
+<bean id="myCustomListener" class="org.example.com.CustomListener"/>
+
+<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+ <route>
+ <from uri="infinispan://?cacheContainer=#myCustomContainer&cacheName=customCacheName&customListener=#myCustomListener"/>
+ <to uri="mock:result"/>
+ </route>
+</camelContext>
+----
+
+
+The instance of [class]``myCustomListener`` must exist.
+Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.embedded.InfinispanEmbeddedCustomListener`` and annotate the resulting class with the `@Listener` annotation from [package]#org.infinispan.notifications#
+.
+
+[NOTE]
+====
+Custom filters and converters for embedded caches are currently not supported.
+====
+
+
+== Custom Listeners for Remote Cache
+
+Custom listeners for a remote cache can be registered in the same way as an embedded cache, with the exception that [parameter]``sync=false`` must be present.
+For instance:
+
+.Using only Java
+====
+[source,java,options="nowrap"]
+----
+from(infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener")
+ .to(mock:result);
+----
+====
+
+.Using Blueprint and Java
+====
+.Java class:
+[source,java,options="nowrap"]
+----
+
+public class RemoteCacheManagerFactory {
+ ConfigurationBuilder clientBuilder;
+ public RemoteCacheManagerFactory(String hostname, int port) {
+ clientBuilder = new ConfigurationBuilder();
+ clientBuilder.addServer()
+ .host(hostname).port(port);
+ }
+ public RemoteCacheManager newRemoteCacheManager() {
+ return new RemoteCacheManager(clientBuilder.build());
+ }
+}
+----
+.blueprint.xml:
+[source,xml,options="nowrap"]
+----
+<bean id=”remoteCacheManagerFactory” class=“com.datagrid.RemoteCacheManagerFactory”>
+ <argument value=”localhost”/>
+ <argument value="11222”/>
+</bean>
+
+<bean id=”cacheManager”
+ factory-ref=”remoteCacheManagerFactory”
+ factory-method=“newRemoteCacheManager”>
+</bean>
+
+<bean id="myCustomListener" class="org.example.com.CustomListener"/>
+
+<camelContext id="route" xmlns="http://camel.apache.org/schema/blueprint">
+ <route>
+ <from uri="infinispan://?cacheContainer=#cacheManager&sync=false&customListener=#myCustomListener"/>
+ <to uri="mock:result"/>
+ </route>
+</camelContext>
+----
+====
+
+The instance of [class]``myCustomListener`` must exist.
+Users are encouraged to extend the [class]``org.apache.camel.component.infinispan.remote.InfinispanRemoteCustomListener`` class and annotate the resulting class with ``@ClientListener``; this annotation is found in [package]#org.infinispan.client.hotrod.annotation#
+.
+
+Remote listeners may also be associated with custom filters and converters as shown below:
+[source,java,options="nowrap"]
+----
+@ClientListener(includeCurrentState=true, filterFactoryName = "static-filter-factory", converterFactoryName = "static-converter-factory")
+ private static class MyCustomListener extends InfinispanRemoteCustomListener {
+}
+----
+
+In order to use custom filters or converters classes annotated with `@NamedFactory` must be implemented.
+A skeleton that implements the necessary methods is shown below:
+[source,java,options="nowrap"]
+----
+import org.infinispan.notifications.cachelistener.filter;
+
+@NamedFactory(name = "static-converter-factory")
+public static class StaticConverterFactory implements CacheEventConverterFactory {
+ @Override
+ public CacheEventConverter<Integer, String, CustomEvent> getConverter(Object[] params) {
+ ...
+ }
+
+ static class StaticConverter implements CacheEventConverter<Integer, String, CustomEvent>, Serializable {
+ @Override
+ public CustomEvent convert(Integer key, String previousValue, Metadata previousMetadata,
+ String value, Metadata metadata, EventType eventType) {
+ ...
+ }
+ }
+}
+
+@NamedFactory(name = "static-filter-factory")
+public static class StaticCacheEventFilterFactory implements CacheEventFilterFactory {
+ @Override
+ public CacheEventFilter<Integer, String> getFilter(final Object[] params) {
+ ...
+ }
+
+ static class StaticCacheEventFilter implements CacheEventFilter<Integer, String>, Serializable {
+ @Override
+ public boolean accept(Integer key, String previousValue, Metadata previousMetadata,
+ String value, Metadata metadata, EventType eventType) {
+ ...
+ }
+ }
+}
+----
+
+Custom filters and converters must be registered with the server.
+.
+
+[NOTE]
+====
+In order to listen for remote HotRod events the cacheManager must be of type [class]``RemoteCacheManager`` and instantiated.
+====
+
+[NOTE]
+====
+With the release of Infinispan 11, it is required to set the encoding configuration on any cache created. This is critical for consuming events too.
+For more information have a look at https://infinispan.org/docs/stable/titles/developing/developing.html#data_encoding[Data Encoding and MediaTypes] in the official Infinispan documentation.
+====
+
+== Using the Infinispan based idempotent repository
+
+In this section we will use the Infinispan based idempotent repository.
+
+First, we need to create a cacheManager and then configure our
+
+[source,java]
+----
+org.apache.camel.component.infinispan.processor.idempotent.InfinispanIdempotentRepository:
+----
+
+[source,xml]
+----
+<!-- set up the cache manager -->
+<bean id="cacheManager"
+ class="org.infinispan.manager.DefaultCacheManager"
+ init-method="start"
+ destroy-method="stop"/>
+
+<!-- set up the repository -->
+<bean id="infinispanRepo"
+ class="org.apache.camel.component.infinispan.InfinispanIdempotentRepository"
+ factory-method="infinispanIdempotentRepository">
+ <argument ref="cacheManager"/>
+ <argument value="idempotent"/>
+</bean>
+----
+
+Then we can create our Infinispan idempotent repository in the spring
+XML file as well:
+
+[source,xml]
+----
+<camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route id="JpaMessageIdRepositoryTest">
+ <from uri="direct:start" />
+ <idempotentConsumer messageIdRepositoryRef="infinispanStore">
+ <header>messageId</header>
+ <to uri="mock:result" />
+ </idempotentConsumer>
+ </route>
+</camelContext>
+----
+
+
+include::camel-spring-boot::page$infinispan-starter.adoc[]
diff --git a/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
index 39f5f61..9c09afb 100644
--- a/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
+++ b/components/camel-infinispan/camel-infinispan-common/src/main/java/org/apache/camel/component/infinispan/InfinispanConsumer.java
@@ -23,8 +23,6 @@ import org.apache.camel.Processor;
import org.apache.camel.support.DefaultConsumer;
import org.infinispan.commons.api.BasicCache;
import org.infinispan.commons.api.BasicCacheContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public abstract class InfinispanConsumer<
ContainerType extends BasicCacheContainer,
@@ -33,8 +31,6 @@ public abstract class InfinispanConsumer<
extends DefaultConsumer
implements InfinispanEventProcessor {
- private static final Logger LOG = LoggerFactory.getLogger(InfinispanProducer.class);
-
protected final ConfigurationType configuration;
protected final ManagerType manager;
protected final String cacheName;
@@ -66,7 +62,7 @@ public abstract class InfinispanConsumer<
try {
getProcessor().process(exchange);
} catch (Exception e) {
- LOG.error("Error processing event ", e);
+ getExceptionHandler().handleException(e);
}
}
diff --git a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
index e0ac1eb..c14c00f 100644
--- a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteProducerTest.java
@@ -3,7 +3,7 @@
* 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", getCacheName()); you may not use this file except in compliance with
+ * (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
diff --git a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
index 75fc85b..e9563bd 100644
--- a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteTestSupport.java
@@ -32,10 +32,10 @@ import org.slf4j.LoggerFactory;
@TestMethodOrder(MethodOrderer.MethodName.class)
public class InfinispanRemoteTestSupport extends InfinispanTestSupport {
- protected RemoteCacheManager cacheContainer;
-
@RegisterExtension
- static InfinispanService service = InfinispanServiceFactory.createService();
+ public static InfinispanService service = InfinispanServiceFactory.createService();
+
+ protected RemoteCacheManager cacheContainer;
@Override
protected void setupResources() throws Exception {
diff --git a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java
index f8fffe6..d47a550 100644
--- a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryCamelTest.java
@@ -21,7 +21,9 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.annotation.DirtiesContext;
@DirtiesContext
-public class SpringInfinispanRemoteIdempotentRepositoryCamelTest extends SpringInfinispanRemoteIdempotentRepositoryTestSupport {
+public class SpringInfinispanRemoteIdempotentRepositoryCamelTest
+ extends SpringInfinispanRemoteIdempotentRepositoryTestSupport {
+
@Override
protected AbstractApplicationContext createApplicationContext() {
return new ClassPathXmlApplicationContext(
diff --git a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java
index 93c8442..4726f42 100644
--- a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositorySpringTest.java
@@ -23,6 +23,7 @@ import org.springframework.test.annotation.DirtiesContext;
@DirtiesContext
public class SpringInfinispanRemoteIdempotentRepositorySpringTest
extends SpringInfinispanRemoteIdempotentRepositoryTestSupport {
+
@Override
protected AbstractApplicationContext createApplicationContext() {
return new ClassPathXmlApplicationContext(
diff --git a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java
index 5c91175..28ba51d 100644
--- a/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java
+++ b/components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/spring/SpringInfinispanRemoteIdempotentRepositoryTestSupport.java
@@ -33,9 +33,8 @@ import org.junit.jupiter.api.extension.RegisterExtension;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public abstract class SpringInfinispanRemoteIdempotentRepositoryTestSupport extends CamelSpringTestSupport {
-
@RegisterExtension
- static InfinispanService service = InfinispanServiceFactory.createService();
+ public static InfinispanService service = InfinispanServiceFactory.createService();
@Override
public void doPreSetup() throws Exception {
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
index e87145c..9432129 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java
@@ -214,6 +214,25 @@ public class PrepareCatalogMojo extends AbstractMojo {
private Collection<Path> allPropertiesFiles;
private Map<Path, BaseModel<?>> allModels;
+ private static String asComponentName(Path file) {
+ String name = file.getFileName().toString();
+ if (name.endsWith(PackageHelper.JSON_SUFIX)) {
+ return name.substring(0, name.length() - PackageHelper.JSON_SUFIX.length());
+ } else if (name.endsWith(".adoc")) {
+ return name.substring(0, name.length() - ".adoc".length());
+ }
+ return name;
+ }
+
+ private static boolean excludeDocumentDir(String name) {
+ for (String exclude : EXCLUDE_DOC_FILES) {
+ if (exclude.equals(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* Execute goal.
*
@@ -230,9 +249,11 @@ public class PrepareCatalogMojo extends AbstractMojo {
Stream.concat(list(componentsDir.toPath()),
Stream.of(coreDir.toPath(), modelDir.toPath(), baseDir.toPath(), languagesDir.toPath(), jaxpDir.toPath(),
springDir.toPath()))
- .filter(dir -> !"target".equals(dir.getFileName().toString())).map(this::getComponentPath)
+ .filter(dir -> !"target".equals(dir.getFileName().toString()))
+ .flatMap(p -> getComponentPath(p).stream())
.filter(dir -> Files.isDirectory(dir.resolve("src")))
- .map(p -> p.resolve("target/classes")).flatMap(PackageHelper::walk).forEach(p -> {
+ .map(p -> p.resolve("target/classes"))
+ .flatMap(PackageHelper::walk).forEach(p -> {
String f = p.getFileName().toString();
if (f.endsWith(PackageHelper.JSON_SUFIX)) {
allJsonFiles.add(p);
@@ -388,11 +409,11 @@ public class PrepareCatalogMojo extends AbstractMojo {
// check all the component options and grab the label(s) they
// use
model.getComponentOptions().stream().map(BaseOptionModel::getLabel).filter(l -> !Strings.isNullOrEmpty(l)).flatMap(l -> Stream.of(label.split(",")))
- .forEach(usedOptionLabels::add);
+ .forEach(usedOptionLabels::add);
// check all the endpoint options and grab the label(s) they use
model.getEndpointOptions().stream().map(BaseOptionModel::getLabel).filter(l -> !Strings.isNullOrEmpty(l)).flatMap(l -> Stream.of(label.split(",")))
- .forEach(usedOptionLabels::add);
+ .forEach(usedOptionLabels::add);
long unused = model.getEndpointOptions().stream().map(BaseOptionModel::getLabel).filter(Strings::isNullOrEmpty).count();
if (unused >= UNUSED_LABELS_WARN) {
@@ -462,7 +483,7 @@ public class PrepareCatalogMojo extends AbstractMojo {
for (Path file : jsonFiles) {
- DataFormatModel model = (DataFormatModel)allModels.get(file);
+ DataFormatModel model = (DataFormatModel) allModels.get(file);
// Check labels
String name = asComponentName(file);
@@ -518,7 +539,7 @@ public class PrepareCatalogMojo extends AbstractMojo {
for (Path file : jsonFiles) {
- LanguageModel model = (LanguageModel)allModels.get(file);
+ LanguageModel model = (LanguageModel) allModels.get(file);
// Check labels
String name = asComponentName(file);
@@ -572,6 +593,7 @@ public class PrepareCatalogMojo extends AbstractMojo {
case "camel-fhir":
case "camel-debezium-common":
case "camel-vertx-kafka":
+ case "camel-infinispan":
return false;
default:
return true;
@@ -594,7 +616,7 @@ public class PrepareCatalogMojo extends AbstractMojo {
for (Path file : jsonFiles) {
- OtherModel model = (OtherModel)allModels.get(file);
+ OtherModel model = (OtherModel) allModels.get(file);
String name = asComponentName(file);
@@ -661,21 +683,27 @@ public class PrepareCatalogMojo extends AbstractMojo {
Set<Path> duplicateAdocFiles = new TreeSet<>();
// find all camel maven modules
- Stream.concat(list(componentsDir.toPath()).filter(dir -> !dir.getFileName().startsWith(".") && !"target".equals(dir.getFileName().toString())).map(this::getComponentPath),
- Stream.of(coreDir.toPath(), baseDir.toPath(), languagesDir.toPath(), jaxpDir.toPath()))
- .forEach(dir -> {
- List<Path> l = PackageHelper.walk(dir.resolve("src/main/docs")).filter(f -> f.getFileName().toString().endsWith(".adoc")).collect(Collectors.toList());
- if (l.isEmpty()) {
- String n = dir.getFileName().toString();
- boolean isDir = dir.toFile().isDirectory();
- boolean valid = isDir && !n.startsWith(".") && !n.endsWith("-base") && !n.endsWith("-common");
- if (valid) {
- missingAdocFiles.add(dir);
- }
- } else {
- adocFiles.addAll(l);
+ Stream.concat(
+ list(componentsDir.toPath())
+ .filter(dir -> !dir.getFileName().startsWith(".") && !"target".equals(dir.getFileName().toString()))
+ .flatMap(p -> getComponentPath(p).stream()),
+ Stream.of(coreDir.toPath(), baseDir.toPath(), languagesDir.toPath(), jaxpDir.toPath()))
+ .forEach(dir -> {
+ List<Path> l = PackageHelper.walk(dir.resolve("src/main/docs"))
+ .filter(f -> f.getFileName().toString().endsWith(".adoc"))
+ .collect(Collectors.toList());
+
+ if (l.isEmpty()) {
+ String n = dir.getFileName().toString();
+ boolean isDir = dir.toFile().isDirectory();
+ boolean valid = isDir && !n.startsWith(".") && !n.endsWith("-base") && !n.endsWith("-common");
+ if (valid) {
+ missingAdocFiles.add(dir);
}
- });
+ } else {
+ adocFiles.addAll(l);
+ }
+ });
getLog().info("Found " + adocFiles.size() + " ascii document files");
@@ -688,7 +716,7 @@ public class PrepareCatalogMojo extends AbstractMojo {
// Copy all descriptors
Map<Path, Path> newJsons = map(adocFiles, p -> p, p -> documentsOutDir.resolve(p.getFileName()));
list(documentsOutDir).filter(p -> !newJsons.containsValue(p) && !newJsons.containsValue(p.resolveSibling(p.getFileName().toString().replace(".html", ".adoc"))))
- .forEach(this::delete);
+ .forEach(this::delete);
newJsons.forEach(this::copy);
Path all = documentsOutDir.resolve("../docs.properties");
@@ -1035,16 +1063,6 @@ public class PrepareCatalogMojo extends AbstractMojo {
getLog().info("================================================================================");
}
- private static String asComponentName(Path file) {
- String name = file.getFileName().toString();
- if (name.endsWith(PackageHelper.JSON_SUFIX)) {
- return name.substring(0, name.length() - PackageHelper.JSON_SUFIX.length());
- } else if (name.endsWith(".adoc")) {
- return name.substring(0, name.length() - ".adoc".length());
- }
- return name;
- }
-
private void copyFile(Path file, Path toDir) throws IOException, MojoFailureException {
if (Files.isRegularFile(file)) {
// make sure to create out dir
@@ -1059,15 +1077,6 @@ public class PrepareCatalogMojo extends AbstractMojo {
}
}
- private static boolean excludeDocumentDir(String name) {
- for (String exclude : EXCLUDE_DOC_FILES) {
- if (exclude.equals(name)) {
- return true;
- }
- }
- return false;
- }
-
private List<Path> concat(List<Path> l1, List<Path> l2) {
return Stream.concat(l1.stream(), l2.stream()).collect(Collectors.toList());
}
@@ -1142,26 +1151,28 @@ public class PrepareCatalogMojo extends AbstractMojo {
return byName.values().stream().flatMap(l -> l.stream().skip(1)).collect(Collectors.toCollection(TreeSet::new));
}
- private Path getComponentPath(Path dir) {
+ private List<Path> getComponentPath(Path dir) {
switch (dir.getFileName().toString()) {
case "camel-as2":
- return dir.resolve("camel-as2-component");
+ return Collections.singletonList(dir.resolve("camel-as2-component"));
case "camel-salesforce":
- return dir.resolve("camel-salesforce-component");
+ return Collections.singletonList(dir.resolve("camel-salesforce-component"));
case "camel-olingo2":
- return dir.resolve("camel-olingo2-component");
+ return Collections.singletonList(dir.resolve("camel-olingo2-component"));
case "camel-olingo4":
- return dir.resolve("camel-olingo4-component");
+ return Collections.singletonList(dir.resolve("camel-olingo4-component"));
case "camel-box":
- return dir.resolve("camel-box-component");
+ return Collections.singletonList(dir.resolve("camel-box-component"));
case "camel-servicenow":
- return dir.resolve("camel-servicenow-component");
+ return Collections.singletonList(dir.resolve("camel-servicenow-component"));
case "camel-fhir":
- return dir.resolve("camel-fhir-component");
+ return Collections.singletonList(dir.resolve("camel-fhir-component"));
case "camel-vertx-kafka":
- return dir.resolve("camel-vertx-kafka-component");
+ return Collections.singletonList(dir.resolve("camel-vertx-kafka-component"));
+ case "camel-infinispan":
+ return Arrays.asList(dir.resolve("camel-infinispan"), dir.resolve("camel-infinispan-embedded"));
default:
- return dir;
+ return Collections.singletonList(dir);
}
}