-
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.
Redis Client: add runtime SPI and deployment SPI modules
Some constants from the Redis Client runtime module are moved to the runtime SPI module, so that they can be used from other modules that cannot directly depend on the Redis Client extension. One build item, `RequestedRedisClientBuildItem`, is moved from the Redis Client deployment module to the deployment SPI module. This is technically a breaking change, because it is also moved to a different package, but this build item doesn't seem to be used anywhere outside of Quarkus, so it should be safe. Further, one new build item, `RedisClientBuildItem`, is added. It provides runtime access to the Redis clients (in the Mutiny variant) without having to perform a CDI lookup.
- Loading branch information
Showing
13 changed files
with
113 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-redis-client-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-redis-client-deployment-spi</artifactId> | ||
<name>Quarkus - Redis Client - Deployment SPI</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-redis-client-runtime-spi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-core-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.reactive</groupId> | ||
<artifactId>smallrye-mutiny-vertx-redis-client</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
27 changes: 27 additions & 0 deletions
27
...oyment-spi/src/main/java/io/quarkus/redis/deployment/client/spi/RedisClientBuildItem.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,27 @@ | ||
package io.quarkus.redis.deployment.client.spi; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
import io.vertx.mutiny.redis.client.Redis; | ||
|
||
/** | ||
* Provides runtime access to the Redis clients, in the Mutiny variant. | ||
*/ | ||
public final class RedisClientBuildItem extends MultiBuildItem { | ||
private final Supplier<Redis> client; | ||
private final String name; | ||
|
||
public RedisClientBuildItem(Supplier<Redis> client, String name) { | ||
this.client = client; | ||
this.name = name; | ||
} | ||
|
||
public Supplier<Redis> getClient() { | ||
return client; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...client/RequestedRedisClientBuildItem.java → ...nt/spi/RequestedRedisClientBuildItem.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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-redis-client-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-redis-client-runtime-spi</artifactId> | ||
<name>Quarkus - Redis Client - Runtime SPI</name> | ||
|
||
</project> |
7 changes: 7 additions & 0 deletions
7
...s/redis-client/runtime-spi/src/main/java/io/quarkus/redis/runtime/spi/RedisConstants.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,7 @@ | ||
package io.quarkus.redis.runtime.spi; | ||
|
||
public class RedisConstants { | ||
public static final String REDIS_CONFIG_ROOT_NAME = "redis"; | ||
public static final String HOSTS_CONFIG_NAME = "hosts"; | ||
public static final String DEFAULT_CLIENT_NAME = "<default>"; | ||
} |
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