Class BoundedMemoryCache

java.lang.Object
org.atmosphere.cache.BoundedMemoryCache
All Implemented Interfaces:
BroadcasterCache, AtmosphereConfigAware

public class BoundedMemoryCache extends Object implements BroadcasterCache
A bounded, in-memory BroadcasterCache that stores recent broadcast messages per client UUID. Messages are automatically evicted when the cache exceeds its maximum size or when entries are older than the configured TTL.

This implementation is suitable for applications that need message replay on reconnect (e.g., AI chat conversation history, real-time collaboration). For distributed deployments, use a Redis-backed cache.

Configuration

  • org.atmosphere.cache.maxSize — max messages per broadcaster (default 1000)
  • org.atmosphere.cache.ttlSeconds — message TTL in seconds (default 3600)
Since:
4.0.8