Running the adapter
Prerequisites
-
Java installation (Java v8 or greater)
-
A running Redis cluster (v7.2 or greater)
-
A running Diffusion server (v6.10 or greater)
Run script
You can run the adapter in the following ways:
-
Supply "bootstrap configuration" so the adapter connects only to Diffusion, after which any services can be added via the Diffusion console or via the API.
-
Supply a configuration file encapsulating the Diffusion server details and zero or more service configurations.
The provided scripts can be used to run the Redis Adapter for Diffusion.
Scripts demonstrating both approach can be found in ./bin
Starting with bootstrap configuration only
-
Edit
./bin/redis-adapter-bootstrap.sh
and edit the values of systems properties startinggateway.diffusion.
as you require. -
Run the script
./bin/redis-adapter-bootstrap.sh
-
Browse to the Diffusion server’s console, open the
Network
tab and verify that the adapter is present. If you have permission you can manually add a service.
Starting with a configuration file
When using this approach all configuration is drawn from a single configuration file. ./bin/redis-adapter.sh
uses ./example/configuration.json
.
-
Edit
./example/configuration.json
, and configure the Redis connectivity values,redisURI
most importantly. -
Run the script
./bin/redis-adapter.sh
Windows users can do the same with ./bin/redis-adapter.bat
.
Run the docker image
To run the docker image:
-
Firstly, pull the docker image.
docker pull pushtechnology/redis-adapter:1.1.0
-
Run the image as follows:
-
With minimal bootstrap configuration:
docker run \ -e gateway.diffusion.url=ws://90.247.210.62:8080 \ -e gateway.diffusion.principal=admin \ -e gateway.diffusion.password=password \ pushtechnology/redis-adapter:1.1.0
-
With a configuration file:
docker run \ --mount type=bind,source=configuration.json,target=/opt/redis-adapter/configuration.json \ -e gateway.config.file=/opt/redis-adapter/configuration.json \ pushtechnology/redis-adapter:1.1.0
-
Here an external file is mounted at /opt/redis-adapter/configuration.json within the container and is passed as environment variable gateway.config.file .
|
The docker image supports the EXTRA_JAVA_OPTIONS
environment variable, which can be set to specify any additional JVM option for the docker container.
External libraries
Any external JAR files containing payload converters or custom publishers that are not part of the Redis adapter can be added to the 'ext' directory available in the Redis adapter bundle. The JARs in the 'ext' directory are configured to be loaded during startup by the scripts in the 'bin/' directory.