Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.19 KB

File metadata and controls

43 lines (26 loc) · 1.19 KB

Caching Samples

This folder contains a samples in form of stand-alone snippets that demonstrate useful scenarios.

Prerequisites

Ensure the following setup is in place.

Java

You must have java installed locally on your machinee. Run java --version to check if this is available.

Memorystore for Valkey Instance

A working instance of Memorystore for Valkey must be available. You can run the Valkey CLI for a local instance, or create an instance through the GCP Platform.

To setup a live instance, create a new Memorystore instance through the GCloud CLI using the following

gcloud redis instances create myinstance --size=2 --region=LOCATION --redis-version=redis_6_x

Altrernativley, run a local instance through the Valkey CLI

valkey-cli

Running the sample code

Each example contains instructions on any prerequisite configuration.

Compile the app through Maven (optional)

mvn compile

Run the sample code

mvn exec:java -Dexec.mainClass=MemorystoreTtlItem #Replace the main class as needed