Hi all,

With the JMS service engine removed, OFBiz no longer has a way to clear
caches across servers that share a database. I would like to propose a
replacement.

The old approach also had two flaws worth fixing: it sent the cache clear
before the transaction committed, so another server could re-cache the old
value, and it sent Java-serialized entity values over the wire.

The proposal, in phases, each with its own JIRA and PR:

1. A small cache SPI in the framework, with Caffeine as the default local
cache in place of concurrentlinkedhashmap. UtilCache stays the API callers
use, cache settings move into each component's ofbiz-component.xml, and a
few UtilCache internals are tidied.
2. An invalidation bus in the framework that publishes small key-only JSON
messages after commit. Without a bus, a single server behaves exactly as
today.
3. A Redis/Valkey plugin that provides the bus.
4. Later, if needed: a near cache through Redis client-side caching, and a
JCache bridge.

I chose a small OFBiz SPI over JCache because JCache has not changed since
2019, is not part of Jakarta EE, and has no notion of invalidation or near
caching, which is what this needs. A JCache bridge can still be added as a
provider.

I would appreciate your thoughts, especially from anyone running OFBiz on
more than one server.

Thanks,
Mridul Pathak

Reply via email to