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
1 change: 0 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Spring Data Valkey is a Spring Data module providing first-class Valkey/Redis in

**Driver Notes:**

- Valkey GLIDE requires `${os.detected.classifier}` (platform-specific JAR) and the `os-maven-plugin` build extension
- Sentinel support is available in Lettuce and Jedis only — GLIDE does not support Sentinel at this time

## Architecture Quick Facts
Expand Down
28 changes: 2 additions & 26 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,10 @@ Update your `pom.xml`:
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${version}</version>
</dependency>
```

Valkey GLIDE requires platform-specific native libraries. Add the os-maven-plugin to resolve `${os.detected.classifier}`:

```xml
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
</build>
```

Note: You can continue using Lettuce or Jedis if preferred by setting `spring.data.valkey.client-type=lettuce` or `spring.data.valkey.client-type=jedis`.

#### Gradle
Expand All @@ -63,15 +48,7 @@ implementation 'org.springframework.boot:spring-boot-starter-data-redis'

// After
implementation 'io.valkey.springframework.boot:spring-boot-starter-data-valkey:${version}'
implementation "io.valkey:valkey-glide:${version}:${osdetector.classifier}"
```

Add the osdetector plugin to resolve `${osdetector.classifier}`:

```groovy
plugins {
id 'com.google.osdetector' version '1.7.3'
}
implementation 'io.valkey:valkey-glide:${version}'
```

### Vanilla Spring
Expand All @@ -97,7 +74,6 @@ Update your `pom.xml`:
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${version}</version>
</dependency>
```
Expand All @@ -112,7 +88,7 @@ implementation 'org.springframework.data:spring-data-redis:${version}'

// After
implementation 'io.valkey.springframework.data:spring-data-valkey:${version}'
implementation "io.valkey:valkey-glide:${version}:${osdetector.classifier}"
implementation 'io.valkey:valkey-glide:${version}'
```

## Package Name Changes
Expand Down
4 changes: 1 addition & 3 deletions docs/src/content/docs/valkey/drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ The following overview explains features that are supported by the individual Va
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<version>2.3.0</version>
<classifier>linux-x86_64</classifier>
<version>2.4.0</version>
</dependency>
Comment thread
jeremyprime marked this conversation as resolved.

</dependencies>
```

Expand Down
7 changes: 0 additions & 7 deletions examples/boot-iam-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
7 changes: 0 additions & 7 deletions examples/boot-telemetry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
8 changes: 0 additions & 8 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,11 @@
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${valkey-glide.version}</version>
</dependency>
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
Expand Down
7 changes: 0 additions & 7 deletions examples/spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
8 changes: 0 additions & 8 deletions performance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${valkey-glide.version}</version>
</dependency>
<dependency>
Expand All @@ -52,13 +51,6 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
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>3.5.1</springdata.parent.version>

<!-- Valkey/Redis client versions -->
<valkey-glide.version>2.3.0-rc2</valkey-glide.version>
<valkey-glide.version>2.4.0</valkey-glide.version>
<lettuce.version>6.6.0.RELEASE</lettuce.version>
<jedis.version>6.0.0</jedis.version>
<pool.version>2.11.1</pool.version>
Expand Down
25 changes: 4 additions & 21 deletions spring-boot-starter-data-valkey/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,23 @@ Add the starter and Valkey GLIDE dependencies:
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${version}</version>
</dependency>
</dependencies>
```

Add the os-maven-plugin for platform-specific GLIDE libraries:

```xml
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
</build>
```

Or to your `build.gradle`:

```gradle
plugins {
id 'com.google.osdetector' version '1.7.3'
}

dependencies {
implementation 'io.valkey.springframework.boot:spring-boot-starter-data-valkey:${version}'
implementation 'io.valkey:valkey-glide:${version}:${osdetector.classifier}'
implementation 'io.valkey:valkey-glide:${version}'
}
```

