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 3e0cdf27e4..569c24ed84 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 @@ -23,12 +23,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; import reactor.core.Environment; import reactor.core.Reactor; -import reactor.spring.context.ConsumerBeanPostProcessor; +import reactor.spring.context.config.EnableReactor; /** * {@link EnableAutoConfiguration Auto-configuration} for Reactor. @@ -36,25 +34,15 @@ import reactor.spring.context.ConsumerBeanPostProcessor; * @author Dave Syer */ @Configuration -@ConditionalOnClass(ConsumerBeanPostProcessor.class) +@ConditionalOnClass(EnableReactor.class) @ConditionalOnMissingBean(Reactor.class) @AutoConfigureAfter(WebMvcAutoConfiguration.class) +@EnableReactor public class ReactorAutoConfiguration { @Bean - public Environment reactorEnvironment() { - return new Environment(); - } - - @Bean - public Reactor rootReactor() { - return reactorEnvironment().getRootReactor(); - } - - @Bean - @Order(Ordered.LOWEST_PRECEDENCE) - protected ConsumerBeanPostProcessor reactorConsumerBeanPostProcessor() { - return new ConsumerBeanPostProcessor(); + public Reactor rootReactor(Environment environment) { + return environment.getRootReactor(); } } diff --git a/spring-boot-cli/samples/reactor.groovy b/spring-boot-cli/samples/reactor.groovy index d8c98ae776..d64c75dfca 100644 --- a/spring-boot-cli/samples/reactor.groovy +++ b/spring-boot-cli/samples/reactor.groovy @@ -14,12 +14,6 @@ class Runner implements CommandLineRunner { @PostConstruct void init() { log.info "Registering consumer" - reactor.on(Selectors.$("hello"), [ - accept: { - log.info("Hello ${it.data}") - latch.countDown() - } - ] as Consumer) } void run(String... args) { @@ -28,9 +22,10 @@ class Runner implements CommandLineRunner { latch.await() } - // @On(reactor="reactor", selector="hello") - void receive(Event event) { - log.info "Hello ${event.data}" + @Selector(reactor="reactor", value="hello") + void receive(String data) { + log.info "Hello ${data}" + latch.countDown() } } 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 c74e0e8a71..7925bd230f 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 @@ -16,12 +16,6 @@ package org.springframework.boot.cli.compiler.autoconfigure; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.control.customizers.ImportCustomizer; import org.springframework.boot.cli.compiler.AstUtils; @@ -54,17 +48,10 @@ public class ReactorCompilerAutoConfiguration extends CompilerAutoConfiguration public void applyImports(ImportCustomizer imports) { imports.addImports("reactor.core.Reactor", "reactor.event.Event", "reactor.function.Consumer", "reactor.function.Functions", - "reactor.event.selector.Selectors", - "reactor.spring.context.annotation.On", - "reactor.spring.context.annotation.Reply", - EnableReactor.class.getCanonicalName()).addStarImports( + "reactor.event.selector.Selectors", "reactor.spring.annotation.Selector", + "reactor.spring.annotation.ReplyTo", + "reactor.spring.context.config.EnableReactor").addStarImports( "reactor.event.Selectors"); } - @Target(ElementType.TYPE) - @Documented - @Retention(RetentionPolicy.RUNTIME) - public static @interface EnableReactor { - - } } diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 3f022b6d45..b3958fab6a 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -17,7 +17,7 @@ 7.0.42 8.1.9.v20130131 1.7.3 - 1.0.0.M1 + 1.0.0.M2 diff --git a/spring-boot-starters/spring-boot-starter-parent/pom.xml b/spring-boot-starters/spring-boot-starter-parent/pom.xml index f57e3c0520..151dbe0bfd 100644 --- a/spring-boot-starters/spring-boot-starter-parent/pom.xml +++ b/spring-boot-starters/spring-boot-starter-parent/pom.xml @@ -290,11 +290,6 @@ - - - maven-compiler-plugin - -