2.4. キャッシュマネージャーの設定 Bean
次の設定 Bean を使用して Cache Manager をカスタマイズします。
-
InfinispanRemoteConfigurer
-
Configuration
-
InfinispanRemoteCacheCustomizer
注記
InfinispanRemoteConfigurer
Bean は 1 つしか作成できません。ただし、他の Bean を使用して複数の設定を作成できます。
InfinispanRemoteConfigurer Bean
@Bean public InfinispanRemoteConfigurer infinispanRemoteConfigurer() { return () -> new ConfigurationBuilder() .addServer() .host("127.0.0.1") .port(12345) .build(); }
設定 Bean
@Bean public org.infinispan.client.hotrod.configuration.Configuration customConfiguration() { new ConfigurationBuilder() .addServer() .host("127.0.0.1") .port(12345) .build(); }
InfinispanRemoteCacheCustomizer Bean
@Bean public InfinispanRemoteCacheCustomizer customizer() { return b -> b.tcpKeepAlive(false); }
ヒント
@Ordered
アノテーションを使用して、カスタマイザーを特定の順序で適用します。