BoxLang 🚀 A New JVM Dynamic Language Learn More...
|:------------------------------------------------------: |
| ⚡︎ B o x L a n g ⚡︎
| Dynamic : Modular : Productive
|:------------------------------------------------------: |
This module provides standalone Redis and Redis Cluster cache providers for BoxLang runtimes.
To include the module in your boxlang runtime, follow the instructions for module installation appropriate to your runtime, using bx-redis
as the module name/slug.
Versions 1.0.0
and above will require a Boxlang+ Subscription. Without subscription, the module will operate within trial mode for 30 days. After this period, the module will be placed in developer mode, which will limit cache host connections only to 127.0.0.1
and localhost
.
Feature Requests and Bug Reports may be submitted via JIRA.
If you file a bug report, your issue should contain a title, a clear description of the issue, a way to replicate the issue, and any support files that we might need to replicate your issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix for it. All issues that do not contain a way to replicate will not be addressed.
If you have any questions on usage, professional support or just ideas to bounce off the maintainers, please do not create an issue. Leverage our support channels first.
boxlang.json
configurationThe JSON configuration structure for boxlang for a single redis connection would be placed in the caches
object in boxlang.json
{
"caches" : {
"sessions": {
"provider": "Redis",
"properties": {
"cacheKeyCaseSensitivity": "false",
"database": "0",
"idleConnections": "5",
"maxConnections": "50",
"password": "",
"timeout": "2000",
"useSSL": "false",
"host": "127.0.0.1",
"keyprefix": "resources",
"port": "6379",
"timeout" : 2000,
"readTimeout" : 2000,
"socketTimeout" : 2000,
"poolWaittimeout" : 1000,
"maxAttempts" : 10,
"maxConnections": 1000,
"maxIdleTime" : 30000,
"maxIdleConnections" : 20
}
}
}
}
{
"caches" : {
"resources": {
"provider": "RedisCluster",
"properties": {
"hosts": "node1.myrediscluster,node2.myrediscluster,node3.myrediscluster,",
"keyprefix": "boxlang-cluster",
"username": "${REDIS_CLUSTER_USERNAME}",
"password": "${REDIS_CLUSTER_PASSWORD}",
"port": "6379",
"useSSL": "${REDIS_CLUSTER_USE_SSL:false}",
"timeout" : 2000,
"readTimeout" : 2000,
"socketTimeout" : 2000,
"poolWaittimeout" : 1000,
"maxAttempts" : 10,
"maxConnections": 1000,
"maxIdleTime" : 30000,
"maxIdleConnections" : 20
}
}
}
}
Application.bx
/Application.cfc
configurationthis.caches[ "sessions" ] = {
"provider": "Redis",
"properties": {
"cacheKeyCaseSensitivity": "false",
"database": "0",
"idleConnections": "5",
"maxConnections": "50",
"password": "",
"timeout": "2000",
"useSSL": "false",
"host": "127.0.0.1",
"keyprefix": "boxlang-sessions",
"port": "6379",
"timeout" : 2000,
"socketTimeout" : 2000,
"poolWaittimeout" : 1000,
"maxConnections": 1000,
"idleConnections": 10
}
};
this.caches[ "resources" ] = {
"provider": "RedisCluster",
"properties": {
"hosts": "node1.myrediscluster,node2.myrediscluster,node3.myrediscluster,",
"keyprefix": "boxlang-cluster",
"username": myClusterUsername,
"password": myClusterPassword,
"port": "6379",
"useSSL": false,
"timeout" : 2000,
"readTimeout" : 2000,
"socketTimeout" : 2000,
"poolWaittimeout" : 1000,
"maxAttempts" : 10,
"maxConnections": 1000,
"maxIdleTime" : 30000,
"maxIdleConnections" : 20
}
};
The Redis server IP address or host name.
The port of the Redis server.
The logical database to connect to in Redis. By default we connect to database 0.
The Redis cluster username - only used when enabling user-level access.
The password of the Redis server, if any.
Enable SSL on the connection to the Redis Server.
The time in milliseconds to wait for a connection or throw an exception.
The cluster connection socket timeout in milliseconds
The the maximum amount of time, in milliseconds, to wait for a connection pool resource to become available
The maximum number of connections to allow to the Redis server.
The maximum number of idle connections to keep in the pool to the Redis server
The default key prefix is boxlang-cache
. This will automatically prefix EVERY single cache item that goes into Redis. This will allow you to avoid collisions if you decide to register many Lucee caches or just to distinguish what comes from which cache connection.
By default all cache keys are transformed to lowercase to avoid any casing issues. However, if you want case sensitivity, then turn this option on.
Enter a comma-delimited list of all the IPs or hosts in the cluster. Not all are needed, but you should at least enter some to have redundancy.
The port of the Redis cluster.
Whether SSL transport is enabled
The Redis cluster username - only used when enabling user-level access.
The Redis cluster password
The time in milliseconds to wait for a connection or throw an exception.
The timeout for a read of data from the cluster - defaults to the connection timeout
The cluster connection socket timeout in milliseconds
The the maximum amount of time, in milliseconds, to wait for a connection pool resource to become available
The maximum number of connections to the cluster allowed per pool - defaults to 50
The max idle time, in milliseconds, for a connection to remain in the pool.
The maximum number of concurrently idle connections to retain in the pool
The maximum number of connection attempts to make to the cluster.
The default key prefix is lucee-cache
. This will automatically prefix EVERY single cache item that goes into Redis. This will allow you to avoid collisions if you decide to register many Lucee caches or just to distinguish what comes from which cache connection.
By default all cache keys are transformed to lowercase to avoid any casing issues. However, if you want case sensitivity, then turn this option on.
Copyright Since 2023 by Ortus Solutions, Corp
www.boxlang.io | www.ortussolutions.com
BoxLang is a professional open-source project and it is completely funded by the community and Ortus Solutions, Corp. Ortus Patreons get many benefits like a cfcasts account, a FORGEBOX Pro account and so much more. If you are interested in becoming a sponsor, please visit our patronage page: https://patreon.com/ortussolutions
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
$
box install bx-redis