Cache storage using Vert.x Redis Client
Depends on #67
Storing cached resources in an external system allows for sharing content between several proxy servers.
Redis is popular and we already have a Vert.x Redis Client.
Hi @vietj ,
Through discussion with @tsegismont , we need a new module for this feature (A cache implementation using Redis, probably named vertx-http-proxy-cache-store-redis). To avoid circular dependencies, where do you think we should put it? In the vertx-http-proxy repo or in the vertx-redis-client repo?
Thanks!
@wzy1935 in order to use the Vert.x Redis Client test classes in the project, you must add this:
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-redis-client</artifactId>
<type>test-jar</type>
<scope>test</scope>
<version>${project.version}</version>
</dependency>
Note that the <version>${project.version}</version> element is mandatory because the vertx-redis-client tests jar dependency is not defined in the vertx-dependencies BOM.
And then in your test code you can create/close a client before/after each test:
@ClassRule
public static final RedisStandalone redis = RedisStandalone.builder().setVersion("5.0").build();
private Redis client;
@Before
public void before(TestContext should) {
Async before = should.async();
client = Redis.createClient(
vertx,
new RedisOptions().setConnectionString(redis.getRedisUri()));
client.connect().onComplete(onConnect -> {
should.assertTrue(onConnect.succeeded());
before.complete();
});
}
@After
public void after() {
client.close();
}
Hi @vietj ,
Through discussion with @tsegismont , we need a new module for this feature (A cache implementation using Redis, probably named
vertx-http-proxy-cache-store-redis). To avoid circular dependencies, where do you think we should put it? In thevertx-http-proxyrepo or in thevertx-redis-clientrepo?Thanks!
@vietj any requirement or preference regarding this question?