LewisWatson / couchbase-spring-cache-demo

Example Spring Boot app using couchbase-spring-cache library, which is an "An implementation for Spring Cache based on Couchbase Java SDK 2.x".

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Couchbase Spring Cache Demo

Example Spring Boot app using couchbase-spring-cache library, which is an "An implementation for Spring Cache based on Couchbase Java SDK 2.x".

Observations:

  • Java Serialization is used to store values as a binary document. Therefore they will only be readable by similar JVM's on the other end.
  • Document keys are made up of cache::<cache-name>::<key>

screenshot

Integration Tests

Run Integration Tests

A couchbase test server is required in order to run the integration tests. Instructions to set up such a server are provided in Docker Couchbase Test Server.

./gradlew test

Docker Couchbase Test Server

  1. spin up container

    docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase:6.0.0
  2. Visit http://localhost:8091 on the host machine to see the Web Console

  3. Walk through the Setup wizard and accept the default values.

    • You may need to disable analytics if the defaults won't run in your environment.
  4. Add a dog_cache bucket with default settings.

  5. Navigate to Security -> Add User to create a new user called dog_cache, with password password, and Application Access permissions on dog_cache bucket.

For further information on the couchbase container, see dockerhub.com/couchbase.

About

Example Spring Boot app using couchbase-spring-cache library, which is an "An implementation for Spring Cache based on Couchbase Java SDK 2.x".

License:Apache License 2.0