2.2. 使用带有 Reactor 的被动模式
从 Spring 6.1 开始,支持被动模式在被动应用程序中使用缓存。如果使用 spring-boot-starter-webflux,则您的应用程序可能会阻止。
要启用 Data Grid 被动驱动程序,请在 application.properties 中指定以下属性:
infinispan.remote.reactive=true
infinispan.remote.reactive=true
2.2.1. 属性文件 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
您可以在 hotrod-client.properties 或 application.properties 中指定属性。
属性可以在这两个属性文件中,但启动程序首先应用 hotrod-client.properties 中的配置,这意味着文件优先于 application.properties。
hotrod-client.properties
此文件中的属性的格式采用 infinispan.client.hotrodö 的格式,例如:
List Data Grid servers by IP address or hostname at port localhost:11222.
# List Data Grid servers by IP address or hostname at port localhost:11222.
infinispan.client.hotrod.server_list=127.0.0.1:11222
application.properties
此文件中的属性的格式采用 infinispan.remote.* 格式,例如:
List Data Grid servers by IP address or hostname at port localhost:11222.
# List Data Grid servers by IP address or hostname at port localhost:11222.
infinispan.remote.server-list=127.0.0.1:11222