Skip to content

Latest commit

 

History

History

catalog-redis

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

catalog-redis

This module implements Redis backend for the Product Catalog Service using Redisson client.

Building the Service

See main documentation page for instructions.

Running the Service

This implementation is slightly more complex to run, because it requires a Redis instance to use as a data store.

First you will need to create a Docker network that will be used by both Redis and the service containers, if you haven't done that already:

$ docker network create sockshop 

Then you can run Redis container, but you need to assign it to the sockshop network created above, and give it a name that the service container expects (catalog-db in this case):

$ docker run --rm --name catalog-db --network sockshop redis:5.0.7

Note: The --rm flag above ensures that the container is removed automatically after it is stopped. This allows you to re-run the command above without having to remove the catalog-db container manually between runs.

Finally, you can start the service container in the same network:

$ docker run --network sockshop -p 7001:7001 ghcr.io/helidon-sockshop/catalog-redis

Once the container is up and running, you should be able to access service API by navigating to http://localhost:7001/catalogue/.

As a basic test, you should be able to perform an HTTP GET against /catalogue/size endpoint:

$ curl http://localhost:7001/catalogue/size

which should return JSON response

{
  "size": 9
}

License

The Universal Permissive License (UPL), Version 1.0