Ok, thanks for the answers. Makes sense, reviewed the code, looks good
to me.
Regards, Gaetan
On 11/17/26 12:36, Mridul Pathak wrote:
Hi Gaetan,
Thank you for the review.
For the cache configuration, I took the idea from Moqui, where each
component declares its caches in its own configuration. This keeps
each cache's settings next to the code that owns it. The schema checks
them, and the framework no longer names application caches such as
product.config. An installation changes a setting by redeclaring the
cache in its own component with just the attributes it wants to
change, and the declarations are merged attribute by attribute.
On the pulse system, its only user was UtilCache: every cache entry
with an expiry time was a Pulse in a shared delay queue, with one
worker thread per CPU removing expired entries. Caffeine handles
expiry itself, so nothing used the pulse code anymore, and removing it
also drops those idle worker threads.
Thanks,
Mridul Pathak
On Tue, Nov 17, 2026 at 2:49 PM gaetan.chaboussie via dev
<[email protected]> wrote:
Hi Mridul, congrats on this PR, a lot of work.
I did a review or the PR, and i have a few points to discuss if
you're
willing:
- What made you choose to put the cache configs in the component
declarations ? I like the idea a lot.
- I struggle to understand why you removed the pulse system from the
ExecutionPool class. Is it not needed anymore with the new cache
system ?
some other points in PR, no blocking points.
Regards, Gaetan
On 11/12/26 15:29, Mridul Pathak via dev wrote:
> 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