Spring Boot Integration
Spring Boot Integration
Auto-configured beans, REST endpoints, and Actuator health.
Spring Boot reads loomcache.* properties
The loom-spring-boot module targets Spring Boot 4.0.5. Drop it on the classpath, declare a seed list, and the
LoomAutoConfiguration wires the rest.
Dependency
Section titled “Dependency”<dependency> <groupId>com.loomcache</groupId> <artifactId>loom-spring-boot</artifactId> <version>1.0.0-SNAPSHOT</version></dependency>Minimum configuration
Section titled “Minimum configuration”loomcache: cluster: seeds: - 127.0.0.1:5701 - 127.0.0.1:5702 - 127.0.0.1:5703 client: connect-timeout-ms: 5000 request-timeout-ms: 3000Beans registered
Section titled “Beans registered”When seeds are present, LoomAutoConfiguration registers client-side beans by default:
LoomClient— synchronous client.AsyncLoomClient—CompletableFuture-returning facade.LoomCacheManagerimplementingorg.springframework.cache.CacheManager— whenloomcache.spring-cache.enabled=true(the default).LoomSessionRepository— whenloomcache.session.enabled=true.LoomHealthIndicator— picked up by Spring Boot actuator.
Embedded server beans are opt-in. Set loomcache.server.enabled=true to import the embedded CacheNode configuration;
leaving it unset or false keeps the application in client-only mode.
Spring Cache abstraction
Section titled “Spring Cache abstraction”@Cacheable("products")public Product findById(String id) { ... }
@CachePut("products")public Product save(Product p) { ... }
@CacheEvict("products")public void remove(String id) { ... }Pre-create caches at startup:
loomcache: spring-cache: enabled: true cache-names: [products, users, orders]Spring Session
Section titled “Spring Session”loomcache: session: enabled: true default-max-inactive-interval: 30m map-name: loom:sessionsLoomSessionRepository stores SessionInformation in the loom:sessions map.
REST controllers
Section titled “REST controllers”Mounted automatically under /api/* (see REST API). The starter exposes the default map, queue,
set, topic, query, cluster, lock, atomic, multimap, list, ringbuffer, reliable-topic, and PN-counter controllers.
Inputs are validated by InputValidator and @Valid; exceptions are translated by GlobalExceptionHandler. The
generated OpenAPI document for these controllers is available at /v3/api-docs/loomcache-api.
Actuator
Section titled “Actuator”LoomHealthIndicator reports the client’s connection status and a cluster health summary at
/actuator/health/loomcache.
TLS & auth
Section titled “TLS & auth”Both sections map to TlsConfig / AuthConfig:
loomcache: tls: enabled: true key-store-path: /etc/loomcache/tls/keystore.p12 key-store-password: ${KEYSTORE_PASSWORD} trust-store-path: /etc/loomcache/tls/truststore.p12 trust-store-password: ${TRUSTSTORE_PASSWORD} require-client-auth: true auth: enabled: true gateway-trust: false user-header: X-Auth-User roles-header: X-Auth-Roles role-prefix: ROLE_ roles: admin: permissions: ["*"] reader: permissions: [MAP_GET, MAP_CONTAINS, MAP_SIZE]Optional Spring Security JWT issuing:
loomcache: security: jwt: enabled: true signing-secret: ${LOOMCACHE_JWT_SIGNING_SECRET} ttl: 15mWhen enabled, authenticated Spring REST callers can POST /token to receive a short-lived HS256 Bearer token.
loom-spring-boot/src/test includes context-load tests (LoomAutoConfigurationTest), bean presence assertions
(CacheNodeConfigTest), and full controller ITs.