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
  • Major Updates
  • Redis Logical Database Support
  • Redis Cluster Support
  • Redis Cluster Functions
  • Redis Pub/Sub
  • Code Quality
  • Better Exception Handling
  • Release Notes
  • Fixed
  • Added

Was this helpful?

Edit on GitHub
Export as PDF
  1. Intro
  2. Release History

What's New With 2.x

PreviousWhat's New With 2.1.0NextChangelog

Last updated 2 years ago

Was this helpful?

Version 2 is a major rewrite of our Java Extension. You can find the release notes and the major areas of improvement here.

Major Updates

Redis Logical Database Support

By default Redis supports the concept of logical . In our previous extension you could only connect to database 0, which is the default database. This meant that all cache connections had to connect to this database and add a prefix key per connection to avoid collisions.

Now, you can add which logical database to connect to and partition your installation by logical database rather than by prefix. Thus, providing great separation of concerns for your connections and applications. On your cache connection details for the Redis Cache, just select which database number to connect to. That's it!

Redis Cluster Support

We have added the capability to connect to not only standalone Redis instances via our Redis Cache connector, but we have now introduced the Redis Cluster Cache connector. This connector can connect to any Redis Cluster and give you all the great features our extension gives.

Redis Cluster Functions

We have also introduced several new functions for usage in a cluster cache:

Function
Description

RedisGetCluster( cacheName )

Get access to the underlying Redis Cluster Java class so you can execute native cluster commands.

RedisGetClusterNodes( cacheName )

Returns a struct of all the nodes and their appropriate Java classes representing their node connection pools.

Redis Pub/Sub

We have introduced the capability for your CFML code to now leverage Redis Publish and Subscribe constructs. This will allow your CFML code to have native messaging via Redis.

What is Pub/Sub?

Redis Pub/Sub implements the Publish/Subscribe messaging paradigm. This decoupling of publishers and subscribers can allow for greater scalability and a more dynamic network topology.

  1. Subscribers express interest in one or more channels (literal channels or pattern channels).

  2. Publishers send messages into channels.

  3. Redis will push these messages into different subscribers which have matched the channel's message.

Pub/Sub Functions

In order to leverage this pattern you will use the following two functions:

Function
Description

RedisPublish( channel, message, cacheName )

Publish a message into Redis into a specific channel.

RedisSubscribe( subscriber, channels, cacheName )

Subscribe to a channel for messages using a closure/lambda or a listener CFC

Publish Example

// Publish Example
<h2>Publishing messages...</h2>
<cfflush>
<cfscript>
	RedisPublish( "test-channel", "Hola mi amigo" );
	RedisPublish( "test-channel", "Hola mi amigo2" );
	RedisPublish( "test-channel", "Hola mi amigo Redis" );
</cfscript>
<h2>Finished publishing messages</h2>

Subscribe Example

<cfscript>
// Subscribe with closure
closureSubscriber = redisSubscribe( ( channel, message ) => {
	writeDump( var="Message received on channel #arguments.channel#, #arguments.message#", output="console" );
}, "test-channel" );

// Subscribe with CFC
cfcSubscriber = redisSubscribe( new Subscriber(), "test-channel" );

</cfscript>
<h1>Subscription started!! Check the logs!</h1>

Subscriber Listener CFC

component {

	public void function onMessage( String channel, String message ) {
		writeDump( var="Subscriber CFC -> onMessage called :#arguments.toString()#", output="console" );
	}

	public void function onPMessage( String pattern, String channel, String message ) {
		writeDump( var="Subscriber CFC -> onPMessage called :#arguments.toString()#", output="console" );
	}

	public void function onSubscribe( String channel, numeric subscribedChannels ) {
		writeDump( var="Subscriber CFC -> onSubscribe called :#arguments.toString()#", output="console" );
	}

	public void function onUnsubscribe( String channel, numeric subscribedChannels ) {
		writeDump( var="Subscriber CFC -> onUnsubscribe called :#arguments.toString()#", output="console" );
	}

	public void function onPUnsubscribe( String pattern, numeric subscribedChannels ) {
		writeDump( var="Subscriber CFC -> onPUnsubscribe called :#arguments.toString()#", output="console" );
	}

	public void function onPSubscribe( String pattern, numeric subscribedChannels ) {
		writeDump( var="Subscriber CFC -> onPSubscribe called :#arguments.toString()#", output="console" );
	}

}

Code Quality

Better Exception Handling

Dealing with exceptions is always nasty. However, in this release we have optimized all exceptions so better debugging is added and we can pinpoint bugs and improvements.

Release Notes

Fixed

Added

We have completely refactored our internal Java code to include code quality metrics via , upgrades to JDK 8-11 constructs, internal streams and so much more.

cache filters for getting entries was not working

getting all values/entries was not passing a built key, so return struct was always null

LicenseHelper not validating all editions of similar product skus

Ability to choose which database to connect to in Redis, apart from 0 being the default

Migration of docs to gitbook

New redisSubscribe() so you can subscribe with closures/lambdas or CFCs to listen to Redis messages

New redisPublish() UDF so you can publish messages into the Redis cluster

New UDF redisGetClusterNodes() to get a map of cluster node objects

Redis Cluster protocol support (RedisCluster, Sentinel, AWS, DigitalOcean)

Redis publish and subscribe features

New native cfml function: redisGetCluster() to get access to the native redis cluster manager

Improve all exception handling to show exception messages

Creation of a base class to share between cache implementations

Add docker redis cluster support

Update Jedis to 2.9.3

Allow for a new setting to allow for case-sensitive mode instead of case-insensitive mode (default)

LRE-35
LRE-32
LRE-23
LRE-41
LRE-40
LRE-39
LRE-38
LRE-37
LRE-36
LRE-33
LRE-31
LRE-30
LRE-29
LRE-28
LRE-27
LRE-25
SonarLint
databases
LogoPub/Sub – Redis
Documentation
Cluster Support
Cluster Configuration
https://dingyuliang.me/wp-content/uploads/2018/02/redis-pubsub-768x407.png
Page cover image