You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

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.

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.

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

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

Properties

The Redis Key-Value Store Component defines the following properties used for 10. Concurrency Control on Multiple Nodes [editor]:

PropertyDescriptionRequiredDefault Value
blueriq.keyvalue-redis-store.subscription-pool.typeThe thread pool type to use for the keyspace notifications subscription thread pool.FALSECACHED
blueriq.keyvalue-redis-store.subscription-pool.thread-name-prefixThe thread name prefix used for threads in the keyspace notifications subscription thread pool.FALSEkeyspace-subscription-
blueriq.keyvalue-redis-store.subscription-pool.thread-countIndicates how many threads should be created when using FIXED thread pools.FALSE0

blueriq.keyvalue-redis-store.task-pool.type

The thread pool type to use for the keyspace notifications task thread pool. FALSEFIXED
blueriq.keyvalue-redis-store.task-pool.thread-name-prefixThe thread name prefix used for threads in the keyspace notifications subscription thread pool. FALSEkeyspace-task-
blueriq.keyvalue-redis-store.task-pool.thread-countIndicates how many threads should be created when using FIXED thread pools.FALSE4

 

The Redis Key-Value Store Component uses the following default Spring Boot properties in order to connect to Redis:

PropertyDescriptionRequiredDefault Value
spring.redis.hostThe DNS name or IP address of the Redis serverTRUE 
spring.redis.portThe port on which to connect to RedisFALSE6379
spring.redis.passwordThe password used to connect to Redis. Can be left empty if no password is required.FALSE 

 

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

spring.redis.host=localhost
spring.redis.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:

<dependency>
  <groupId>com.blueriq</groupId>
  <artifactId>blueriq-component-api</artifactId>
  <version>${blueriq.version}</version>
</dependency>
  • No labels