4.3. キャッシュマネージャーの設定 Bean

次の設定 Bean を使用してキャッシュマネージャーをカスタマイズします。

  • InfinispanRemoteConfigurer
  • 設定
  • InfinispanRemoteCacheCustomizer

    注記

    InfinispanRemoteConfigurerBean は 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 アノテーションを使用して、カスタマイザーを特定の順序で適用します。