-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add client query parameter to redis connection string
- Loading branch information
Showing
6 changed files
with
104 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
integration-tests/redis-client/src/main/java/io/quarkus/redis/it/RedisClientResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.quarkus.redis.it; | ||
|
||
import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
|
||
import io.quarkus.redis.client.RedisClientName; | ||
import io.quarkus.redis.datasource.RedisDataSource; | ||
import io.vertx.mutiny.redis.client.Command; | ||
|
||
@Path("/quarkus-redis/clients") | ||
@ApplicationScoped | ||
public class RedisClientResource { | ||
|
||
private final RedisDataSource ds; | ||
private final RedisDataSource client11; | ||
|
||
@Inject | ||
public RedisClientResource(@RedisClientName("quarkiverse") RedisDataSource ds, | ||
@RedisClientName("client11") RedisDataSource client11) { | ||
this.ds = ds; | ||
this.client11 = client11; | ||
} | ||
|
||
@GET | ||
@Produces(TEXT_PLAIN) | ||
public String clients() { | ||
// ignore response | ||
return ds.execute(Command.CLIENT, "GETNAME").toString(); | ||
} | ||
|
||
@GET | ||
@Path("/11") | ||
@Produces(TEXT_PLAIN) | ||
public String client11() { | ||
return client11.execute(Command.CLIENT, "GETNAME").toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters