[ 
https://issues.apache.org/jira/browse/CAMEL-15167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17130115#comment-17130115
 ] 

Claus Ibsen commented on CAMEL-15167:
-------------------------------------

You can configure the provider on the component like this

        JCacheComponent jcache = context.getComponent("jcache", 
JCacheComponent.class);
        
jcache.setCachingProvider("com.hazelcast.cache.impl.HazelcastServerCachingProvider");

Otherwise it uses service-loaded and then it may finder either a client or 
server provided on the classpath (depending on ordering) and chose the wrong 
one. And in hazelcast you can only control this using those JVM system 
properties.

They dont have a hazelcast-server or hazelcast-client JAR anyone in 4.x where 
you can use to separate them :(

> Clarify use of sysprops for HazelcastCachingProvider
> ----------------------------------------------------
>
>                 Key: CAMEL-15167
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15167
>             Project: Camel
>          Issue Type: Task
>          Components: camel-jcache
>    Affects Versions: 3.3.0
>            Reporter: Thomas Diesler
>            Priority: Major
>             Fix For: 3.4.0
>
>
> According to [this 
> commit|https://github.com/apache/camel/commit/06c48d08#diff-f51701c69af2367205f70cc85b4eea7bR120]
>  it is necessary to set some system properties to get the 
> HazelcastCachingProvider to work.
> {code}
>                     <systemProperties>
>                         <property>
>                             <name>hazelcast.named.jcache.instance</name>
>                             <value>false</value>
>                         </property>
>                         <property>
>                             <name>hazelcast.jcache.provider.type</name>
>                             <value>server</value>
>                         </property>
>                     </systemProperties>
> {code}
> Is this really the propper way to configure this cache provider (i.e. global 
> sysprops instead of component/endpoint props)?
> A required migration is not documented 
> [here|https://camel.apache.org/manual/latest/camel-3x-upgrade-guide-3_3.html]
> A camel route like this does not start any more ...
> {code}
>         try (CamelContext camelctx = new DefaultCamelContext()) {
>               
>             camelctx.addRoutes(new RouteBuilder() {
>                 public void configure() {
>                     
> from("jcache://test-cacheA?cachingProvider=com.hazelcast.cache.HazelcastCachingProvider")
>                     .to("mock:resultA");
>                 }
>             });
>             
>             // Just ensure we can start up without any class loading issues
>             camelctx.start();
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to