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 starting gateway.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:

  1. Firstly, pull the docker image.

    docker pull pushtechnology/redis-adapter:1.0.0
  2. Run the image as follows:

    1. 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.0.0
    2. 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.0.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.