Ortus Redis Cache
PurchaseSupport
  • Introduction
  • Intro
    • Release History
      • What's New With 3.0.0
      • What's New With 2.2.0
      • What's New With 2.1.0
      • What's New With 2.x
      • Changelog
    • About This Book
  • Essentials
    • Installation
    • Configuration
    • Usage
      • CFML
      • Distributed Locking
      • RAM Resources
      • Scope Storage
      • Direct Java API
    • Publish/Subscribe
    • Debugging
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Essentials
  2. Usage

Direct Java API

Go funky with the Redis extension

PreviousScope StorageNextPublish/Subscribe

Last updated 1 year ago

Was this helpful?

If you need more power or are familiar with the Redis Java API and want to use some features we haven't implemented yet, first so we can consider that addition in future version, and then head over to the Java Cluster to get direct access to the Redis Java SDK. Behind the scenes our extension leverages the library for Redis.

We have created several global CFML functions to interact with Redis

  • redisGetProvider( [cachename=default] ) - Retrieves the underlying Ortus Cache implementation

  • redisGetConnectionPool( [cachename=default] ) - Retrieves the Jedis pool for a specific connection cache

  • redisGetCluster( [cachename=default] ) - Retrieves the Jedis cache cluster

  • redisGetNodes( [cachename=default] ) - Retrieves a struct of the Jedis pool connections to the cluster.

RedisGetProvider()

RedisGetProvider() returns an instance to the Java class that Ortus wrote that proxies between the Redis client and Lucee. It implements lucee.commons.io.cache.Cache. For the most part you probably won't need this class, but there are a few methods in the Lucee cache interface that aren't available to you via CFML. You can also dump the class and check out all of its functions.

// Get the Ortus Java Provider for the default object cache
myProvider = RedisGetProvider();

// Get the Ortus Java Provider for the queryStorage cache
myProvider = RedisGetProvider( "queryStorage" );

// Get all keys in the cache as a java.util.List
keys = myProvider.keys();

// Get all the values in the cache as a java.util.List
values = myProvider.values();

RedisGetConnectionPool()

pool = redisGetConnectionPool( 'sessions' );

// Get funky....

RedisGetConnectionPool() Returns access to a cache's Redis Connection Jedis Pool. It implements redis.clients.jedis.JedisPool - . This will give you direct access to the Jedis Pool connection for that cache.

let us know
Jedis
https://github.com/xetorthio/jedis/blob/master/src/main/java/redis/clients/jedis/JedisPool.java