4.5. Configure Expiration


In Red Hat JBoss Data Grid, expiration is configured in a manner similar to eviction.

Procedure 4.1. Configure Expiration

  1. Add the Expiration Tag

    Add the <expiration> tag to your project's <cache> tags as follows:
    <expiration />
    Copy to Clipboard Toggle word wrap
  2. Set the Expiration Lifespan

    Set the lifespan value to set the period of time (in milliseconds) an entry can remain in memory. The following is an example of this step:
    <expiration lifespan="1000" />
    Copy to Clipboard Toggle word wrap
  3. Set the Maximum Idle Time

    Set the time that entries are allowed to remain idle (unused) after which they are removed (in milliseconds). The default value is -1 for unlimited time.
    1. In Library mode, set the maxIdle parameter as follows:
      <expiration lifespan="1000" maxIdle="1000" />
      Copy to Clipboard Toggle word wrap
      • In Remote Client Server mode, set the max-idle as follows:
        <expiration lifespan="1000" max-idle="1000" />
        Copy to Clipboard Toggle word wrap
Result

Expiration is now configured for the cache implementation.

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat