The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Infinispanクライアントエクステンションリファレンスガイド

Infinispanは、分散型のインメモリキー/バリューストアで、Quarkusアプリケーションに高度に設定可能で独立して拡張可能なデータレイヤーを提供します。このエクステンションでは、Quarkus上で動作するアプリケーションとリモートのInfinispanクラスターを接続するクライアント機能が提供されます。Infinispanを使い始めるには、以下をお勧めします:

  1. 入門チュートリアル に沿う(5分)。

  2. リモートキャッシュ シンプルコードチュートリアル を実行する。

詳しくは、Infinispanのドキュメント をご覧ください。

インストール

Quarkusプロジェクトのベースディレクトリで以下のコマンドを実行し、 infinispan-client エクステンションを追加します:

コマンドラインインタフェース
quarkus extension add infinispan-client
Maven
./mvnw quarkus:add-extension -Dextensions='infinispan-client'
Gradle
./gradlew addExtension --extensions='infinispan-client'

このコマンドは、ビルドファイルに以下の依存関係を追加します:

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-infinispan-client</artifactId>
</dependency>
build.gradle
implementation 'io.quarkus:quarkus-infinispan-client'
annotationProcessor 'org.infinispan.protostream:protostream-processor:{infinispan-protostream-version}' (1)
1 アノテーションベースのシリアライゼーションでファイル生成を有効にするため、Gradleビルドで必須

Infinispanへの接続

サーバーの実行

実行中のInfinispan Serverのインスタンスが少なくとも1つ必要です。

開発モード

If you are running a Docker instance, you can use Infinispan Dev Services and connect without configuration.

Dockerを使用して自分でサーバーを実行したい場合は、Infinispan Serverを実行するための5分間の Infinispan入門 チュートリアルをチェックしてください。

また、${infinispan.version} Server ベアメタルディストリビューションを ダウンロード することが出来、ディストリビューションフォルダで以下のコマンドを実行します。

$ ./bin/server.sh

Infinispan Serverは デフォルトで認証とセキュリティ 認可を有効にしている ので、権限を持つユーザーを作成する必要があります。

  • Infinispan Server イメージ を実行する場合は、 USER="admin"PASS="password" パラメータを渡します。

  • ベアメタルディストリビューション を実行する場合は、次のようにコマンドラインインターフェイス(CLI)を使用します:

    $ ./bin/cli.sh user create admin -p password
プロダクションモード

Kubernetesでは、 Infinispan Operator をお勧めします。さらに、 Cross Site Replication のチュートリアルをご覧ください。ここでは、docker compose(ローカル開発用)とOperatorを使用して、2つの別々のInfinispanクラスターを実行する方法を学びます。

接続の設定

Infinispan Serverを実行している場合、 src/main/resources ディレクトリの application.properties ファイルに接続するための以下のプロパティを追加します。

quarkus.infinispan-client.hosts=localhost:11222 (1)

quarkus.infinispan-client.username=admin (2)
quarkus.infinispan-client.password=password (3)
1 Infinispanサーバーのアドレスリストをカンマ区切りで設定します。
2 認証ユーザー名を設定
3 認証パスワードを設定

または、単一の接続プロパティを指定することで、uri接続を使用することもできます。

quarkus.infinispan-client.uri=hotrod://admin:password@localhost:11222 (1)
1 InfinispanのURI接続を設定します。以下のプロパティは無視されます: hosts、username、password。

Infinispan Dev Services を使用してサーバーを実行し、設定なしで接続します。

Client intelligence

Infinispan client uses intelligence mechanisms to efficiently send requests to Infinispan Server clusters. By default, the HASH_DISTRIBUTION_AWARE intelligence mechanism is enabled. However, locally with Docker for Mac, you might experience connectivity issues. In this case, configure the client intelligence to BASIC.

Learn more in the Infinispan documentation.

quarkus.infinispan-client.client-intelligence=BASIC (1)
1 Docker for Mac workaround.

Don’t use BASIC in production environments by default, performance might be impacted.

Configuring backup clusters in Cross-Site Replication

In High Availability production deployments, it is common to have multiple Infinispan Clusters that are distributed across various Data Centers worldwide. Infinispan offers the capability to connect these clusters and configure backups between them. This enables seamless switching between clusters through both automated and manual methods using a single connection. To achieve this, it is necessary to configure the client to direct to the backup clusters.

quarkus.infinispan-client.hosts=host1:11222,host2:3122 (1)
quarkus.infinispan-client.username=admin
quarkus.infinispan-client.password=password
quarkus.infinispan-client.backup-cluster.nyc-site.hosts=nyc1:11222,nyc2:21222,nyc3:31222 (2)
quarkus.infinispan-client.backup-cluster.nyc-site.client-intelligence=BASIC (3)
quarkus.infinispan-client.backup-cluster.lon-site.hosts=lon1:11222,lon2:21222,lon3:31222 (4)
1 Sets Infinispan Server address list, separated with commas. This is the default cluster.
2 Configures a backup site 'nyc-site' with the provided address list
3 Configures a backup site 'nyc-site' with the provided client intelligence
4 Configures an additional backup site 'lon-site' with the provided address list

Based on the provided configuration, in the event of the default cluster becoming unavailable, the client will seamlessly transition to one of the accessible backup clusters. Additionally, there is also the option to manually switch the client to an alternate cluster:

@ApplicationScoped
public class InfinispanExample {
    @Inject
    RemoteCacheManager cacheManager;

    public void doSomething() {
       cacheManager.switchToCluster("nyc-site"); (1)
       cacheManager.switchToCluster("lon-site"); (2)
       cacheManager.switchToDefaultCluster(); (3)
    }
}
1 The client connects to the 'nyc-site'.
2 The client connects to the 'lon-site'.
3 The client connects to the default site.

By default, Protobuf Schemas will also be uploaded to the backup clusters. However, it might be required to handle the registration manually as a schema may evolve over time when used in production, so you can disable this from occurring in each backup site by configuring the quarkus.infinispan-client.backup-cluster.YOUR_SITE_NAME.use-schema-registration to false. The value of this property will be ignored if the use-schema-registration global property is false.

Cross-site replication is a powerful feature offered by Infinispan that facilitates data backup between clusters situated in geographically diverse data centers, even spanning across various cloud providers. Learn more in the Infinispan documentation.

デフォルト接続と名前付き接続

This extension lets you configure a default Infinispan client connections and named ones. Named connections are essential to connect to multiple Infinispan clusters.

The default connection is configured using the quarkus.infinispan-client.* properties as seen above. When using the default connection, you can inject using a plain @Inject:

