diff --git a/spring-boot-autoconfigure/pom.xml b/spring-boot-autoconfigure/pom.xml
index ea227098785..2ce061f45fd 100644
--- a/spring-boot-autoconfigure/pom.xml
+++ b/spring-boot-autoconfigure/pom.xml
@@ -80,6 +80,11 @@
cache-api
true
+
+ io.projectreactor.spring
+ reactor-spring-context
+ true
+
org.flywaydb
flyway-core
@@ -415,11 +420,6 @@
thymeleaf-extras-springsecurity4
true
-
- org.projectreactor.spring
- reactor-spring-context
- true
-
javax.jms
jms-api
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
index a220df9ca9b..0716924272a 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
@@ -24,8 +24,8 @@ import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import reactor.core.Environment;
-import reactor.core.Reactor;
+import reactor.Environment;
+import reactor.bus.EventBus;
import reactor.spring.context.config.EnableReactor;
/**
@@ -39,15 +39,16 @@ import reactor.spring.context.config.EnableReactor;
public class ReactorAutoConfiguration {
@Bean
- @ConditionalOnMissingBean(Reactor.class)
- public Reactor rootReactor(Environment environment) {
- return environment.getRootReactor();
+ @ConditionalOnMissingBean(EventBus.class)
+ public EventBus eventBus(Environment environment) {
+ return EventBus.create(environment);
}
@Configuration
@ConditionalOnMissingBean(Environment.class)
@EnableReactor
protected static class ReactorConfiguration {
+
}
}
diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfigurationTests.java
index 8c579f5b376..89c2785cb49 100644
--- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfigurationTests.java
+++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfigurationTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2014 the original author or authors.
+ * Copyright 2012-2015 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.
@@ -21,43 +21,53 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import reactor.core.Environment;
-import reactor.core.Reactor;
-import reactor.core.spec.Reactors;
+import reactor.bus.EventBus;
+import reactor.core.Dispatcher;
+import reactor.core.dispatch.MpscDispatcher;
+import reactor.core.dispatch.RingBufferDispatcher;
-import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertThat;
/**
* Tests for {@link ReactorAutoConfiguration}.
*
* @author Dave Syer
+ * @author Andy Wilkinson
*/
public class ReactorAutoConfigurationTests {
private final AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
@Test
- public void reactorIsAvailable() {
+ public void eventBusIsAvailable() {
this.context.register(ReactorAutoConfiguration.class);
this.context.refresh();
- assertNotNull(this.context.getBean(Reactor.class));
+ EventBus eventBus = this.context.getBean(EventBus.class);
+ assertThat(eventBus.getDispatcher(), instanceOf(RingBufferDispatcher.class));
this.context.close();
}
@Test
- public void customReactor() {
+ public void customEventBus() {
this.context.register(TestConfiguration.class, ReactorAutoConfiguration.class);
this.context.refresh();
- assertNotNull(this.context.getBean(Reactor.class));
+ EventBus eventBus = this.context.getBean(EventBus.class);
+ assertThat(eventBus.getDispatcher(), instanceOf(MpscDispatcher.class));
this.context.close();
}
@Configuration
protected static class TestConfiguration {
+ @Bean(destroyMethod = "shutdown")
+ public Dispatcher dispatcher() {
+ return new MpscDispatcher("test");
+ }
+
@Bean
- public Reactor reactor(Environment env) {
- return Reactors.reactor().env(env).dispatcher(Environment.RING_BUFFER).get();
+ public EventBus customEventBus() {
+ return EventBus.create(dispatcher());
}
}
diff --git a/spring-boot-cli/samples/reactor.groovy b/spring-boot-cli/samples/reactor.groovy
index 679ffef749d..41b4f0c286a 100644
--- a/spring-boot-cli/samples/reactor.groovy
+++ b/spring-boot-cli/samples/reactor.groovy
@@ -7,7 +7,7 @@ import java.util.concurrent.CountDownLatch
class Runner implements CommandLineRunner {
@Autowired
- Reactor reactor
+ EventBus eventBus
private CountDownLatch latch = new CountDownLatch(1)
@@ -17,7 +17,7 @@ class Runner implements CommandLineRunner {
}
void run(String... args) {
- reactor.notify("hello", Event.wrap("Phil"))
+ eventBus.notify("hello", Event.wrap("Phil"))
log.info "Notified Phil"
latch.await()
}
@@ -34,7 +34,7 @@ class Runner implements CommandLineRunner {
class Greeter {
@Autowired
- Reactor reactor
+ EventBus eventBus
@Autowired
private CountDownLatch latch
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/ReactorCompilerAutoConfiguration.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/ReactorCompilerAutoConfiguration.java
index f04fcee9f55..79ddb27ac5f 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/ReactorCompilerAutoConfiguration.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/ReactorCompilerAutoConfiguration.java
@@ -32,29 +32,28 @@ public class ReactorCompilerAutoConfiguration extends CompilerAutoConfiguration
@Override
public boolean matches(ClassNode classNode) {
return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableReactor")
- || AstUtils.hasAtLeastOneFieldOrMethod(classNode, "Reactor");
+ || AstUtils.hasAtLeastOneFieldOrMethod(classNode, "EventBus");
}
@Override
public void applyDependencies(DependencyCustomizer dependencies) {
- dependencies.ifAnyMissingClasses("reactor.core.Reactor")
+ dependencies.ifAnyMissingClasses("reactor.bus.EventBus")
.add("reactor-spring-context", false).add("reactor-spring-core", false)
- .add("reactor-core");
+ .add("reactor-bus").add("reactor-stream");
}
@Override
public void applyImports(ImportCustomizer imports) {
- imports.addImports("reactor.core.Reactor", "reactor.core.spec.Reactors",
- "reactor.core.Observable", "reactor.event.Event",
- "reactor.function.Functions", "reactor.function.Predicates",
- "reactor.function.Suppliers",
- "reactor.spring.context.annotation.Consumer",
+ imports.addImports("reactor.bus.Bus", "reactor.bus.Event",
+ "reactor.bus.EventBus", "reactor.fn.Function", "reactor.fn.Functions",
+ "reactor.fn.Predicate", "reactor.fn.Predicates", "reactor.fn.Supplier",
+ "reactor.fn.Suppliers", "reactor.spring.context.annotation.Consumer",
+ "reactor.spring.context.annotation.ReplyTo",
"reactor.spring.context.annotation.Selector",
"reactor.spring.context.annotation.SelectorType",
- "reactor.spring.context.annotation.ReplyTo",
"reactor.spring.context.config.EnableReactor")
- .addStarImports("reactor.event.selector.Selectors")
- .addImport("ReactorEnvironment", "reactor.core.Environment");
+ .addStarImports("reactor.bus.selector.Selectors")
+ .addImport("ReactorEnvironment", "reactor.Environment");
}
}
diff --git a/spring-boot-cli/test-samples/integration_auto_test.groovy b/spring-boot-cli/test-samples/integration_auto_test.groovy
index 069069af0cc..dd340d42434 100644
--- a/spring-boot-cli/test-samples/integration_auto_test.groovy
+++ b/spring-boot-cli/test-samples/integration_auto_test.groovy
@@ -3,11 +3,11 @@
class RestTests {
@Autowired
- Reactor reactor
+ EventBus eventBus
@Test
void test() {
- assertNotNull(reactor)
+ assertNotNull(eventBus)
}
}
diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml
index 4848760b8f7..f4af5ae4420 100644
--- a/spring-boot-dependencies/pom.xml
+++ b/spring-boot-dependencies/pom.xml
@@ -110,8 +110,8 @@
5.1.34
1.9.21
9.4-1201-jdbc41
- 1.1.6.RELEASE
- 1.1.3.RELEASE
+ 2.0.1.BUILD-SNAPSHOT
+ 2.0.1.BUILD-SNAPSHOT
2.1.0
3.1.0
1.1.1
@@ -624,6 +624,61 @@
metrics-servlets
${dropwizard-metrics.version}
+
+ io.projectreactor
+ reactor-bus
+ ${reactor.version}
+
+
+ io.projectreactor
+ reactor-core
+ ${reactor.version}
+
+
+ io.projectreactor
+ reactor-groovy
+ ${reactor.version}
+
+
+ io.projectreactor
+ reactor-groovy-extensions
+ ${reactor.version}
+
+
+ io.projectreactor
+ reactor-logback
+ ${reactor.version}
+
+
+ io.projectreactor
+ reactor-net
+ ${reactor.version}
+
+
+ io.projectreactor
+ reactor-stream
+ ${reactor.version}
+
+
+ io.projectreactor.spring
+ reactor-spring-context
+ ${reactor-spring.version}
+
+
+ io.projectreactor.spring
+ reactor-spring-core
+ ${reactor-spring.version}
+
+
+ io.projectreactor.spring
+ reactor-spring-messaging
+ ${reactor-spring.version}
+
+
+ io.projectreactor.spring
+ reactor-spring-webmvc
+ ${reactor-spring.version}
+
io.undertow
undertow-core
@@ -1250,51 +1305,6 @@
postgresql
${postgresql.version}
-
- org.projectreactor
- reactor-core
- ${reactor.version}
-
-
- org.projectreactor
- reactor-groovy
- ${reactor.version}
-
-
- org.projectreactor
- reactor-groovy-extensions
- ${reactor.version}
-
-
- org.projectreactor
- reactor-logback
- ${reactor.version}
-
-
- org.projectreactor
- reactor-net
- ${reactor.version}
-
-
- org.projectreactor.spring
- reactor-spring-context
- ${reactor-spring.version}
-
-
- org.projectreactor.spring
- reactor-spring-core
- ${reactor-spring.version}
-
-
- org.projectreactor.spring
- reactor-spring-messaging
- ${reactor-spring.version}
-
-
- org.projectreactor.spring
- reactor-spring-webmvc
- ${reactor-spring.version}
-
org.slf4j
jcl-over-slf4j