Note: The Valkey GLIDE dependency must also be explicitly added due to the OS classifier (platform-specific JAR). To use the Lettuce or Jedis driver instead, add their dependencies and set `spring.data.valkey.client-type` accordingly.
To use platform specific Valkey GLIDE dependency and reduce the Jar size, see Valkey GLIDE installation [guide](https://glide.valkey.io/how-to/installation?lang=java).

To use the Lettuce or Jedis driver instead, add their dependencies and set `spring.data.valkey.client-type` accordingly.

## Getting Started

Expand Down
8 changes: 0 additions & 8 deletions spring-boot-starter-data-valkey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${valkey-glide.version}</version>
</dependency>

Expand Down Expand Up @@ -262,13 +261,6 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<!-- Flatten plugin for Maven Central deployment -->
<plugin>
Expand Down
15 changes: 0 additions & 15 deletions spring-data-valkey/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,10 @@ Add the Spring Data Valkey and Valkey GLIDE dependencies:
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${version}</version>
</dependency>
```

Add the os-maven-plugin for platform-specific GLIDE libraries:

```xml
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
</build>
```

## Getting Started

### Basic Configuration
Expand Down
8 changes: 0 additions & 8 deletions spring-data-valkey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
<dependency>
<groupId>io.valkey</groupId>
<artifactId>valkey-glide</artifactId>
<classifier>${os.detected.classifier}</classifier>
<version>${valkey-glide.version}</version>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -325,13 +324,6 @@
</dependencies>

<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>

<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* Copyright 2026 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.valkey.springframework.data.valkey.connection.valkeyglide;

import static org.assertj.core.api.Assertions.*;

import java.util.Set;

import org.junit.jupiter.api.Test;

import io.valkey.springframework.data.valkey.connection.valkeyglide.extension.ValkeyGlideConnectionFactoryExtension;
import io.valkey.springframework.data.valkey.core.StringValkeyTemplate;
import io.valkey.springframework.data.valkey.core.ZSetOperations;
import io.valkey.springframework.data.valkey.test.condition.EnabledOnValkeyClusterAvailable;
import io.valkey.springframework.data.valkey.test.extension.ValkeyCluster;
import io.valkey.springframework.data.valkey.test.extension.ValkeyStanalone;
Comment thread
jeremyprime marked this conversation as resolved.

/**
* Integration tests verifying that ZSet rangeWithScores operations maintain
* score-based ordering for both standalone and cluster connections.
*
* @see <a href="https://github.com/valkey-io/spring-data-valkey/issues/36">Issue #36</a>
* @see <a href="https://github.com/valkey-io/valkey-glide/issues/4963">Glide #4963</a>
*/
class ValkeyGlideZSetOrderingIntegrationTests {

@Test
void rangeWithScoresStandaloneOrder() {
StringValkeyTemplate template = new StringValkeyTemplate(
ValkeyGlideConnectionFactoryExtension.getConnectionFactory(ValkeyStanalone.class));
try {
ZSetOperations<String, String> opsForZSet = template.opsForZSet();

opsForZSet.add("testKey", "value1", 2.0);
opsForZSet.add("testKey", "value2", 1.0);
opsForZSet.add("testKey", "value3", 4.0);
opsForZSet.add("testKey", "value4", 3.0);

Set<String> rangeResult = opsForZSet.range("testKey", 0, 3);
String[] rangeArray = rangeResult.toArray(new String[0]);
assertThat(rangeArray[0]).isEqualTo("value2");
assertThat(rangeArray[1]).isEqualTo("value1");
assertThat(rangeArray[2]).isEqualTo("value4");
assertThat(rangeArray[3]).isEqualTo("value3");

Set<ZSetOperations.TypedTuple<String>> rangeWithScoresResult = opsForZSet.rangeWithScores("testKey", 0, 3);
ZSetOperations.TypedTuple<String>[] tuplesArray = rangeWithScoresResult.toArray(new ZSetOperations.TypedTuple[0]);
assertThat(tuplesArray[0].getValue()).isEqualTo("value2");
assertThat(tuplesArray[1].getValue()).isEqualTo("value1");
assertThat(tuplesArray[2].getValue()).isEqualTo("value4");
assertThat(tuplesArray[3].getValue()).isEqualTo("value3");
} finally {
template.delete("testKey");
}
}

@Test
@EnabledOnValkeyClusterAvailable
void rangeWithScoresClusterOrder() {
StringValkeyTemplate template = new StringValkeyTemplate(
ValkeyGlideConnectionFactoryExtension.getConnectionFactory(ValkeyCluster.class));
try {
ZSetOperations<String, String> opsForZSet = template.opsForZSet();

opsForZSet.add("testKey", "value1", 2.0);
opsForZSet.add("testKey", "value2", 1.0);
opsForZSet.add("testKey", "value3", 4.0);
opsForZSet.add("testKey", "value4", 3.0);

Set<String> rangeResult = opsForZSet.range("testKey", 0, 3);
String[] rangeArray = rangeResult.toArray(new String[0]);
assertThat(rangeArray[0]).isEqualTo("value2");
assertThat(rangeArray[1]).isEqualTo("value1");
assertThat(rangeArray[2]).isEqualTo("value4");
assertThat(rangeArray[3]).isEqualTo("value3");

Set<ZSetOperations.TypedTuple<String>> rangeWithScoresResult = opsForZSet.rangeWithScores("testKey", 0, 3);
ZSetOperations.TypedTuple<String>[] tuplesArray = rangeWithScoresResult.toArray(new ZSetOperations.TypedTuple[0]);
assertThat(tuplesArray[0].getValue()).isEqualTo("value2");
assertThat(tuplesArray[1].getValue()).isEqualTo("value1");
assertThat(tuplesArray[2].getValue()).isEqualTo("value4");
assertThat(tuplesArray[3].getValue()).isEqualTo("value3");
} finally {
template.delete("testKey");
}
}
}
Loading