Named clients are configured using the quarkus.infinispan-client.<name>.* properties:

quarkus.infinispan-client.site-lon.hosts=localhost:11222
quarkus.infinispan-client.site-lon.username=admin
quarkus.infinispan-client.site-lon.password=password

quarkus.infinispan-client.site-nyc.hosts=localhost:31222
quarkus.infinispan-client.site-nyc.username=admin
quarkus.infinispan-client.site-nyc.password=password

Use the @InfinispanClientName qualifier with dependency injection:

@ApplicationScoped
public class InfinispanExample {
    @Inject
    @InfinispanClientName("site-lon")
    RemoteCacheManager rcmLon;

    @Inject
    @InfinispanClientName("site-nyc")
    RemoteCacheManager rmcNyc;
}

Infinispan ヘルス・チェック

quarkus-smallrye-health エクステンションを使用している場合、Infinispan クライアントエクステンションは、接続を検証するためのReadinessヘルスチェックを自動的に追加します。

アプリケーションの /q/health/ready エンドポイントにアクセスすると、サーバー接続と利用可能なキャッシュの情報が表示されます。

この動作は、プロパティ quarkus.infinispan-client.health.enabled で無効にすることができます。

OpenTelemetryでトレース

InfinispanはOpenTelemetryによるサーバーのインスツルメンテーションをサポートしています。 quarkus-opentelemetry エクステンションを追加することで、Infinispan クライアントからサーバーにトレースが伝搬されます。この動作は、プロパティ quarkus.infinispan-client.tracing.propagation.enabled で無効にすることが出来ます。

クライアントからキャッシュを作成

クライアントからキャッシュにアクセスする際、Infinispan Server内にキャッシュが存在せず、初回アクセス時にキャッシュを作成したい場合は、以下のいずれかのプロパティを使用します。

quarkus.infinispan-client.cache.magazine.configuration=<distributed-cache><encoding media-type="application/x-protostream"/></distributed-cache> (1)
quarkus.infinispan-client.cache.books.configuration-resource=booksDistributedCache.json (2)
quarkus.infinispan-client.cache.authors.configuration-uri=/file/authorsIndexedCache.yaml (3)
1 'magazine' のxmlでの設定(yaml、jsonもサポートされています)
2 'books' キャッシュの設定を含む resources フォルダー下のファイル名
3 A provided file URI. The file URI can also be a file under resources

If configuration-resource, configuration and configuration-uri are configured for the same cache with the same Quarkus profile, configuration-uri gets the highest preference, over configuration-resource and configuration. configuration-resource gets preference over configuration.

The configuration-resource is build time property and the file will be included in the native build automatically. configuration-uri can also point to a file under the resources folder. However, the file won’t be automatically included in the native executable, unless you configure the property quarkus.native.resources.includes.

キャッシュ設定は、XML、JSON、または YAML で提供することができます。Infinispan コンソールおよびキャッシュ設定ウィザードを使用して、Infinispan キャッシュの詳細について学び、ガイド付きの設定を作成してください。

特定のキャッシュについて何も設定されていない場合、以下の基本設定で作成されます。

XML
<distributed-cache>
    <encoding media-type="application/x-protostream"/>
</distributed-cache>
JSON
{
    "distributed-cache": {
        "encoding": {
            "media-type": "application/x-protostream"
        }
    }
}
YAML
distributedCache:
  encoding:
    mediaType: "application/x-protostream"

認証メカニズム

Infinispanクライアントでは、以下の認証メカニズムを使用することができます:

  • DIGEST-MD5

  • PLAIN(TLS暗号化との併用のみ推奨)

  • EXTERNAL

SCRAMやGSSAPIなどの他の認証メカニズムは、Infinispanクライアントではまだ検証されていません。

認証の設定についての詳しい情報は Hot Rod Endpoint Authentication Mechanisms に存在します。

Dependency Injectionを使用する場合は、 hotrod-client.properties ファイルで認証の設定を行う必要があります。

シリアライゼーション(Key Value型のサポート)

デフォルトでは、クライアントは以下の型のキーとバリューをサポートします: byte[]、プリミティブラッパー(例: Integer、Long、Doubleなど)、String、Date、Instant。ユーザ型については、ここで詳しく説明される追加のステップが必要です。以下のようなユーザクラスがあるとします:

Author.java
public class Author {
   private final String name;
   private final String surname;

   public Author(String name, String surname) {
      this.name = Objects.requireNonNull(name);
      this.surname = Objects.requireNonNull(surname);
   }
   // Getter/Setter/equals/hashCode/toString omitted
}
Book.java
public class Book {
   private final String title;
   private final String description;
   private final int publicationYear;
   private final Set<Author> authors;
   private final BigDecimal price;

   public Book(String title, String description, int publicationYear, Set<Author> authors, BigDecimal price) {
      this.title = Objects.requireNonNull(title);
      this.description = Objects.requireNonNull(description);
      this.publicationYear = publicationYear;
      this.authors = Objects.requireNonNull(authors);
      this.price = price;
   }
   // Getter/Setter/equals/hashCode/toString omitted
}

ユーザ型のシリアライズは、https://github.com/infinispan/protostream[Protostream]と呼ばれるprotobufをベースにしたライブラリを使用します。

Infinispanのキャッシュは、さまざまなエンコーディングでキーと値を保存できますが、 プロトコル・バッファ(Protobuf) の使用を推奨します。

詳しくは、 Cache Encoding and Marshalling ガイドをご覧ください。

アノテーションに基づくシリアライゼーション

これは、ユーザクラスに protostream アノテーションを追加することで自動的に行えます。加えて、初期化子がアノテーションされたインターフェースが1つ必要です。これは、サポートするクラスの生成方法を制御します。

ここでは、先述のクラスをどのように変更するかの例を示します:

Author.java
@Proto (1)
public record Author(String name, String surname) { (2)
}
1 Since Protostream 5.0, a single annotation is needed to generate a default mapping
2 Since Protostream 5.0, records are supported
Type.java
@Proto
public enum Type { (1)
    FANTASY,
    PROGRAMMING
}
1 Enums are supported
Book.java
@Proto
@Indexed (1)
public record Book(@Text String title, (2)
                   @Keyword(projectable = true, sortable = true, normalizer = "lowercase", indexNullAs = "unnamed", norms = false) (3)
                   String description,
                   int publicationYear,
                   Set<Author> authors, (4)
                   Type bookType,
                   BigDecimal price) { (5)
}
1 Indicates that the entity will be indexed. Necessary to perform distributed full-text query operations.
2 Indicates the title should be indexed as text
3 Indicates the description field field should be indexed as a Keyword.
4 Collections are supported
5 Protostreamは、BigDecimal のように、一般的に使用される型に対するデフォルトの Protobuf マッパーを提供します。これらは org.infinispan.protostream.types パッケージに含まれます。

