Configuration
Element | Type | Default | Description |
---|---|---|---|
redisServer | string | localhost | Hostname of the Redis server |
redisPort | Integer | 6379 | Port where the Redis server is hosted. |
redisTimeout | Integer | 10000 | Redis Connection timeout. |
database | string | aspire_database1 | Name of the database to use. |
variable | string | redisConn | Name of the job variable that will hold the redis connection. |
maxRetries | Integer | 3 | If there is a connection failure, the number of times to retry before failing the action. |
metaDB | Integer | -1 | Database number in Redis to store a mapping of database names and the corresponding Redis database number. If -1, uses the HASH storing approach in Redis. |
Example Configuration
<component factoryName="aspire-redis-connection" name="RedisAllDocuments" subType="default"> <redisServer>myRedisServer</redisServer> <metaDB>0</metaDB> <database>all_documents</database> <variable>redisAllDocuments</variable> </component>
Example Use Within A Pipeline
<pipeline name="process-patent" default="true"> <stages> <stage component="FetchUrl" /> <stage component="LoadXML" /> <stage component="RedisAllDocuments"/> <!-- Now that the connection has been opened and attached to the job, you can use the connection inside of Groovy scripts with the "redisAllDocuments" variable. In the future, there may be other components which will use it as well. --> </stages> </pipeline>
xample use from within a Groovy scripting component
<component name="TestRedis" subType="default" factoryName="aspire-groovy"> <script> def documentTotal = redisAllDocuments.dbSize(); redisAllDocuments.set("myKey", "myValue"); </script> </component>
Available methods
- set(): Single key/value set.
- get(): Single key get.
- mset(): Multivalue set
- mget(): Multivalue get
- dbSize(): Database size
- close(): Close connection
Overview
Content Tools