Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache storage using Vert.x Redis Client #68

Open
tsegismont opened this issue Mar 15, 2024 · 3 comments
Open

Cache storage using Vert.x Redis Client #68

tsegismont opened this issue Mar 15, 2024 · 3 comments
Labels
enhancement New feature or request gsoc2024

Comments

@tsegismont
Copy link
Contributor

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.

@tsegismont tsegismont added enhancement New feature or request gsoc2024 labels Mar 15, 2024
@wzy1935
Copy link
Contributor

wzy1935 commented Jul 15, 2024

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!

@tsegismont
Copy link
Contributor Author

@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();
  }

@tsegismont
Copy link
Contributor Author

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!

@vietj any requirement or preference regarding this question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gsoc2024
Projects
None yet
Development

No branches or pull requests

2 participants