必要なのは、設定を指定する為のアノテーションを付与した非常にシンプルな GeneratedSchema インターフェイスだけです。

BooksSchema.java
import org.infinispan.protostream.GeneratedSchema;
import org.infinispan.protostream.annotations.ProtoSchema;
import org.infinispan.protostream.types.java.math.BigDecimalAdapter;

@ProtoSchema(includeClasses = { Book.class, Author.class, BigDecimalAdapter.class }, schemaPackageName = "book_sample")
interface BookStoreSchema extends GeneratedSchema {
}

You can use the basePackages property to scan a full package containing your classes. You can override the default marshalling by using the @Protofield annotation.

そこで今回は、含まれるクラスのマーシャラーとスキーマを自動生成して、スキーマパッケージに自動で配置します。パッケージは用意する必要はありませんが、Infinispan検索機能を利用する場合は生成されたパッケージを知っておく必要があります。

In Quarkus the schemaFileName and schemaFilePath attributes should NOT be set on the ProtoSchema annotation. Setting either attributes causes native runtime errors.

カスタムシリアライゼーション

前の方法は、ユーザが自分のクラスにアノテーションを付けられる場合のために提案されています。残念ながら、ユーザはキャッシュに入れるすべてのクラスにアノテーションを付けることができないかもしれません。このような場合はスキーマを定義し、自分で独自のマーシャラを作成しなければなりません。

Protobuf スキーマ

2つの方法のいずれかでprotobufスキーマを提供できます。

  1. Proto ファイル
    プロジェクトの META-INF ディレクトリに .proto ファイルを置くことができます。これらのファイルは初期化時に自動的にピックアップされます。

    library.proto
    package book_sample;
    
    message Book {
      required string title = 1;
      required string description = 2;
      required int32 publicationYear = 3; // no native Date type available in Protobuf
      repeated Author authors = 4;
      requited double price = 5; // no native BigDecimal type available in Protobuf
    }
    
    message Author {
      required string name = 1;
      required string surname = 2;
    }
  2. コード内
    または、 org.infinispan.protostream.FileDescriptorSource 型のプロデュースされた Bean を定義することで、ユーザーコード内で直接プロトスキーマを定義することもできます。

       @Produces
       FileDescriptorSource bookProtoDefinition() {
          return FileDescriptorSource.fromString("library.proto", "package book_sample;\n" +
                "\n" +
                "message Book {\n" +
                "  required string title = 1;\n" +
                "  required string description = 2;\n" +
                "  required int32 publicationYear = 3; // no native Date type available in Protobuf\n" +
                "\n" +
                "  repeated Author authors = 4;\n" +
                "\n" +
                "  required double price = 5; // no native BigDecimal type available in Protobuf\n" +
                "}\n" +
                "\n" +
                "message Author {\n" +
                "  required string name = 1;\n" +
                "  required string surname = 2;\n" +
                "}");
       }
ユーザマーシャラ

最後にすべきことは、proto スキーマで定義された各ユーザクラスの org.infinispan.protostream.MessageMarshaller 実装を提供することです。このクラスは、上記のコードベースの proto スキーマの定義と同様の方法で @Produces を介して提供されます。

こちらは、Author と Book クラスのマーシャラクラスです。

型名は <protobuf package>.<protobuf message> と正確に一致している必要があります!
AuthorMarshaller.java
public class AuthorMarshaller implements MessageMarshaller<Author> {

   @Override
   public String getTypeName() {
      return "book_sample.Author";
   }

   @Override
   public Class<? extends Author> getJavaClass() {
      return Author.class;
   }

   @Override
   public void writeTo(ProtoStreamWriter writer, Author author) throws IOException {
      writer.writeString("name", author.getName());
      writer.writeString("surname", author.getSurname());
   }

   @Override
   public Author readFrom(ProtoStreamReader reader) throws IOException {
      String name = reader.readString("name");
      String surname = reader.readString("surname");
      return new Author(name, surname);
   }
}
BookMarshaller.java
public class BookMarshaller implements MessageMarshaller<Book> {

   @Override
   public String getTypeName() {
      return "book_sample.Book";
   }

   @Override
   public Class<? extends Book> getJavaClass() {
      return Book.class;
   }

   @Override
   public void writeTo(ProtoStreamWriter writer, Book book) throws IOException {
      writer.writeString("title", book.getTitle());
      writer.writeString("description", book.getDescription());
      writer.writeInt("publicationYear", book.getPublicationYear());
      writer.writeCollection("authors", book.getAuthors(), Author.class);
      writer.writeDouble("price", book.getPrice().doubleValue());
   }

   @Override
   public Book readFrom(ProtoStreamReader reader) throws IOException {
      String title = reader.readString("title");
      String description = reader.readString("description");
      int publicationYear = reader.readInt("publicationYear");
      Set<Author> authors = reader.readCollection("authors", new HashSet<>(), Author.class);
      BigDecimal price = BigDecimal.valueOf(reader.readDouble("price"));
      return new Book(title, description, publicationYear, authors, price);
   }
}

そして、以下のように定義してマーシャラを渡します:

   @Produces
   MessageMarshaller authorMarshaller() {
      return new AuthorMarshaller();
   }

   @Produces
   MessageMarshaller bookMarshaller() {
      return new BookMarshaller();
   }
上記のように生成されたMarshallerメソッドは、型なしで MessageMarshaller を返さなければなりません。さもないと、それが見つかりません。

依存性注入

上で見たように、私たちはユーザーが Marshaller のコンフィギュレーションをインジェクションすることをサポートしています。Infinispan クライアントエクステンションでは、 RemoteCacheManagerRemoteCache オブジェクトへのインジェクションを提供し、その逆を行うことができます。 グローバルな RemoteCacheManager が一つあり、上記のセクションで設定したすべてのコンフィギュレーションパラメータを受け取ります。

これらのコンポーネントをインジェクトするのは非常に簡単です。必要なのは、フィールド、コンストラクタ、またはメソッドに @Inject アノテーションを追加することだけです。以下のコードでは、フィールドとコンストラクタのインジェクションを利用しています。

SomeClass.java
    @Inject
    SomeClass(RemoteCacheManager remoteCacheManager) {
       this.remoteCacheManager = remoteCacheManager;
    }

    @Inject
    @Remote("myCache")
    RemoteCache<String, Book> cache;

    RemoteCacheManager remoteCacheManager;

