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
46 changes: 15 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,34 +87,18 @@ Redis OM Spring provides all Spring Data Redis capabilities, plus:
- `@Vectorize` annotation to generate embeddings for text and images for use in Vector Similarity Searches
- Vector Similarity Search API (See [Redis Stack Vectors](https://redis.io/docs/stack/search/reference/vectors/))

### 📋 Version Requirements

Redis OM Spring has the following version requirements:

| Dependency | Minimum Version | Recommended Version | Notes |
|------------|----------------|-------------------|--------|
| **Spring Boot** | 3.3.x | 3.4.x or 3.5.x | Built with Spring Boot 3.4.5 |
| **Spring Data Redis** | 3.4.1 | 3.4.5 or later | Aligned with Spring Boot version |
| **Spring Framework** | 6.2.x | Latest 6.x | Transitive via Spring Boot |
| **Jedis** | 5.2.0 | 5.2.0 or later | Redis Java client |
| **Java** | 17 | 17 or 21 | Spring Boot 3.x requires Java 17+ |
| **Redis Stack** | 6.2.x | 7.2.x or later | For JSON and Search modules |

#### Spring Boot Version Compatibility Policy

Redis OM Spring follows an **N-2 support policy** for Spring Boot versions:

- We build with the latest stable Spring Boot version
- We support the current version and two previous minor versions that are still receiving OSS updates
- We upgrade Spring Boot with each Redis OM Spring release

For example, as of Redis OM Spring 1.0.0-RC4:

- **Built with**: Spring Boot 3.4.5
- **Minimum supported**: Spring Boot 3.3.x
- **Recommended**: Spring Boot 3.4.x or 3.5.x

⚠️ **Note**: Using older Spring Boot versions may work but is not officially tested or supported. For production use, we recommend staying within the supported version range.
> [!IMPORTANT]
> ### 📋 Version Compatibility
>
> Choose the correct Redis OM Spring version for your Spring Boot version:
>
> | Redis OM Spring | Spring Boot | Java | Status |
> |-----------------|-------------|------|--------|
> | **1.0.x** | 3.4.x | 17+ | Maintenance |
> | **1.1.x** | 3.5.x | 17+ | Current Stable |
> | **2.0.x** | 4.0.x | 17+ | Latest |
>
> **Always use the Redis OM Spring version that matches your Spring Boot version.**

## 🏁 Getting Started

Expand Down Expand Up @@ -492,7 +476,7 @@ This will unlock powerful AI-driven features for your applications, making data

For Maven, things normally just work, when you run `./mvnw spring-boot:run`. Some users have experienced this not being
the case, in which I recommend to explicitly declaring the `maven-compiler-plugin` in the case below it is paired with
an app created with [`start.spring.io`](https://start.spring.io/) with Spring Boot `v3.3.0` (all other versions can be
an app created with [`start.spring.io`](https://start.spring.io/) with Spring Boot `v4.0.0` (all other versions can be
inherited from the parent poms):

```xml
Expand All @@ -505,7 +489,7 @@ inherited from the parent poms):
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>3.3.0</version>
<version>4.0.0</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
Expand All @@ -515,7 +499,7 @@ inherited from the parent poms):
<path>
<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring</artifactId>
<version>1.0.0-RC.1</version>
<version>2.0.0</version>
</path>
</annotationProcessorPaths>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion demos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies {
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"

// Optional dependencies used by some demos
implementation 'com.github.javafaker:javafaker:1.0.2'
Expand Down
2 changes: 2 additions & 0 deletions demos/roms-amr-entraid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
3 changes: 2 additions & 1 deletion demos/roms-documents/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;

Expand Down
2 changes: 2 additions & 0 deletions demos/roms-hashes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
4 changes: 3 additions & 1 deletion demos/roms-modeling/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-resttestclient'
testImplementation 'org.springframework.boot:spring-boot-data-redis'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
testImplementation 'org.mockito:mockito-core'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.data.redis.autoconfigure.DataRedisAutoConfiguration;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
Expand All @@ -24,7 +24,7 @@

@TestConfiguration
@AutoConfigureAfter(
RedisAutoConfiguration.class
DataRedisAutoConfiguration.class
)
@Testcontainers
@Disabled(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.resttestclient.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ActiveProfiles;
Expand Down
6 changes: 5 additions & 1 deletion demos/roms-multi-acl-account/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ repositories {
dependencies {
implementation project(':redis-om-spring')

// Spring Boot Data Redis (for auto-configuration classes in Spring Boot 4.0)
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-data-redis'

// Important for RedisOM annotation processing!
annotationProcessor project(':redis-om-spring')
testAnnotationProcessor project(':redis-om-spring')
Expand All @@ -44,7 +48,7 @@ dependencies {
// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.data.redis.autoconfigure.DataRedisRepositoriesAutoConfiguration;

@SpringBootApplication
@SpringBootApplication(
exclude = DataRedisRepositoriesAutoConfiguration.class
)
public class RomsMultiAclAccountApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.autoconfigure.thread.Threading;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.data.redis.autoconfigure.DataRedisProperties;
import org.springframework.boot.thread.Threading;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
Expand All @@ -32,15 +32,15 @@

@Configuration
@EnableConfigurationProperties(
{ RedisProperties.class }
{ DataRedisProperties.class }
)
public class RedisConnectionFactoryConfig {

private static final Log logger = LogFactory.getLog(RedisConnectionFactoryConfig.class);

private final RedisProperties redisProperties;
private final DataRedisProperties redisProperties;

public RedisConnectionFactoryConfig(RedisProperties redisProperties) {
public RedisConnectionFactoryConfig(DataRedisProperties redisProperties) {
this.redisProperties = redisProperties;
}

Expand Down
2 changes: 1 addition & 1 deletion demos/roms-multitenant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies {
// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@
import com.redis.om.spring.indexing.RediSearchIndexer;
import com.redis.testcontainers.RedisStackContainer;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Configuration;

@Testcontainers
@SpringBootTest
@SpringBootTest(classes = RomsMultitenantApplicationTests.Config.class,
properties = { "spring.main.allow-bean-definition-overriding=true" })
class RomsMultitenantApplicationTests {

@SpringBootApplication
@Configuration
static class Config extends TestConfig {
}

@Container
static RedisStackContainer redis = new RedisStackContainer(
RedisStackContainer.DEFAULT_IMAGE_NAME.withTag(RedisStackContainer.DEFAULT_TAG));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.redis.om.multitenant;

import java.time.Duration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;

import redis.clients.jedis.JedisPoolConfig;

public class TestConfig {
@Autowired
Environment env;

@Bean
public JedisConnectionFactory jedisConnectionFactory() {
String host = env.getProperty("spring.data.redis.host", "localhost");
int port = env.getProperty("spring.data.redis.port", Integer.class, 6379);

RedisStandaloneConfiguration conf = new RedisStandaloneConfiguration(host, port);

final JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setTestWhileIdle(false);
poolConfig.setMinEvictableIdleDuration(Duration.ofMillis(60000));
poolConfig.setTimeBetweenEvictionRuns(Duration.ofMillis(30000));
poolConfig.setNumTestsPerEvictionRun(-1);

final int timeout = 10000;

final JedisClientConfiguration jedisClientConfiguration = JedisClientConfiguration.builder().connectTimeout(Duration
.ofMillis(timeout)).readTimeout(Duration.ofMillis(timeout)).usePooling().poolConfig(poolConfig).build();

return new JedisConnectionFactory(conf, jedisClientConfiguration);
}

@Bean
public StringRedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) {
StringRedisTemplate template = new StringRedisTemplate();
template.setConnectionFactory(connectionFactory);

return template;
}
}
2 changes: 2 additions & 0 deletions demos/roms-permits/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
4 changes: 3 additions & 1 deletion demos/roms-vectorizers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-resttestclient'
testImplementation 'org.springframework.boot:spring-boot-data-redis'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
testImplementation 'org.mockito:mockito-core'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.data.redis.autoconfigure.DataRedisAutoConfiguration;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
Expand All @@ -24,7 +24,7 @@

@TestConfiguration
@AutoConfigureAfter(
RedisAutoConfiguration.class
DataRedisAutoConfiguration.class
)
@Testcontainers
@Disabled(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.resttestclient.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ActiveProfiles;
Expand Down
2 changes: 2 additions & 0 deletions demos/roms-vss-movies/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
2 changes: 2 additions & 0 deletions demos/roms-vss/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ dependencies {

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter:1.20.4"
}

// Use -parameters flag for Spring
Expand Down
Loading