#291 - Upgraded to Spring Boot 1.5.6.
Upgraded to Boot 1.5.6. Updated dependencies of reactive projects to latest versions to make sure the APIs of Boot work with the changes in Spring Data Kay RC1. Upgraded all other dependencies to match and got both the Redis and the Cassandra examples to compile again. Disabled Cassandra reactive samples for now as they fail at runtime.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<module>util</module>
|
||||
<module>example</module>
|
||||
<module>java8</module>
|
||||
<module>reactive</module>
|
||||
<!--<module>reactive</module>-->
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
<name>Spring Data Cassandra - Reactive features</name>
|
||||
|
||||
<properties>
|
||||
<spring-data-releasetrain.version>Kay-M1</spring-data-releasetrain.version>
|
||||
<spring.version>5.0.0.M3</spring.version>
|
||||
<reactor.version>3.0.3.RELEASE</reactor.version>
|
||||
<rxjava.version>1.2.1</rxjava.version>
|
||||
<rxjava-reactive-streams.version>1.2.0</rxjava-reactive-streams.version>
|
||||
<spring-data-releasetrain.version>Kay-RC2</spring-data-releasetrain.version>
|
||||
<spring.version>5.0.0.RC3</spring.version>
|
||||
<reactor.version>3.1.0.M3</reactor.version>
|
||||
<rxjava.version>2.1.3</rxjava.version>
|
||||
<rxjava-reactive-streams.version>1.2.1</rxjava-reactive-streams.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -26,11 +26,6 @@
|
||||
<artifactId>spring-data-commons</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-cql</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-cassandra</artifactId>
|
||||
@@ -42,7 +37,7 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.reactivex</groupId>
|
||||
<groupId>io.reactivex.rxjava2</groupId>
|
||||
<artifactId>rxjava</artifactId>
|
||||
<version>${rxjava.version}</version>
|
||||
</dependency>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -16,8 +16,8 @@
|
||||
package example.springdata.cassandra.people;
|
||||
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.data.cassandra.config.AbstractReactiveCassandraConfiguration;
|
||||
import org.springframework.data.cassandra.config.SchemaAction;
|
||||
import org.springframework.data.cassandra.config.java.AbstractReactiveCassandraConfiguration;
|
||||
import org.springframework.data.cassandra.repository.config.EnableReactiveCassandraRepositories;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -19,9 +19,9 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import org.springframework.cassandra.core.PrimaryKeyType;
|
||||
import org.springframework.data.cassandra.mapping.PrimaryKeyColumn;
|
||||
import org.springframework.data.cassandra.mapping.Table;
|
||||
import org.springframework.data.cassandra.core.cql.PrimaryKeyType;
|
||||
import org.springframework.data.cassandra.core.mapping.PrimaryKeyColumn;
|
||||
import org.springframework.data.cassandra.core.mapping.Table;
|
||||
|
||||
/**
|
||||
* An entity to represent a Person.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -15,18 +15,18 @@
|
||||
*/
|
||||
package example.springdata.cassandra.people;
|
||||
|
||||
import rx.Observable;
|
||||
import rx.Single;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Single;
|
||||
|
||||
import org.springframework.data.cassandra.repository.Query;
|
||||
import org.springframework.data.repository.reactive.RxJava1CrudRepository;
|
||||
import org.springframework.data.repository.reactive.RxJava2CrudRepository;
|
||||
|
||||
/**
|
||||
* Repository interface to manage {@link Person} instances.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public interface RxJava1PersonRepository extends RxJava1CrudRepository<Person, String> {
|
||||
public interface RxJava2PersonRepository extends RxJava2CrudRepository<Person, String> {
|
||||
|
||||
/**
|
||||
* Derived query selecting by {@code lastname}.
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -77,7 +77,7 @@ public class ReactiveCassandraTemplateIntegrationTest {
|
||||
.last() //
|
||||
.flatMap(v -> template.count(Person.class)) //
|
||||
.doOnNext(System.out::println) //
|
||||
.doOnComplete(countDownLatch::countDown) //
|
||||
.doOnSuccess(it -> countDownLatch.countDown()) //
|
||||
.doOnError(throwable -> countDownLatch.countDown()) //
|
||||
.subscribe();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -52,7 +52,7 @@ public class ReactivePersonRepositoryIntegrationTest {
|
||||
public void setUp() {
|
||||
|
||||
repository.deleteAll() //
|
||||
.thenMany(repository.save(Flux.just(new Person("Walter", "White", 50), //
|
||||
.thenMany(repository.saveAll(Flux.just(new Person("Walter", "White", 50), //
|
||||
new Person("Skyler", "White", 45), //
|
||||
new Person("Saul", "Goodman", 42), //
|
||||
new Person("Jesse", "Pinkman", 27))))
|
||||
@@ -70,12 +70,12 @@ public class ReactivePersonRepositoryIntegrationTest {
|
||||
|
||||
repository.count() //
|
||||
.doOnNext(System.out::println) //
|
||||
.thenMany(repository.save(Flux.just(new Person("Hank", "Schrader", 43), //
|
||||
.thenMany(repository.saveAll(Flux.just(new Person("Hank", "Schrader", 43), //
|
||||
new Person("Mike", "Ehrmantraut", 62)))) //
|
||||
.last() //
|
||||
.flatMap(v -> repository.count()) //
|
||||
.doOnNext(System.out::println) //
|
||||
.doOnComplete(countDownLatch::countDown) //
|
||||
.doOnSuccess(it -> countDownLatch.countDown()) //
|
||||
.doOnError(throwable -> countDownLatch.countDown()) //
|
||||
.subscribe();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -18,9 +18,9 @@ package example.springdata.cassandra.people;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import example.springdata.cassandra.util.CassandraKeyspace;
|
||||
import rx.Completable;
|
||||
import rx.Observable;
|
||||
import rx.Single;
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.Flowable;
|
||||
import io.reactivex.Single;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@@ -35,7 +35,7 @@ import org.springframework.data.cassandra.core.ReactiveCassandraOperations;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
/**
|
||||
* Integration test for {@link RxJava1PersonRepository} using RxJava1 types. Note that
|
||||
* Integration test for {@link RxJava2PersonRepository} using RxJava1 types. Note that
|
||||
* {@link ReactiveCassandraOperations} is only available using Project Reactor types as the native Template API
|
||||
* implementation does not come in multiple reactive flavors.
|
||||
*
|
||||
@@ -43,11 +43,11 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class RxJava1PersonRepositoryIntegrationTest {
|
||||
public class RxJava2PersonRepositoryIntegrationTest {
|
||||
|
||||
@ClassRule public final static CassandraKeyspace CASSANDRA_KEYSPACE = CassandraKeyspace.onLocalhost();
|
||||
|
||||
@Autowired RxJava1PersonRepository repository;
|
||||
@Autowired RxJava2PersonRepository repository;
|
||||
@Autowired ReactiveCassandraOperations operations;
|
||||
|
||||
@Before
|
||||
@@ -55,12 +55,12 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
|
||||
Completable deleteAll = repository.deleteAll();
|
||||
|
||||
Observable<Person> save = repository.save(Observable.just(new Person("Walter", "White", 50), //
|
||||
Flowable<Person> save = repository.saveAll(Flowable.just(new Person("Walter", "White", 50), //
|
||||
new Person("Skyler", "White", 45), //
|
||||
new Person("Saul", "Goodman", 42), //
|
||||
new Person("Jesse", "Pinkman", 27)));
|
||||
|
||||
deleteAll.andThen(save).toBlocking().last();
|
||||
deleteAll.andThen(save).blockingLast();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,10 +73,10 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
|
||||
repository.count() //
|
||||
.doOnSuccess(System.out::println) //
|
||||
.toObservable() //
|
||||
.switchMap(count -> repository.save(Observable.just(new Person("Hank", "Schrader", 43), //
|
||||
.toFlowable() //
|
||||
.switchMap(count -> repository.saveAll(Flowable.just(new Person("Hank", "Schrader", 43), //
|
||||
new Person("Mike", "Ehrmantraut", 62)))) //
|
||||
.last() //
|
||||
.lastElement() //
|
||||
.toSingle() //
|
||||
.flatMap(v -> repository.count()) //
|
||||
.doOnSuccess(System.out::println) //
|
||||
@@ -98,7 +98,7 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
|
||||
repository.findAll() //
|
||||
.doOnNext(System.out::println) //
|
||||
.doOnCompleted(countDownLatch::countDown) //
|
||||
.doOnEach(it -> countDownLatch.countDown()) //
|
||||
.doOnError(throwable -> countDownLatch.countDown()) //
|
||||
.subscribe();
|
||||
|
||||
@@ -113,8 +113,7 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
|
||||
List<Person> whites = repository.findByLastname("White") //
|
||||
.toList() //
|
||||
.toBlocking() //
|
||||
.last();
|
||||
.blockingGet();
|
||||
|
||||
assertThat(whites).hasSize(2);
|
||||
}
|
||||
@@ -126,8 +125,7 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
public void shouldQueryDataWithStringQuery() {
|
||||
|
||||
Person heisenberg = repository.findByFirstnameAndLastname("Walter", "White") //
|
||||
.toBlocking() //
|
||||
.value();
|
||||
.blockingGet();
|
||||
|
||||
assertThat(heisenberg).isNotNull();
|
||||
}
|
||||
@@ -140,8 +138,7 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
|
||||
List<Person> whites = repository.findByLastname(Single.just("White")) //
|
||||
.toList() //
|
||||
.toBlocking() //
|
||||
.single();
|
||||
.blockingGet();
|
||||
|
||||
assertThat(whites).hasSize(2);
|
||||
}
|
||||
@@ -153,7 +150,7 @@ public class RxJava1PersonRepositoryIntegrationTest {
|
||||
public void shouldQueryDataWithMixedDeferredQueryDerivation() {
|
||||
|
||||
Person heisenberg = repository.findByFirstnameAndLastname(Single.just("Walter"), "White") //
|
||||
.toBlocking().value();
|
||||
.blockingGet();
|
||||
|
||||
assertThat(heisenberg).isNotNull();
|
||||
}
|
||||
2
pom.xml
2
pom.xml
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.5.4.RELEASE</version>
|
||||
<version>1.5.6.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<spring-data-releasetrain.version>Kay-M1</spring-data-releasetrain.version>
|
||||
<spring.version>5.0.0.M3</spring.version>
|
||||
<reactor.version>3.0.3.RELEASE</reactor.version>
|
||||
<lettuce.version>5.0.0.Beta1</lettuce.version>
|
||||
<spring-data-releasetrain.version>Kay-RC2</spring-data-releasetrain.version>
|
||||
<spring.version>5.0.0.RC3</spring.version>
|
||||
<reactor.version>3.1.0.M3</reactor.version>
|
||||
<lettuce.version>5.0.0.RC1</lettuce.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -32,8 +32,8 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>biz.paluch.redis</groupId>
|
||||
<artifactId>lettuce</artifactId>
|
||||
<groupId>io.lettuce</groupId>
|
||||
<artifactId>lettuce-core</artifactId>
|
||||
<version>${lettuce.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2017 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.
|
||||
@@ -15,6 +15,11 @@
|
||||
*/
|
||||
package example.springdata.redis.commands;
|
||||
|
||||
import example.springdata.redis.RedisTestConfiguration;
|
||||
import example.springdata.redis.test.util.RequiresRedisServer;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.time.Duration;
|
||||
import java.util.Collections;
|
||||
@@ -28,17 +33,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.redis.connection.ReactiveListCommands.PopResult;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisConnection;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.ReactiveStringCommands.SetCommand;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import example.springdata.redis.RedisTestConfiguration;
|
||||
import example.springdata.redis.test.util.RequiresRedisServer;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* Show usage of reactive operations on Redis keys using low level API provided by {@link RedisConnectionFactory}.
|
||||
*
|
||||
@@ -54,7 +55,7 @@ public class KeyOperationsTests {
|
||||
private static final String PREFIX = KeyOperationsTests.class.getSimpleName();
|
||||
private static final String KEY_PATTERN = PREFIX + "*";
|
||||
|
||||
@Autowired RedisConnectionFactory connectionFactory;
|
||||
@Autowired ReactiveRedisConnectionFactory connectionFactory;
|
||||
|
||||
private ReactiveRedisConnection connection;
|
||||
private RedisSerializer<String> serializer = new StringRedisSerializer();
|
||||
@@ -76,7 +77,7 @@ public class KeyOperationsTests {
|
||||
|
||||
this.connection.keyCommands() //
|
||||
.keys(ByteBuffer.wrap(serializer.serialize(KEY_PATTERN))) //
|
||||
.flatMap(Flux::fromIterable) //
|
||||
.flatMapMany(Flux::fromIterable) //
|
||||
.doOnNext(byteBuffer -> System.out.println(toString(byteBuffer))) //
|
||||
.count() //
|
||||
.doOnSuccess(count -> System.out.println(String.format("Total No. found: %s", count))) //
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<dependency>
|
||||
<groupId>org.xmlbeam</groupId>
|
||||
<artifactId>xmlprojector</artifactId>
|
||||
<version>1.4.8</version>
|
||||
<version>1.4.13</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
logging.level.org.springframework.web=DEBUG
|
||||
logging.level.org.springframework.boot=DEBUG
|
||||
|
||||
Reference in New Issue
Block a user