If you notice the RemoteCache declaration has an additional annotation named Remote. This is a qualifier annotation allowing you to specify which named cache that will be injected. This annotation is not required and if it is not supplied, the default cache will be injected. The RemoteCacheManager and RemoteCache bean scope is @ApplicationScoped.

デフォルト以外の接続の場合は、@InfinispanClientName 修飾子と @Remote 修飾子を組み合わせてください。

SomeClass.java
    @Inject
    @InfinispanClientName("lon-site")
    @Remote("books")
    RemoteCache<String, Book> lonBooks;

    @Inject
    @InfinispanClientName("nyc-site")
    @Remote("books")
    RemoteCache<String, Book> nycBooks;
その他の型は注入のためにサポートされている場合がありますが、詳細については他のセクションを参照してください

モックサポート

Quarkus supports the use of mock objects using two different approaches. You can either use CDI alternatives to mock out a bean for all test classes, or use QuarkusMock to mock out beans on a per test basis. Check the Getting started with testing guide for more information.

RemoteCacheManager and RemoteCache can be mocked.

BookService.java
@ApplicationScoped
public class BookService {

   @Inject
   @Remote("books")
   RemoteCache<String, Book> books; (1)

   public String getBookDescriptionById(String id) {
      Book book = books.get(id);
      if (book == null) {
         return "default";
      }

      return book.getDescription();
   }
}
1 Use dependency injection to connect to the books cache

In the test class, the RemoteCache can be mocked.

BookServiceTest.java
@QuarkusTest
public class BookServiceTest {

    @Inject
    BookService bookService;

    @InjectMock (1)
    @Remote("books")
    RemoteCache<String, Book> bookRemoteCache;

    @Test
    public void mockRemoteCache() {
        Mockito.when(bookRemoteCache.get("harry_potter")).thenReturn(new Book(... "Best saga ever");(2)

        Assertions.assertThat(bookService.getBookDescriptionById("harry_potter")).isEqualTo("Best saga ever");(3)
    }
}
1 Inject a mock instead of the RemoteCache bean
2 Use Mockito to mock the call of the RemoteCache
3 Assert the service call

InfinispanサーバへのProtobufスキーマの登録

クエリを実行したり、 Protobuf から JSON のような他のメディアタイプに変換するには、生成された Protobuf スキーマを Infinispan Server に登録する必要があります。

Infinispan Consoleにログインし、 http://SERVER_HOST:SERVER_PORT(例: http://localhost:11222 )の Schemas タブに存在するスキーマを確認することができます。

Infinispan Dev Servicesガイド を確認し、Infinispan Dev Servicesサーバーに接続して下さい。

デフォルトでは、この方法で生成されたProtobufスキーマは、クライアントが最初に接続したときに、このエクステンションによって登録されます。 しかし、実運用で使用しているとスキーマが時間の経過とともに進化する可能性があるため、手動で登録を処理する必要があるかもしれません。そのため、`quarkus.infinispan-client.use-schema-registration`を`false`に設定して、この現象を無効にすることができます。

スキーマを手動で設定するには、Kubernetes デプロイメント用の Infinispan Operator 、Infinispan Console、 REST API または Hot Rod Java Client を使用してください。

アノテーションを利用したキャッシング

Infinispan Client エクステンションは、Infinispan でのキャッシュ能力を有効にするために CDI 管理 Bean で使用できるアノテーションのセットを提供します。

プライベートメソッドではアノテーションのキャッシュは許可されていません。package-private (明示的な修飾子を持たない) を含む他のアクセス修飾子では問題なく動作します。

@CacheResult

可能な限り、メソッドボディを実行せずにキャッシュからメソッドの結果を読み込みます。

@CacheResult でアノテーションされたメソッドが呼び出されると、Quarkus はメソッドの引数をキャッシュキーとして使用し、そのメソッドがすでに呼び出されているかどうかをキャッシュでチェックします。複数のパラメータを持つメソッドは許可されません。複合キーの場合は、複数の値を保持するProtobufスキーマを定義します。キャッシュ内に値が見つかった場合、その値を返し、アノテーションされたメソッドは実際に実行されることはありません。値が見つからない場合、アノテーションされたメソッドが呼び出され、返された値は計算されたキーを使用してキャッシュに格納されます。このアノテーションは、 void を返すメソッドには使用できません。

Infinispan Client エクステンションは、Quarkus-Cache エクステンションとは異なり、まだ null 値をキャッシュすることができません。

@CacheInvalidate

キャッシュからエントリーを削除します。

@CacheInvalidate でアノテーションされたメソッドが呼び出されると、 Infinispan はメソッドの引数をキャッシュキーとして使用し、 キャッシュから既存のエントリを削除しようとします。キーがキャッシュエントリーを特定できない場合、何も起こりません。

@CacheInvalidateAll

@CacheInvalidateAll でアノテーションされたメソッドが呼び出されると、Infinispan はキャッシュからすべてのエントリを削除します。

クエリ

Infinispan クライアントは、上記の ProtoStreamMarshaller が設定されている限り、インデックス付と非インデックス付の両方の検索をサポートしています。これにより、ユーザはプロトスキーマのプロパティに基づいてクエリできます。パフォーマンス上の理由から、インデックス付クエリが望ましいです

XML
<distributed-cache name="books" statistics="true">
    <!-- other configuration -->
	<indexing enabled="true" storage="filesystem" startup-mode="PURGE">
		<indexed-entities>
			<indexed-entity>book_sample.Book</indexed-entity>
		</indexed-entities>
	</indexing>
</distributed-cache>
JSON
{
  "books": {
    "distributed-cache": {
      ...
      "indexing": {
        "enabled": true,
        "storage": "filesystem",
        "startupMode": "PURGE",
        "indexed-entities": [
          "book_sample.Book"
        ]
      }
    }
  }
}
YAML
distributedCache:
  # other configuration
  indexing:
    enabled: "true"
    storage: "filesystem"
    startupMode: "PURGE"
    indexedEntities:
      - "book_sample.Book"

Query は、 ProtoStreamMarshaller の設定時に設定できるproto定義に基づいて構築されます。上記のいずれのシリアライズ方法でも、起動時に自動的にスキーマをサーバに登録し、リモートの Infinispan サーバーに保存されているオブジェクトを問い合せる機能を自動的に得られます。

Book.java
@Indexed (1)
public class Book {

    @ProtoFactory
    public Book(String title, String description, int publicationYear, Set<Author> authors) {
      ...
    }

    @ProtoField(number = 1)
    @Text (2)
    public String getTitle() {
        return title;
    }

