Skip to content

Commit 678e0e8

Browse files
author
Julien Ruaux
committed
Copy files from source repo
1 parent 7a7e32e commit 678e0e8

File tree

1 file changed

+85
-70
lines changed

1 file changed

+85
-70
lines changed

README.adoc

+85-70
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,80 @@
11
= Redis Cache Java
22
:linkattrs:
3-
:project-owner: redis-field-engineering
4-
:project-name: redis-cache
5-
:dist-repo: redis-cache-java-dist
6-
:name: Redis Cache Java
7-
:project-group: com.redis
8-
:project-version: 0.1.2
9-
:project-url: https://github.com/{project-owner}/{dist-repo}
10-
:codecov-token: 2cAc3dgZRA
11-
:artifact-id: redis-cache-core
12-
:imagesdir: .github/media
3+
:imagesdir: .github/media
4+
:codecov-token: 2cAc3dgZRA
5+
:artifact-id: redis-cache-core
6+
:project-dist: redis-cache-java-dist
7+
:project-group: com.redis
8+
:project-name: redis-cache
9+
:project-owner: redis-field-engineering
10+
:project-title: Redis Cache Java
11+
:project-url: https://github.com/{project-owner}/{project-dist}
12+
:project-version: 0.2.0
1313

1414
image:https://github.com/{project-owner}/{project-name}/actions/workflows/early-access.yml/badge.svg["Build Status", link="https://github.com/{project-owner}/{project-name}/actions/workflows/early-access.yml"]
1515
image:https://codecov.io/gh/{project-owner}/{project-name}/graph/badge.svg?token={codecov-token}["Coverage", link="https://codecov.io/gh/{project-owner}/{project-name}"]
1616

17-
{name} is a cache abstraction for the Java ecosystem that leverages enterprise Redis features like indexing and query.
17+
{project-title} is a cache abstraction for the Java ecosystem that leverages enterprise Redis features like indexing and query.
1818
It provides an implementation of Spring Framework's https://docs.spring.io/spring-framework/reference/6.1/integration.html#cache[Cache Abstraction].
1919

20+
== Quick Start
21+
22+
To understand how {project-title} works, it's best to try it for yourself.
23+
24+
This example showcases a Spring Boot application using {project-title}.
25+
26+
First, clone this git repository:
27+
28+
[source,console,subs="verbatim,attributes"]
29+
----
30+
git clone {project-url}.git
31+
cd {project-dist}
32+
----
33+
34+
Next, register and create an API read-access token at https://developer.themoviedb.org/docs/getting-started[themoviedb.org,window=tmdb].
35+
36+
Set the following environment variable with the token:
37+
38+
[source,console]
39+
----
40+
export TMDB_TOKEN=<your API read-access token>
41+
----
42+
43+
Finally use Docker Compose to launch containers for Redis and the {project-title} demo app instance:
44+
45+
[source,console]
46+
----
47+
docker compose up
48+
----
49+
50+
// tag::demoSteps[]
51+
52+
You can access the demo at http://localhost:8080/[http://localhost:8080,window=demo].
53+
54+
As you click around on the different pages, notice how the response time improves after the first time you request a page.
55+
56+
image:redis-cache-demo.png[]
57+
58+
Open another browser window and access the http://localhost:3000/d/1[Grafana dashboard,window=grafana].
59+
Use username/password `admin`/`admin` to log in.
60+
You can skip changing password.
61+
62+
Arrange your browser windows with the demo app on the left and Grafana on the right:
63+
64+
image:redis-cache-demo-grafana.png[]
65+
66+
Notice the HTTP response time decreasing with cache hits, and increasing with API requests.
67+
68+
Now click on the http://localhost:8080/movies/search[Search,window=demo] link to search the cache, for example with keyword `corleone`.
69+
70+
Notice how quickly search results are returned: the search feature is powered by Redis.
71+
72+
Search response time can be visualized with the panel at the bottom of the Grafana dashboard.
73+
74+
image:redis-cache-demo-search.png[]
75+
76+
// end::demoSteps[]
77+
2078
== Usage
2179

