Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

The Key-Value store API provides a minimum set of operations that are needed by the Blueriq Runtime in order to interact with a generic key-value store. It also enhances the Blueriq Runtime to be able to run in a clustered configuration.

A default implementation of the Key-Value Store API based on Redis is provided by Blueriq, named Redis Key-Value Store Component.

This chapter describes how to enable the default component and how to add a custom implementation for a key value store.

Table of Contents

Redis Key-Value Store Component

Prerequisites

An instance of Redis server needs to run on a node and needs to be accessible from the Blueriq Runtime.

Depending on the linux distribution, a Redis package may be available from the repository in any case consult their official documentation here.

Info

Redis does not officially support Windows. However, the Microsoft Open Tech group develops and maintains this Windows port targeting Win64. More information here.

 

Enable/Disable

In order to enable the component, the profile "keyvalue-redis-store" profile must be added in the bootstrap.properties

Code Block
spring.profiles.active=native,keyvalue-redis-store

Properties

The Redis Key-Value Store Component does not define any new properties, however it does use the following default Spring Boot properties in order to connect to Redis:

PropertyDescriptionRequiredDefault Value
blueriqspring.keyvalue-redis-store.connection.host-nameThe DNS name or IP address of the Redis serverTRUE 
blueriqspring.keyvalue-redis-store.connection.portThe port on which to connect to RedisFALSE6379
blueriqspring.keyvalue-redis-store.connection.passwordThe password used to connect to Redis. Can be left empty if no password is required.FALSE 
blueriq.keyvalue-redis-store.connection.test-while-idleWhether connections in the Redis connection pool should be tested while idleFALSEFALSE
blueriq.keyvalue-redis-store.min-evictable-idle-time-millisMinimum amount of time a Redis connection may sit idle in the connection pool before being eligible for evictionFALSE60000
blueriq.keyvalue-redis-store.time-between-eviction-runs-millisAmount of time between eviction runs. If set to a non-positive value, no eviction runs will occur.FALSE30000
blueriq.keyvalue-redis-store.num-tests-per-eviction-runThe maximum number of connections to examine during an evicition run. If the value negative, roughtly 1/abs(value) connections will be examined.FALSE-1

 

The following example configuration connects the Runtime to a Redis instance running on localhost on the default port and using a password:

Code Block
blueriqspring.keyvalue-redis-store.connection.host-name=localhost
blueriqspring.keyvalue-redis-store.connection.password=example

 

Custom implementation plug-in

Blueriq provides an IKeyValueStore interface which can be used to interact with a generic key-value store. In order to use this interface, add blueriq-component-api to your project's dependencies:

Code Block
<dependency>
  <groupId>com.blueriq</groupId>
  <artifactId>blueriq-component-api</artifactId>
  <version>${blueriq.version}</version>
</dependency>
Panel
Section
Column
width50%

 Previous: 2. About the load balancer

Column

Next: 4. Cluster configuration