    @ProtoField(number = 2)
    @Keyword(projectable = true, sortable = true, normalizer = "lowercase", indexNullAs = "unnamed", norms = false) (3)
    public String getDescription() {
        return description;
    }
    ...
1 @Indexed アノテーションは、POJOをインデックス可能にします
2 @Basic アノテーションは、インデックス付きフィールドに対して特別な変換を行わずに使用されます。
3 @Keyword アノテーションは、テキストフィールドにnormalizer を適用するために使用します。

Quarkus Infinispanクライアントエクステンションでは、Query DSLまたはIckle Query 言語のいずれかを使用できます。

Query.java
@Inject
@Remote("books")
RemoteCache<String, Book> booksCache; (1)

Query<Book> query = booksCache.query("from book_sample.Book b where b.authors.name like '%" + name + "%'"); (2)
List<Book> list = query.execute().list();
1 Inject the books cache
2 Perform a full text query on books author name
詳細は Infinispan のドキュメントの クエリ を参照してください。

Prior to Quarkus 3.9 and the Infinispan 15 integration, queries were executed by calling the following code: .Query.java

QueryFactory queryFactory = Search.getQueryFactory(booksCache); (1)
Query query = queryFactory.create("from book_sample.Book");
List<Book> list = query.execute().list();
1 Breaking change in 3.9

This code won’t work anymore since RemoteCache is now an @ApplicationScoped proxy bean. Search.getQueryFactory will raise a ClassCastException. Remove the unecessary indirection by using the query method in the RemoteCache API as follows.

Query<Book> query = booksCache.<Book>query("from book_sample.Book");
List<Book> list = query.execute().list();

カウンター

Infinispanにはカウンターという概念もあり、Quarkus Infinispanのクライアントはそれらもサポートしています。

Quarkus Infinispan クライアントエクステンションでは、 CounterManager を直接依存性注入することができます。フィールド、コンストラクタ、メソッドにアノテーションを付けるだけで、簡単に取得できます。そして、通常と同じようにカウンタを使用することができます。

@Inject
CounterManager counterManager;

詳細は Infinispan のドキュメント クラスタカウンター を参照してください。

ニアキャッシング

ニアキャッシングはデフォルトでは無効ですが、次のプロパティを設定することで、キャッシュ単位で有効にすることができます:

quarkus.infinispan-client.cache.books.near-cache-mode=INVALIDATED (1)
quarkus.infinispan-client.cache.books.near-cache-max-entries=200 (2)
quarkus.infinispan-client.cache.books.near-cache-use-bloom-filter=true (3)
1 モードを INVALIDATED に設定して 'books' キャッシュのニアキャッシュを有効にします
2 'books' キャッシュのエビクションが発生するまでにニアキャッシュが保持できる最大エントリ数を設定します
3 'books' キャッシュのブルームフィルタを有効にします

境界付けられたニアキャッシング

キャッシュに格納できるエントリーの最大数を指定し、常に境界付けられたニアキャッシュを使用する必要があります。

ブルームフィルタ

無効化メッセージの総数を減らすことで書き込み操作のパフォーマンスを最適化する必要がある場合はブルームフィルタを有効にします。ブルームフィルタは Infinispan Server に常駐し、クライアントが要求したエントリを追跡します。 これらは、境界付けられていないニアキャッシュでは使用できません。ブルームフィルタを有効にする際には、エントリの最大数を定義する必要があります。

暗号化

この時点での暗号化には、作業を開始するための追加のステップが必要です。

The first step is to configure the application.properties file to point to your truststore and/or keystore. This is further detailed here.

Infinispanクライアント拡張は、デフォルトでSSL/TLSを有効にします。これについては Using SSL With Native Executables に詳しく書かれています。

SSL Host Name Validation

To prevent MITM attacks, when SSL is enabled, SSL host name validation is enabled by default in Infinispan. In this case, configuring the SNI host name is mandatory to start the client.

quarkus.infinispan-client.sni-host-name=localhost (1)
1 Sets the SNI host name

This behaviour can be changed by disabling the validation.

quarkus.infinispan-client.ssl-host-name-validation=false (1)
1 Disables ssl host name validation

追加機能

Infinispanクライアントには、ここに記載されていない追加機能があります。これは、この機能がQuarkus環境でテストされていないことを意味し、それらは動作するかもしれませんし、動作しないかもしれません。これらの追加機能が必要な場合は、ぜひお知らせください。

Infinispanの開発サービス

開発モードまたはテストでinfinispan-clientエクステンションを使用すると、Quarkusは自動的にInfinispanサーバーを起動し、アプリケーションを設定します。

Infinispanの開発サービスの有効化/無効化

詳しくは、 Infinispan Dev Servicesのガイド をご覧ください。

共有サーバー

開発モードで複数のアプリケーションを実行している場合、QuarkusはInfinispanブローカーを共有します。 Infinispanの開発サービスは、 dev モードで実行されている複数のQuarkusアプリケーションが1つのブローカーを共有するための service discovery メカニズムを実装しています。

Infinispanの開発サービス は、コンテナを識別するために使用される quarkus-dev-service-infinispan ラベルでコンテナを起動します。

複数の(共有)Infinispanサーバーが必要な場合は、 quarkus.infinispan-client.devservices.service-name 属性を設定して、サーバー名を指定することが可能です。 同じ値を持つコンテナを探すか、見つからない場合は新しいコンテナを起動します。 デフォルトのサービス名は infinispan です。

共有は、開発モードではデフォルトで有効ですが、テストモードでは無効になります。 共有は quarkus.infinispan-client.devservices.shared=false で無効にすることができます。

ポートの設定

デフォルトでは、Infinispanの開発サービスはランダムなポートを選択し、アプリケーションを設定します。 ポートは quarkus.infinispan-client.devservices.port プロパティを設定することによって定義することができます。

テストヘルパー

ユニットテスト用に Infinispan Server を起動するために、Quarkus は Infinispan Server Test Container に依存する QuarkusTestResourceLifecycleManager を1つ提供します。