2280
=== Dependency
@@ -43,7 +101,7 @@ dependencies {
43101

44102
=== Setup
45103

46-
To use {name} as a backing implementation, add `RedisCacheManager` to your configuration as follows:
104+
To use {project-title} as a backing implementation, add `RedisCacheManager` to your configuration as follows:
47105

48106
[source,java]
49107
-----
@@ -53,6 +111,17 @@ public RedisCacheManager cacheManager(RedisModulesClient client) {
53111
}
54112
-----
55113

114+
Then you can tag the methods in your application that you want to apply caching to.
115+
116+
.Cached Method Example
117+
[source,java]
118+
----
119+
@Cacheable("popular")
120+
public List<MovieDb> fetchPopularMovies(int page) throws Exception {
121+
return tmdbService.fetchPopularMovies(page);
122+
}
123+
----
124+
56125
`RedisCacheManager` behavior can be configured with `RedisCacheManagerBuilder`, letting you set the default `RedisCacheConfiguration` and predefined caches.
57126

58127
[source,java]
@@ -120,7 +189,7 @@ See the https://github.com/ben-manes/caffeine/wiki[Caffeine Documentation] for m
120189

121190
==== Metrics
122191

123-
{name} uses Micrometer to publish metrics.
192+
{project-title} uses Micrometer to publish metrics.
124193
To enable metrics, set a `MeterRegistry` in your `RedisCacheConfiguration`:
125194

126195
[source,java]
@@ -179,65 +248,11 @@ The following metrics are published:
179248

180249
NOTE: All metrics expose their corresponding cache name as a tag: `name=<cache>`.
181250

182-
== Quick Start
183-
184-
To understand how {name} works, it's best to try it for yourself.
185-
186-
This example showcases a Spring Boot application using {name}.
187-
188-
First, clone this git repository:
189-
190-
[source,console,subs="verbatim,attributes"]
191-
----
192-
git clone {project-url}.git
193-
cd {dist-repo}
194-
----
195-
196-
Next, register and create an API read-access token at https://developer.themoviedb.org/docs/getting-started[themoviedb.org].
197-
198-
Set the following environment variable with the token:
199-
200-
[source,console]
201-
----
202-
export TMDB_TOKEN=<your API read-access token>
203-
----
204-
205-
Finally use Docker Compose to launch containers for Redis and the {name} demo app instance:
206-
207-
[source,console]
208-
----
209-
docker compose up
210-
----
211-
212-
You can then access the demo at http://localhost:8080/[localhost:8080].
213-
214-
As you click around on the different pages, notice how the response time improves after the first time you request a page.
215-
216-
image:redis-cache-demo.png[]
217-
218-
Open another browser window and access Grafana at http://localhost:3000/[localhost:3000].
219-
Use username/password `admin`/`admin` to log in.
220-
You can skip changing password.
221-
222-
Arrange your browser windows with the demo app on the left and Grafana on the right:
223-
224-
image:redis-cache-demo-grafana.png[]
225-
226-
Notice the HTTP response time decreasing with cache hits, and increasing with API requests.
227-
228-
Now click on the http://localhost:8080/movies/search[Search] link to search the cache, for example with keyword `corleone`.
229-
230-
Notice how quickly search results are returned: the search feature is powered by Redis.
231-
232-
Search response time can be visualized with the panel at the bottom of the Grafana dashboard.
233-
234-
image:redis-cache-demo-search.png[]
235-
236251
== Support
237252

238-
{name} is supported by Redis, Inc. for enterprise-tier customers as a 'Developer Tool' under the https://redis.io/legal/software-support-policy/[Redis Software Support Policy.] For non enterprise-tier customers we supply support for {name} on a good-faith basis.
239-
To report bugs, request features, or receive assistance, please https://github.com/{project-owner}/{dist-repo}/issues[file an issue].
253+
{project-title} is supported by Redis, Inc. for enterprise-tier customers as a 'Developer Tool' under the https://redis.io/legal/software-support-policy/[Redis Software Support Policy.] For non enterprise-tier customers we supply support for {project-title} on a good-faith basis.
254+
To report bugs, request features, or receive assistance, please {project-url}/issues[file an issue].
240255

241256
== License
242257

243-
{name} is licensed under the Business Source License 1.1. Copyright (C) 2024 Redis, Inc. See https://github.com/redis-field-engineering/{dist-repo}/blob/main/LICENSE.md[LICENSE] for details.
258+
{project-title} is licensed under the Business Source License 1.1. Copyright (C) 2024 Redis, Inc. See {project-url}/blob/main/LICENSE.md[LICENSE] for details.

0 commit comments

Comments
 (0)