Connects to a Redis instance and perform the following operations:
- Stores the last invocation ID in Redis
- Stores the last invocation time in Redis
- Adds the invocation ID to a list in Redis
- Returns the list of invocation IDs from Redis
- 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
- Run tests with
./mvnw test
- Start your function locally
sf run function start --verbose
- Invoke your function locally
sf run function --function-url=http://localhost:8080 --payload='{"limit": 5}'