From 12bd4effa1f715d89980cd56da184160b1887f1d Mon Sep 17 00:00:00 2001 From: Ilayaperumal Gopinathan Date: Fri, 1 Apr 2016 20:56:31 +0530 Subject: [PATCH] Allow AggregateApplicationBuilder with no arg constructor - When the AggregateApplicationBuilder doesn't have constructor args set, then invoke parent configuration setup with no args. - This will make sure to set the parent context for the child application contexts This resolves #464 --- .../cloud/stream/aggregate/AggregateApplicationBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java index 095c358c2..3478d5bcc 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java @@ -47,6 +47,7 @@ public class AggregateApplicationBuilder { ConfigurableApplicationContext parentContext; public AggregateApplicationBuilder() { + this(SpringApplication.run(addAggregatorParentIfMissing(new Object[]{}), new String[]{})); } public AggregateApplicationBuilder(Object source, String... args) { @@ -62,7 +63,6 @@ public class AggregateApplicationBuilder { } private static Object[] addAggregatorParentIfMissing(Object[] sources) { - Assert.notEmpty(sources, "At least one source must be provided"); Object[] aggregateParentSources; if (!ObjectUtils.containsElement(sources, AggregatorParentConfiguration.class)) { // add the AggregatorParentConfiguration first, so it can be overridden