  • io.quarkus.test.infinispan.client.InfinispanTestResource は、ポート 11222 で、ユーザー 'admin' とパスワード 'password' で単一のインスタンスを起動します。

これらを使用するには、 io.quarkus:quarkus-test-infinispan-client の依存関係を pom.xml に追加する必要があります。

QuarkusTestResourceLifecycleManager の使用方法の詳細については、 Quarkus テストリソース を参照してください。

設定リファレンス

ビルド時に固定される構成プロパティ - 他のすべての構成プロパティは実行時にオーバーライド可能

Configuration property

デフォルト

Sets the marshallerClass. Default is ProtoStreamMarshaller

Environment variable: QUARKUS_INFINISPAN_CLIENT_MARSHALLER_CLASS

Show more

string

If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present.

When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode and when Docker is running.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_ENABLED

Show more

boolean

true

Optional fixed port the dev service will listen to.

If not defined, the port will be chosen randomly.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_PORT

Show more

int

Indicates if the Infinispan server managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Infinispan starts a new container.

The discovery uses the quarkus-dev-service-infinispan label. The value is configured using the service-name property.

Container sharing is only used in dev mode.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_SHARED

Show more

boolean

true

The value of the quarkus-dev-service-infinispan label attached to the started container. This property is used when shared is set to true. In this case, before starting a container, Dev Services for Infinispan looks for a container with the quarkus-dev-service-infinispan label set to the configured value. If found, it will use this container instead of starting a new one. Otherwise, it starts a new container with the quarkus-dev-service-infinispan label set to the specified value.

This property is used when you need multiple shared Infinispan servers.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_SERVICE_NAME

Show more

string

infinispan

The image to use. Note that only official Infinispan images are supported.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_IMAGE_NAME

Show more

string

List of the artifacts to automatically download and add to the Infinispan server libraries.

For example a Maven coordinate (org.postgresql:postgresql:42.3.1) or a dependency location url.

If an invalid value is passed, the Infinispan server will throw an error when trying to start.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_ARTIFACTS

Show more

list of string

Add a site name to start the Infinispan Server Container with Cross Site Replication enabled (ex. lon). Cross Site Replication is the capability to connect two separate Infinispan Server Clusters that might run in different Data Centers, and configure backup caches to copy the data across the clusters with active-active or active-passive replication. See more about Cross Site Replication in the Infinispan Documentation https://infinispan.org/docs/stable/titles/xsite/xsite.html Configure mcast-port to avoid forming a cluster with any other running Infinispan Server container.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_SITE

Show more

string

If you are running an Infinispan Server already in docker, if the containers use the same mcastPort they will form a cluster. Set a different mcastPort to create a separate cluster in Docker (e. 46656). A common use case in a local Docker development mode, is the need of having two different Infinispan Clusters with Cross Site Replication enabled. see https://github.com/infinispan/infinispan-simple-tutorials/blob/main/infinispan-remote/cross-site-replication/docker-compose/

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_MCAST_PORT

Show more

int

Runs the Infinispan Server container with tracing enabled. Traces are disabled by default

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_TRACING_ENABLED

Show more

boolean

false

Sets Infinispan Server otlp endpoint. Default value is http://localhost:4317

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_TRACING_EXPORTER_OTLP_ENDPOINT

Show more

string

http://localhost:4317

Infinispan Server configuration chunks to be passed to the container.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_CONFIG_FILES

Show more

list of string

Whether or not a health check is published in case the smallrye-health extension is present.

This is a global setting and is not specific to an Infinispan Client.

Environment variable: QUARKUS_INFINISPAN_CLIENT_HEALTH_ENABLED

Show more

boolean

true

Sets the URI of the running Infinispan server to connect to. hotrod://localhost:11222@admin:password If provided hosts, username and password will be ignored.

Environment variable: QUARKUS_INFINISPAN_CLIENT_URI

Show more

string

Sets the host name/port to connect to. Each one is separated by a semicolon (eg. host1:11222;host2:11222).

Environment variable: QUARKUS_INFINISPAN_CLIENT_HOSTS

Show more

string

Sets client intelligence used by authentication Available values: * BASIC - Means that the client doesn’t handle server topology changes and therefore will only use the list of servers supplied at configuration time. * TOPOLOGY_AWARE - Use this provider if you don’t want the client to present any certificates to the remote TLS host. * HASH_DISTRIBUTION_AWARE - Like TOPOLOGY_AWARE but with the additional advantage that each request involving keys will be routed to the server who is the primary owner which improves performance greatly. This is the default.

Environment variable: QUARKUS_INFINISPAN_CLIENT_CLIENT_INTELLIGENCE

Show more

string

HASH_DISTRIBUTION_AWARE

Enables or disables authentication. Set it to false when connecting to an Infinispan Server without authentication. deployments. Default is 'true'.

Environment variable: QUARKUS_INFINISPAN_CLIENT_USE_AUTH

Show more

boolean

true

Sets username used by authentication.

Environment variable: QUARKUS_INFINISPAN_CLIENT_USERNAME

Show more

string

Sets password used by authentication.

Environment variable: QUARKUS_INFINISPAN_CLIENT_PASSWORD

Show more

string

Sets realm used by authentication

Environment variable: QUARKUS_INFINISPAN_CLIENT_AUTH_REALM

Show more

string

default

Sets server name used by authentication

Environment variable: QUARKUS_INFINISPAN_CLIENT_AUTH_SERVER_NAME

Show more

string

infinispan

Sets SASL mechanism used by authentication. Available values: * DIGEST-MD5 - Uses the MD5 hashing algorithm in addition to nonces to encrypt credentials. This is the default. * EXTERNAL - Uses client certificates to provide valid identities to Infinispan Server and enable encryption. * PLAIN - Sends credentials in plain text (unencrypted) over the wire in a way that is similar to HTTP BASIC authentication. You should use PLAIN authentication only in combination with TLS encryption.

Environment variable: QUARKUS_INFINISPAN_CLIENT_SASL_MECHANISM

Show more

string

DIGEST-MD5

Specifies the filename of a truststore to use to create the SSLContext. You also need to specify a trustStorePassword. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT_TRUST_STORE

Show more

string

Specifies the password needed to open the truststore You also need to specify a trustStore. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT_TRUST_STORE_PASSWORD

Show more

string

Specifies the type of the truststore, such as JKS or JCEKS. Defaults to JKS if trustStore is enabled.

Environment variable: QUARKUS_INFINISPAN_CLIENT_TRUST_STORE_TYPE

Show more

string

Configures the secure socket protocol. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT_SSL_PROTOCOL

Show more

string

Sets the ssl provider. For example BCFIPS Setting this implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT_SSL_PROVIDER

Show more

string

Configures the ciphers. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT_SSL_CIPHERS

Show more

list of string

Do SSL hostname validation. Defaults to true.

Environment variable: QUARKUS_INFINISPAN_CLIENT_SSL_HOST_NAME_VALIDATION

Show more

boolean

SNI host name. Mandatory when SSL is enabled and host name validation is true.

Environment variable: QUARKUS_INFINISPAN_CLIENT_SNI_HOST_NAME

Show more

string

Whether a tracing propagation is enabled in case the Opentelemetry extension is present. By default the propagation of the context is propagated from the client to the Infinispan Server.

Environment variable: QUARKUS_INFINISPAN_CLIENT_TRACING_PROPAGATION_ENABLED

Show more

boolean

Enables or disables Protobuf generated schemas upload to the server. Set it to 'false' when you need to handle the lifecycle of the Protobuf Schemas on Server side yourself. Default is 'true'. This is a global setting and is not specific to a Infinispan Client.

Environment variable: QUARKUS_INFINISPAN_CLIENT_USE_SCHEMA_REGISTRATION

Show more

boolean

true

Cache configuration file in XML, JSON or YAML is defined in build time to create the cache on first access. An example of the user defined property. cacheConfig.xml file is located in the 'resources' folder: quarkus.infinispan-client.cache.bookscache.configuration-resource=cacheConfig.xml

Environment variable: QUARKUS_INFINISPAN_CLIENT_CACHE__CACHE__CONFIGURATION_RESOURCE

Show more

string

Environment variables that are passed to the container.

Environment variable: QUARKUS_INFINISPAN_CLIENT_DEVSERVICES_CONTAINER_ENV

Show more

Map<String,String>

Sets the marshallerClass. Default is ProtoStreamMarshaller

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__MARSHALLER_CLASS

Show more

string

Cache configuration file in XML, JSON or YAML is defined in build time to create the cache on first access. An example of the user defined property. cacheConfig.xml file is located in the 'resources' folder: quarkus.infinispan-client.cache.bookscache.configuration-resource=cacheConfig.xml

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__CACHE__CACHE__CONFIGURATION_RESOURCE

Show more

string

If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present.

When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode and when Docker is running.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_ENABLED

Show more

boolean

true

Optional fixed port the dev service will listen to.

If not defined, the port will be chosen randomly.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_PORT

Show more

int

Indicates if the Infinispan server managed by Quarkus Dev Services is shared. When shared, Quarkus looks for running containers using label-based service discovery. If a matching container is found, it is used, and so a second one is not started. Otherwise, Dev Services for Infinispan starts a new container.

The discovery uses the quarkus-dev-service-infinispan label. The value is configured using the service-name property.

Container sharing is only used in dev mode.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_SHARED

Show more

boolean

true

The value of the quarkus-dev-service-infinispan label attached to the started container. This property is used when shared is set to true. In this case, before starting a container, Dev Services for Infinispan looks for a container with the quarkus-dev-service-infinispan label set to the configured value. If found, it will use this container instead of starting a new one. Otherwise, it starts a new container with the quarkus-dev-service-infinispan label set to the specified value.

This property is used when you need multiple shared Infinispan servers.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_SERVICE_NAME

Show more

string

infinispan

The image to use. Note that only official Infinispan images are supported.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_IMAGE_NAME

Show more

string

List of the artifacts to automatically download and add to the Infinispan server libraries.

For example a Maven coordinate (org.postgresql:postgresql:42.3.1) or a dependency location url.

If an invalid value is passed, the Infinispan server will throw an error when trying to start.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_ARTIFACTS

Show more

list of string

Add a site name to start the Infinispan Server Container with Cross Site Replication enabled (ex. lon). Cross Site Replication is the capability to connect two separate Infinispan Server Clusters that might run in different Data Centers, and configure backup caches to copy the data across the clusters with active-active or active-passive replication. See more about Cross Site Replication in the Infinispan Documentation https://infinispan.org/docs/stable/titles/xsite/xsite.html Configure mcast-port to avoid forming a cluster with any other running Infinispan Server container.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_SITE

Show more

string

If you are running an Infinispan Server already in docker, if the containers use the same mcastPort they will form a cluster. Set a different mcastPort to create a separate cluster in Docker (e. 46656). A common use case in a local Docker development mode, is the need of having two different Infinispan Clusters with Cross Site Replication enabled. see https://github.com/infinispan/infinispan-simple-tutorials/blob/main/infinispan-remote/cross-site-replication/docker-compose/

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_MCAST_PORT

Show more

int

Runs the Infinispan Server container with tracing enabled. Traces are disabled by default

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_TRACING_ENABLED

Show more

boolean

false

Sets Infinispan Server otlp endpoint. Default value is http://localhost:4317

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_TRACING_EXPORTER_OTLP_ENDPOINT

Show more

string

http://localhost:4317

Environment variables that are passed to the container.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_CONTAINER_ENV

Show more

Map<String,String>

Infinispan Server configuration chunks to be passed to the container.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__DEVSERVICES_CONFIG_FILES

Show more

list of string

Cache configuration in inlined XML to create the cache on first access. Will be ignored if the configuration-uri is provided for the same cache name. An example of the user defined property: quarkus.infinispan-client.cache.bookscache.configuration=

Environment variable: QUARKUS_INFINISPAN_CLIENT_CACHE__CACHE__CONFIGURATION

Show more

string

Cache configuration file in XML, Json or YAML whose path will be converted to URI to create the cache on first access. An example of the user defined property. cacheConfig.xml file is located in the 'resources' folder: quarkus.infinispan-client.cache.bookscache.configuration-uri=cacheConfig.xml

Environment variable: QUARKUS_INFINISPAN_CLIENT_CACHE__CACHE__CONFIGURATION_URI

Show more

string

The maximum number of entries to keep locally for the specified cache.

Environment variable: QUARKUS_INFINISPAN_CLIENT_CACHE__CACHE__NEAR_CACHE_MAX_ENTRIES

Show more

int

Sets near cache mode used by the Infinispan Client Available values: * DISABLED - Means that near caching is disabled. This is the default value. * INVALIDATED - Means is near caching is invalidated, so when entries are updated or removed server-side, invalidation messages will be sent to clients to remove them from the near cache.

Environment variable: QUARKUS_INFINISPAN_CLIENT_CACHE__CACHE__NEAR_CACHE_MODE

Show more

disabled, invalidated

Enables bloom filter for near caching. Bloom filters optimize performance for write operations by reducing the total number of invalidation messages.

Environment variable: QUARKUS_INFINISPAN_CLIENT_CACHE__CACHE__NEAR_CACHE_USE_BLOOM_FILTER

Show more

boolean

Sets the host name/port to connect to. Each one is separated by a semicolon (eg. hostA:11222;hostB:11222).

Environment variable: QUARKUS_INFINISPAN_CLIENT_BACKUP_CLUSTER__BACKUP_CLUSTER__HOSTS

Show more

string

required

Sets client intelligence used by authentication Available values: * BASIC - Means that the client doesn’t handle server topology changes and therefore will only use the list of servers supplied at configuration time. * TOPOLOGY_AWARE - Use this provider if you don’t want the client to present any certificates to the remote TLS host. * HASH_DISTRIBUTION_AWARE - Like TOPOLOGY_AWARE but with the additional advantage that each request involving keys will be routed to the server who is the primary owner which improves performance greatly. This is the default.

Environment variable: QUARKUS_INFINISPAN_CLIENT_BACKUP_CLUSTER__BACKUP_CLUSTER__CLIENT_INTELLIGENCE

Show more

string

HASH_DISTRIBUTION_AWARE

Enables or disables Protobuf generated schemas upload to the backup. Set it to 'false' when you need to handle the lifecycle of the Protobuf Schemas on Server side yourself. Default is 'true'. This setting will be ignored if the Global Setting is set up to false.

Environment variable: QUARKUS_INFINISPAN_CLIENT_BACKUP_CLUSTER__BACKUP_CLUSTER__USE_SCHEMA_REGISTRATION

Show more

boolean

true

Sets the URI of the running Infinispan server to connect to. hotrod://localhost:11222@admin:password If provided hosts, username and password will be ignored.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__URI

Show more

string

Sets the host name/port to connect to. Each one is separated by a semicolon (eg. host1:11222;host2:11222).

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__HOSTS

Show more

string

Sets client intelligence used by authentication Available values: * BASIC - Means that the client doesn’t handle server topology changes and therefore will only use the list of servers supplied at configuration time. * TOPOLOGY_AWARE - Use this provider if you don’t want the client to present any certificates to the remote TLS host. * HASH_DISTRIBUTION_AWARE - Like TOPOLOGY_AWARE but with the additional advantage that each request involving keys will be routed to the server who is the primary owner which improves performance greatly. This is the default.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__CLIENT_INTELLIGENCE

Show more

string

HASH_DISTRIBUTION_AWARE

Enables or disables authentication. Set it to false when connecting to an Infinispan Server without authentication. deployments. Default is 'true'.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__USE_AUTH

Show more

boolean

true

Sets username used by authentication.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__USERNAME

Show more

string

Sets password used by authentication.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__PASSWORD

Show more

string

Sets realm used by authentication

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__AUTH_REALM

Show more

string

default

Sets server name used by authentication

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__AUTH_SERVER_NAME

Show more

string

infinispan

Sets SASL mechanism used by authentication. Available values: * DIGEST-MD5 - Uses the MD5 hashing algorithm in addition to nonces to encrypt credentials. This is the default. * EXTERNAL - Uses client certificates to provide valid identities to Infinispan Server and enable encryption. * PLAIN - Sends credentials in plain text (unencrypted) over the wire in a way that is similar to HTTP BASIC authentication. You should use PLAIN authentication only in combination with TLS encryption.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__SASL_MECHANISM

Show more

string

DIGEST-MD5

Specifies the filename of a truststore to use to create the SSLContext. You also need to specify a trustStorePassword. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__TRUST_STORE

Show more

string

Specifies the password needed to open the truststore You also need to specify a trustStore. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__TRUST_STORE_PASSWORD

Show more

string

Specifies the type of the truststore, such as JKS or JCEKS. Defaults to JKS if trustStore is enabled.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__TRUST_STORE_TYPE

Show more

string

Configures the secure socket protocol. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__SSL_PROTOCOL

Show more

string

Sets the ssl provider. For example BCFIPS Setting this implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__SSL_PROVIDER

Show more

string

Configures the ciphers. Setting this property implicitly enables SSL/TLS.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__SSL_CIPHERS

Show more

list of string

Do SSL hostname validation. Defaults to true.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__SSL_HOST_NAME_VALIDATION

Show more

boolean

SNI host name. Mandatory when SSL is enabled and host name validation is true.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__SNI_HOST_NAME

Show more

string

Whether a tracing propagation is enabled in case the Opentelemetry extension is present. By default the propagation of the context is propagated from the client to the Infinispan Server.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__TRACING_PROPAGATION_ENABLED

Show more

boolean

Cache configuration in inlined XML to create the cache on first access. Will be ignored if the configuration-uri is provided for the same cache name. An example of the user defined property: quarkus.infinispan-client.cache.bookscache.configuration=

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__CACHE__CACHE__CONFIGURATION

Show more

string

Cache configuration file in XML, Json or YAML whose path will be converted to URI to create the cache on first access. An example of the user defined property. cacheConfig.xml file is located in the 'resources' folder: quarkus.infinispan-client.cache.bookscache.configuration-uri=cacheConfig.xml

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__CACHE__CACHE__CONFIGURATION_URI

Show more

string

The maximum number of entries to keep locally for the specified cache.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__CACHE__CACHE__NEAR_CACHE_MAX_ENTRIES

Show more

int

Sets near cache mode used by the Infinispan Client Available values: * DISABLED - Means that near caching is disabled. This is the default value. * INVALIDATED - Means is near caching is invalidated, so when entries are updated or removed server-side, invalidation messages will be sent to clients to remove them from the near cache.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__CACHE__CACHE__NEAR_CACHE_MODE

Show more

disabled, invalidated

Enables bloom filter for near caching. Bloom filters optimize performance for write operations by reducing the total number of invalidation messages.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__CACHE__CACHE__NEAR_CACHE_USE_BLOOM_FILTER

Show more

boolean

Sets the host name/port to connect to. Each one is separated by a semicolon (eg. hostA:11222;hostB:11222).

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__BACKUP_CLUSTER__BACKUP_CLUSTER__HOSTS

Show more

string

required

Sets client intelligence used by authentication Available values: * BASIC - Means that the client doesn’t handle server topology changes and therefore will only use the list of servers supplied at configuration time. * TOPOLOGY_AWARE - Use this provider if you don’t want the client to present any certificates to the remote TLS host. * HASH_DISTRIBUTION_AWARE - Like TOPOLOGY_AWARE but with the additional advantage that each request involving keys will be routed to the server who is the primary owner which improves performance greatly. This is the default.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__BACKUP_CLUSTER__BACKUP_CLUSTER__CLIENT_INTELLIGENCE

Show more

string

HASH_DISTRIBUTION_AWARE

Enables or disables Protobuf generated schemas upload to the backup. Set it to 'false' when you need to handle the lifecycle of the Protobuf Schemas on Server side yourself. Default is 'true'. This setting will be ignored if the Global Setting is set up to false.

Environment variable: QUARKUS_INFINISPAN_CLIENT__NAMED_INFINISPAN_CLIENTS__BACKUP_CLUSTER__BACKUP_CLUSTER__USE_SCHEMA_REGISTRATION

Show more

boolean

true

関連コンテンツ