Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/src/content/docs/valkey/drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The following overview explains features that are supported by the individual Va
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<version>2.4.0</version>
<version>${version}</version>
</dependency>
</dependencies>
```
Expand Down Expand Up @@ -136,7 +136,7 @@ For more detailed client configuration options, see `io.valkey.springframework.d
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>6.3.2.RELEASE</version>
<version>${version}</version>
</dependency>

</dependencies>
Expand Down Expand Up @@ -212,7 +212,7 @@ Netty currently supports the epoll (Linux) and kqueue (BSD/macOS) interfaces for
<dependency>
<groupId>valkey.clients</groupId>
<artifactId>jedis</artifactId>
<version>5.1.2</version>
<version>${version}</version>
</dependency>

</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<springdata.parent.version>4.1.0</springdata.parent.version>

<!-- Valkey/Redis client versions -->
<valkey-glide.version>2.4.2</valkey-glide.version>
<valkey-glide.version>2.5.2</valkey-glide.version>
<lettuce.version>7.5.2.RELEASE</lettuce.version>
<jedis.version>7.4.1</jedis.version>
<pool.version>2.12.0</pool.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ else if (!password.equals(ValkeyPassword.none())) {
subConfigBuilder.callback((msg, context) -> this.listener.onMessage(msg, context));
configBuilder.subscriptionConfiguration(subConfigBuilder.build());

// Set library name for server-side client identification
configBuilder.libName("GlideSpringDataValkey");
// Report as GlideJava(SpringDataValkey), preserving the underlying driver identity.
configBuilder.clientInfoTag(CLIENT_INFO_TAG);

// Build and create cluster client
GlideClusterClientConfiguration config = configBuilder.build();
Expand Down Expand Up @@ -415,8 +415,11 @@ public Object customCommand(GlideString[] args) throws InterruptedException, Exe
ClusterValue<?> clusterValue = nextCommandRoute == null ? glideClusterClient.customCommand(args).get()
: glideClusterClient.customCommand(args, nextCommandRoute).get();

// Case 1: Explicit multi-node route - return multiValue for aggregation
if (needToAggregateResult(nextCommandRoute)) {
// Case 1: Explicit multi-node route - return multiValue for aggregation.
// Guard with hasMultiData(): some commands routed to all primaries (e.g. SAVE)
// return a single value rather than a per-node map, in which case we fall
// through to single-value handling instead of failing.
if (needToAggregateResult(nextCommandRoute) && clusterValue.hasMultiData()) {
return clusterValue.getMultiValue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ else if (!password.equals(ValkeyPassword.none())) {
subConfigBuilder.callback((msg, context) -> this.listener.onMessage(msg, context));
configBuilder.subscriptionConfiguration(subConfigBuilder.build());

// Set library name for server-side client identification
configBuilder.libName("GlideSpringDataValkey");
// Report as GlideJava(SpringDataValkey), preserving the underlying driver identity.
configBuilder.clientInfoTag(CLIENT_INFO_TAG);

// Build and create client
GlideClientConfiguration config = configBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
*/
interface UnifiedGlideClient extends AutoCloseable {

/**
* Client information tag reported to the server via GLIDE's {@code clientInfoTag}, producing a
* lib-name of {@code GlideJava(SpringDataValkey)} for server-side identification.
*/
String CLIENT_INFO_TAG = "SpringDataValkey";

public enum BatchStatus {

None, Pipeline, Transaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ public Long lastSave() {
(Map<String, Long> rawResult) -> rawResult.isEmpty() ? null : Collections.max(rawResult.values()));
}

Comment thread
jeremyprime marked this conversation as resolved.
@Override
public void save() {
// valkey-glide default route is "random", so we specify ALL_PRIMARIES
connection.execute(SimpleMultiNodeRoute.ALL_PRIMARIES, "SAVE", (Map<String, ?> rawResult) -> null);
// valkey-glide default route is "random", so we specify ALL_PRIMARIES.
// GLIDE 2.5.x aggregates SAVE to a single value (rather than a per-node map);
// the response is discarded, so accept Object.
connection.execute(SimpleMultiNodeRoute.ALL_PRIMARIES, "SAVE", (Object rawResult) -> null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ void testGetClientListOnSpecificNode() {
@EnabledOnValkeyVersion("7.2")
void testClientLibNameReported() {
List<ValkeyClientInfo> clientList = clusterConnection.serverCommands().getClientList();
assertThat(clientList).anyMatch(client -> "GlideSpringDataValkey".equals(client.get("lib-name")));
assertThat(clientList).anyMatch(
client -> client.get("lib-name") != null && client.get("lib-name").contains("(SpringDataValkey)"));
}

// ==================== Cluster-Wide Routing and Aggregation Verification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ void testGetClientList() {
@EnabledOnValkeyVersion("7.2")
void testClientLibNameReported() {
List<ValkeyClientInfo> clientList = connection.serverCommands().getClientList();
assertThat(clientList).anyMatch(client -> "GlideSpringDataValkey".equals(client.get("lib-name")));
assertThat(clientList).anyMatch(
client -> client.get("lib-name") != null && client.get("lib-name").contains("(SpringDataValkey)"));
}

@Test
Expand Down
Loading