Skip to content

Latest commit

 

History

History
 
 

06_Data_Redis_Java

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

redisjava Function

Connects to a Redis instance and perform the following operations:

  1. Stores the last invocation ID in Redis
  2. Stores the last invocation time in Redis
  3. Adds the invocation ID to a list in Redis
  4. Returns the list of invocation IDs from Redis

Local Development

  1. Export your Heroku Data for Redis configuration

Make sure you have the REDIS_URL connection string in the .env file of this folder. For using this recipe on a Compute Environment please refer to the Heroku Data in Functions documentation.

heroku config -a <app_name> --shell > .env
source .env
  1. Run tests with
./mvnw test
  1. Start your function locally
sf run function start --verbose
  1. Invoke your function locally
sf run function --function-url=http://localhost:8080 --payload='{"limit": 5}'