diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraDataAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraDataAutoConfiguration.java new file mode 100644 index 0000000000..140c23105f --- /dev/null +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraDataAutoConfiguration.java @@ -0,0 +1,71 @@ +/* + * Copyright 2012-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. + * You may obtain a copy of the License at + * + * http://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 org.springframework.boot.autoconfigure.data.cassandra; + +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.Session; +import reactor.core.publisher.Flux; +import reactor.core.scheduler.Schedulers; + +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.cassandra.core.session.DefaultBridgedReactiveSession; +import org.springframework.cassandra.core.session.DefaultReactiveSessionFactory; +import org.springframework.cassandra.core.session.ReactiveSession; +import org.springframework.cassandra.core.session.ReactiveSessionFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.cassandra.convert.CassandraConverter; +import org.springframework.data.cassandra.core.ReactiveCassandraTemplate; + +/** + * {@link EnableAutoConfiguration Auto-configuration} for Spring Data's reactive Cassandra + * support. + * + * @author Eddú Meléndez + * @since 2.0.0 + */ +@Configuration +@ConditionalOnClass({ Cluster.class, ReactiveCassandraTemplate.class, Flux.class }) +@ConditionalOnBean(Session.class) +@AutoConfigureAfter(CassandraDataAutoConfiguration.class) +public class ReactiveCassandraDataAutoConfiguration { + + @Bean + @ConditionalOnMissingBean(ReactiveSession.class) + public ReactiveSession reactiveCassandraSession(Session session) { + return new DefaultBridgedReactiveSession(session, Schedulers.elastic()); + } + + @Bean + public ReactiveSessionFactory reactiveCassandraSessionFactory( + ReactiveSession reactiveCassandraSession) { + return new DefaultReactiveSessionFactory(reactiveCassandraSession); + } + + @Bean + @ConditionalOnMissingBean + public ReactiveCassandraTemplate reactiveCassandraTemplate( + ReactiveSession reactiveCassandraSession, + CassandraConverter converter) { + return new ReactiveCassandraTemplate(reactiveCassandraSession, converter); + } + +} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfiguration.java new file mode 100644 index 0000000000..875f360b3f --- /dev/null +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfiguration.java @@ -0,0 +1,47 @@ +/* + * Copyright 2012-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. + * You may obtain a copy of the License at + * + * http://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 org.springframework.boot.autoconfigure.data.cassandra; + +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.cassandra.core.session.ReactiveSession; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.data.cassandra.repository.ReactiveCassandraRepository; +import org.springframework.data.cassandra.repository.config.EnableReactiveCassandraRepositories; +import org.springframework.data.cassandra.repository.support.ReactiveCassandraRepositoryFactoryBean; + +/** + * {@link EnableAutoConfiguration Auto-configuration} for Spring Data's Cassandra + * Reactive Repositories. + * + * @author Eddú Meléndez + * @since 2.0.0 + * @see EnableReactiveCassandraRepositories + */ +@Configuration +@ConditionalOnClass({ ReactiveSession.class, ReactiveCassandraRepository.class }) +@ConditionalOnProperty(prefix = "spring.data.cassandra.reactive-repositories", name = "enabled", havingValue = "true", matchIfMissing = true) +@ConditionalOnMissingBean(ReactiveCassandraRepositoryFactoryBean.class) +@Import(ReactiveCassandraRepositoriesAutoConfigureRegistrar.class) +@AutoConfigureAfter(ReactiveCassandraDataAutoConfiguration.class) +public class ReactiveCassandraRepositoriesAutoConfiguration { + +} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfigureRegistrar.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfigureRegistrar.java new file mode 100644 index 0000000000..bd8bf31b75 --- /dev/null +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfigureRegistrar.java @@ -0,0 +1,57 @@ +/* + * Copyright 2012-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. + * You may obtain a copy of the License at + * + * http://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 org.springframework.boot.autoconfigure.data.cassandra; + +import java.lang.annotation.Annotation; + +import org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport; +import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; +import org.springframework.data.cassandra.repository.config.EnableReactiveCassandraRepositories; +import org.springframework.data.cassandra.repository.config.ReactiveCassandraRepositoryConfigurationExtension; +import org.springframework.data.repository.config.RepositoryConfigurationExtension; + +/** + * {@link ImportBeanDefinitionRegistrar} used to auto-configure Spring Data Cassandra + * Reactive Repositories. + * + * @author Eddú Meléndez + * @since 2.0.0 + */ +class ReactiveCassandraRepositoriesAutoConfigureRegistrar + extends AbstractRepositoryConfigurationSourceSupport { + + @Override + protected Class getAnnotation() { + return EnableReactiveCassandraRepositories.class; + } + + @Override + protected Class getConfiguration() { + return EnableReactiveCassandraRepositoriesConfiguration.class; + } + + @Override + protected RepositoryConfigurationExtension getRepositoryConfigurationExtension() { + return new ReactiveCassandraRepositoryConfigurationExtension(); + } + + @EnableReactiveCassandraRepositories + private static class EnableReactiveCassandraRepositoriesConfiguration { + + } + +} diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 2363227335..9bb77b8370 100644 --- a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -84,6 +84,12 @@ "name": "spring.data.cassandra.compression", "defaultValue": "none" }, + { + "name": "spring.data.cassandra.reactive-repositories.enabled", + "type": "java.lang.Boolean", + "description": "Enable Cassandra reactive repositories.", + "defaultValue": true + }, { "name": "spring.data.couchbase.consistency", "defaultValue": "read-your-own-writes" diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories index 8c016073f8..8b5e9eed20 100644 --- a/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories @@ -31,6 +31,8 @@ org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration,\ org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration,\ org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration,\ org.springframework.boot.autoconfigure.data.cassandra.CassandraRepositoriesAutoConfiguration,\ +org.springframework.boot.autoconfigure.data.cassandra.ReactiveCassandraDataAutoConfiguration,\ +org.springframework.boot.autoconfigure.data.cassandra.ReactiveCassandraRepositoriesAutoConfiguration,\ org.springframework.boot.autoconfigure.data.couchbase.CouchbaseDataAutoConfiguration,\ org.springframework.boot.autoconfigure.data.couchbase.CouchbaseRepositoriesAutoConfiguration,\ org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration,\ diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/alt/cassandra/ReactiveCityCassandraRepository.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/alt/cassandra/ReactiveCityCassandraRepository.java new file mode 100644 index 0000000000..62f9b79701 --- /dev/null +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/alt/cassandra/ReactiveCityCassandraRepository.java @@ -0,0 +1,24 @@ +/* + * Copyright 2012-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. + * You may obtain a copy of the License at + * + * http://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 org.springframework.boot.autoconfigure.data.alt.cassandra; + +import org.springframework.boot.autoconfigure.data.cassandra.city.City; +import org.springframework.data.repository.reactive.ReactiveCrudRepository; + +public interface ReactiveCityCassandraRepository extends ReactiveCrudRepository { + +} diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraDataAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraDataAutoConfigurationTests.java new file mode 100644 index 0000000000..efb4b01abe --- /dev/null +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraDataAutoConfigurationTests.java @@ -0,0 +1,117 @@ +/* + * Copyright 2012-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. + * You may obtain a copy of the License at + * + * http://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 org.springframework.boot.autoconfigure.data.cassandra; + +import java.util.Set; + +import com.datastax.driver.core.Session; +import org.junit.After; +import org.junit.Test; + +import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration; +import org.springframework.boot.autoconfigure.data.cassandra.city.City; +import org.springframework.boot.autoconfigure.domain.EntityScan; +import org.springframework.boot.test.util.EnvironmentTestUtils; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.cassandra.core.ReactiveCassandraTemplate; +import org.springframework.data.cassandra.mapping.CassandraMappingContext; +import org.springframework.data.cassandra.mapping.SimpleUserTypeResolver; +import org.springframework.test.util.ReflectionTestUtils; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; + +/** + * Tests for {@link ReactiveCassandraDataAutoConfiguration}. + * + * @author Eddú Meléndez + * @author Stephane Nicoll + */ +public class ReactiveCassandraDataAutoConfigurationTests { + + private AnnotationConfigApplicationContext context; + + @After + public void close() { + if (this.context != null) { + this.context.close(); + } + } + + @Test + public void templateExists() { + load("spring.data.cassandra.keyspaceName:boot_test"); + assertThat(this.context.getBeanNamesForType(ReactiveCassandraTemplate.class)) + .hasSize(1); + } + + @Test + @SuppressWarnings("unchecked") + public void entityScanShouldSetInitialEntitySet() throws Exception { + load(EntityScanConfig.class, "spring.data.cassandra.keyspaceName:boot_test"); + CassandraMappingContext mappingContext = this.context + .getBean(CassandraMappingContext.class); + Set> initialEntitySet = (Set>) ReflectionTestUtils + .getField(mappingContext, "initialEntitySet"); + assertThat(initialEntitySet).containsOnly(City.class); + } + + @Test + public void userTypeResolverShouldBeSet() throws Exception { + load("spring.data.cassandra.keyspaceName:boot_test"); + CassandraMappingContext mappingContext = this.context + .getBean(CassandraMappingContext.class); + assertThat(ReflectionTestUtils.getField(mappingContext, "userTypeResolver")) + .isInstanceOf(SimpleUserTypeResolver.class); + } + + private void load(String... environment) { + load(null, environment); + } + + private void load(Class config, String... environment) { + AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); + EnvironmentTestUtils.addEnvironment(ctx, environment); + if (config != null) { + ctx.register(config); + } + ctx.register(TestConfiguration.class, CassandraAutoConfiguration.class, + CassandraDataAutoConfiguration.class, + ReactiveCassandraDataAutoConfiguration.class); + ctx.refresh(); + this.context = ctx; + } + + @Configuration + static class TestConfiguration { + + @Bean + public Session session() { + return mock(Session.class); + } + + } + + @Configuration + @EntityScan("org.springframework.boot.autoconfigure.data.cassandra.city") + static class EntityScanConfig { + + } + +} diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfigurationTests.java new file mode 100644 index 0000000000..f289cb41cd --- /dev/null +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/ReactiveCassandraRepositoriesAutoConfigurationTests.java @@ -0,0 +1,138 @@ +/* + * Copyright 2012-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. + * You may obtain a copy of the License at + * + * http://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 org.springframework.boot.autoconfigure.data.cassandra; + +import java.util.Set; + +import com.datastax.driver.core.Cluster; +import com.datastax.driver.core.Session; +import org.junit.After; +import org.junit.Test; + +import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; +import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration; +import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; +import org.springframework.boot.autoconfigure.data.alt.cassandra.ReactiveCityCassandraRepository; +import org.springframework.boot.autoconfigure.data.cassandra.city.City; +import org.springframework.boot.autoconfigure.data.cassandra.city.ReactiveCityRepository; +import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage; +import org.springframework.cassandra.core.session.ReactiveSession; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.ComponentScan.Filter; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.FilterType; +import org.springframework.data.cassandra.mapping.BasicCassandraMappingContext; +import org.springframework.data.cassandra.repository.config.EnableReactiveCassandraRepositories; +import org.springframework.test.util.ReflectionTestUtils; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; + +/** + * Tests for {@link ReactiveCassandraRepositoriesAutoConfiguration}. + * + * @author Eddú Meléndez + * @author Stephane Nicoll + */ +public class ReactiveCassandraRepositoriesAutoConfigurationTests { + + private AnnotationConfigApplicationContext context; + + @After + public void close() { + if (this.context != null) { + this.context.close(); + } + } + + @Test + public void testDefaultRepositoryConfiguration() { + load(TestConfiguration.class); + assertThat(this.context.getBean(ReactiveCityRepository.class)).isNotNull(); + assertThat(this.context.getBean(Cluster.class)).isNotNull(); + assertThat(getInitialEntitySet()).hasSize(1); + } + + @Test + public void testNoRepositoryConfiguration() { + load(TestExcludeConfiguration.class, EmptyConfiguration.class); + assertThat(this.context.getBean(Cluster.class)).isNotNull(); + assertThat(getInitialEntitySet()).hasSize(1).containsOnly(City.class); + } + + @Test + public void doesNotTriggerDefaultRepositoryDetectionIfCustomized() { + load(TestExcludeConfiguration.class, CustomizedConfiguration.class); + assertThat(this.context.getBean(ReactiveCityCassandraRepository.class)).isNotNull(); + assertThat(getInitialEntitySet()).hasSize(1).containsOnly(City.class); + } + + @SuppressWarnings("unchecked") + private Set> getInitialEntitySet() { + BasicCassandraMappingContext mappingContext = this.context + .getBean(BasicCassandraMappingContext.class); + return (Set>) ReflectionTestUtils.getField(mappingContext, + "initialEntitySet"); + } + + private void load(Class... configurations) { + AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); + ctx.register(configurations); + ctx.register(CassandraAutoConfiguration.class, + CassandraRepositoriesAutoConfiguration.class, + CassandraDataAutoConfiguration.class, + ReactiveCassandraDataAutoConfiguration.class, + ReactiveCassandraRepositoriesAutoConfiguration.class, + PropertyPlaceholderAutoConfiguration.class); + ctx.refresh(); + this.context = ctx; + } + + @Configuration + @TestAutoConfigurationPackage(City.class) + static class TestConfiguration { + + @Bean + public Session Session() { + return mock(Session.class); + } + + } + + @Configuration + @TestAutoConfigurationPackage(EmptyDataPackage.class) + static class EmptyConfiguration { + + } + + @Configuration + @TestAutoConfigurationPackage(ReactiveCassandraRepositoriesAutoConfigurationTests.class) + @EnableReactiveCassandraRepositories(basePackageClasses = ReactiveCityCassandraRepository.class) + static class CustomizedConfiguration { + + } + + @Configuration + @ComponentScan(excludeFilters = @Filter(classes = { + ReactiveSession.class }, type = FilterType.ASSIGNABLE_TYPE)) + static class TestExcludeConfiguration { + + } + +} diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/city/ReactiveCityRepository.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/city/ReactiveCityRepository.java new file mode 100644 index 0000000000..08224bb220 --- /dev/null +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/city/ReactiveCityRepository.java @@ -0,0 +1,23 @@ +/* + * Copyright 2012-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. + * You may obtain a copy of the License at + * + * http://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 org.springframework.boot.autoconfigure.data.cassandra.city; + +import org.springframework.data.repository.reactive.ReactiveCrudRepository; + +public interface ReactiveCityRepository extends ReactiveCrudRepository { + +} diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 53a96314e2..b76a598f6a 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -352,6 +352,11 @@ spring-boot-starter-data-cassandra 2.0.0.BUILD-SNAPSHOT + + org.springframework.boot + spring-boot-starter-data-cassandra-reactive + 2.0.0.BUILD-SNAPSHOT + org.springframework.boot spring-boot-starter-data-couchbase diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 3e5bb1617c..c74468b44d 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -573,6 +573,7 @@ content into your application; rather pick only the properties that you need. spring.data.cassandra.load-balancing-policy= # Class name of the load balancing policy. spring.data.cassandra.port= # Port of the Cassandra server. spring.data.cassandra.password= # Login password of the server. + spring.data.cassandra.reactive-repositories.enabled=true # Enable Cassandra reactive repositories. spring.data.cassandra.read-timeout-millis= # Socket option: read time out. spring.data.cassandra.reconnection-policy= # Reconnection policy class. spring.data.cassandra.repositories.enabled= # Enable Cassandra repositories. diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index b49990d3b4..21aa81a558 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -29,6 +29,7 @@ spring-boot-starter-cache spring-boot-starter-cloud-connectors spring-boot-starter-data-cassandra + spring-boot-starter-data-cassandra-reactive spring-boot-starter-data-couchbase spring-boot-starter-data-elasticsearch spring-boot-starter-data-jpa diff --git a/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/pom.xml b/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/pom.xml new file mode 100644 index 0000000000..388eeadb91 --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starters + 2.0.0.BUILD-SNAPSHOT + + spring-boot-starter-data-cassandra-reactive + Spring Boot Data Cassandra Reactive Starter + Starter for using Cassandra distributed database and Spring Data + Cassandra Reactive + + http://projects.spring.io/spring-boot/ + + Pivotal Software, Inc. + http://www.spring.io + + + ${basedir}/../.. + + + + org.springframework.boot + spring-boot-starter + + + org.springframework + spring-tx + + + org.springframework.data + spring-data-cassandra + + + org.slf4j + jcl-over-slf4j + + + + + org.springframework.data + spring-cql + + + io.projectreactor + reactor-core + + + diff --git a/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/src/main/resources/META-INF/spring.provides b/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/src/main/resources/META-INF/spring.provides new file mode 100644 index 0000000000..e914aa7894 --- /dev/null +++ b/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/src/main/resources/META-INF/spring.provides @@ -0,0 +1 @@ +provides: spring-data-cassandra, spring-cql \ No newline at end of file