diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ScatterGatherParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ScatterGatherParser.java index b9d8e56594..53c3339de3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ScatterGatherParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/ScatterGatherParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -27,7 +27,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.handler.ScatterGatherHandler; +import org.springframework.integration.scattergather.ScatterGatherHandler; import org.springframework.integration.router.RecipientListRouter; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ScatterGatherHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java similarity index 97% rename from spring-integration-core/src/main/java/org/springframework/integration/handler/ScatterGatherHandler.java rename to spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java index a863b93923..96e9d9d9e3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ScatterGatherHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/ScatterGatherHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.integration.handler; +package org.springframework.integration.scattergather; import org.springframework.aop.support.AopUtils; import org.springframework.context.Lifecycle; @@ -26,6 +26,7 @@ import org.springframework.integration.core.MessageProducer; import org.springframework.integration.endpoint.AbstractEndpoint; import org.springframework.integration.endpoint.EventDrivenConsumer; import org.springframework.integration.endpoint.PollingConsumer; +import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.router.RecipientListRouter; import org.springframework.integration.support.channel.HeaderChannelRegistry; import org.springframework.messaging.Message; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/scattergather/package-info.java b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/package-info.java new file mode 100644 index 0000000000..1067b8cae4 --- /dev/null +++ b/spring-integration-core/src/main/java/org/springframework/integration/scattergather/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides classes supporting the Scatter-Gather pattern. + */ +package org.springframework.integration.scattergather; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java index 3eea09f86c..72922b482b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java @@ -42,7 +42,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.aopalliance.intercept.MethodInterceptor; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.log4j.Level; +import org.apache.log4j.LogManager; import org.hamcrest.Matchers; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -137,6 +143,8 @@ import reactor.spring.context.config.EnableReactor; @DirtiesContext public class EnableIntegrationTests { + private final Log logger = LogFactory.getLog(EnableIntegrationTests.class); + @Autowired private ApplicationContext context; @@ -255,6 +263,19 @@ public class EnableIntegrationTests { @Autowired private MessageChannel controlBusChannel; + private static Level existingLogLevel; + + // The temporal hooks to investigate CI failures + @BeforeClass + public static void setup() { + existingLogLevel = LogManager.getLogger("org.springframework.integration").getLevel(); + LogManager.getLogger("org.springframework.integration").setLevel(Level.DEBUG); + } + + @AfterClass + public static void tearDown() { + LogManager.getLogger("org.springframework.integration").setLevel(existingLogLevel); + } @Test public void testAnnotatedServiceActivator() { @@ -296,6 +317,9 @@ public class EnableIntegrationTests { assertEquals(10L, TestUtils.getPropertyValue(trigger, "period")); assertFalse(TestUtils.getPropertyValue(trigger, "fixedRate", Boolean.class)); + // Markers to investigate the failures on CI + logger.debug("----SEND Message to 'input' channel----"); + this.input.send(MessageBuilder.withPayload("Foo").build()); Message interceptedMessage = this.wireTapChannel.receive(10000); @@ -314,7 +338,10 @@ public class EnableIntegrationTests { Matchers.containsString("annotationTestService.handle.serviceActivator.handler")); assertThat(messageHistoryString, Matchers.not(Matchers.containsString("output"))); - receive = this.publishedChannel.receive(1000); + receive = this.publishedChannel.receive(10000); + + logger.debug("----RECEIVE Message from 'publishedChannel' channel----" + receive); + assertNotNull(receive); assertEquals("foo", receive.getPayload()); @@ -694,7 +721,10 @@ public class EnableIntegrationTests { @Override public Message preSend(Message message, MessageChannel channel) { fbInterceptorCounter().incrementAndGet(); - return super.preSend(message, channel); + Message message1 = super.preSend(message, channel); + logger.debug("!!!!'ciFactoryBean': the result of 'preSend' on '" + channel + "' '" + + message1 + "'"); + return message1; } }; } @@ -801,11 +831,15 @@ public class EnableIntegrationTests { @GlobalChannelInterceptor public static class TestChannelInterceptor extends ChannelInterceptorAdapter { + private final Log logger = LogFactory.getLog(TestChannelInterceptor.class); + private final AtomicInteger invoked = new AtomicInteger(); @Override public Message preSend(Message message, MessageChannel channel) { this.invoked.incrementAndGet(); + logger.debug("!!!!'TestChannelInterceptor': the result of 'preSend' on '" + channel + "' '" + + message + "'"); return message; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/scattergather/config/ScatterGatherParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/scattergather/config/ScatterGatherParserTests.java index f9a7973c0b..e0bc2b19df 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/scattergather/config/ScatterGatherParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/scattergather/config/ScatterGatherParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -33,7 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.integration.aggregator.AggregatingMessageHandler; import org.springframework.integration.channel.FixedSubscriberChannel; import org.springframework.integration.endpoint.EventDrivenConsumer; -import org.springframework.integration.handler.ScatterGatherHandler; +import org.springframework.integration.scattergather.ScatterGatherHandler; import org.springframework.integration.router.RecipientListRouter; import org.springframework.integration.test.util.TestUtils; import org.springframework.messaging.MessageHandler; diff --git a/spring-integration-core/src/test/resources/log4j.properties b/spring-integration-core/src/test/resources/log4j.properties index 64ab790552..c87f9f5b94 100644 --- a/spring-integration-core/src/test/resources/log4j.properties +++ b/spring-integration-core/src/test/resources/log4j.properties @@ -2,6 +2,6 @@ log4j.rootCategory=WARN, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d %c{1} [%t] : %m%n +log4j.appender.stdout.layout.ConversionPattern=%d %p %c{1} [%t] : %m%n log4j.category.org.springframework.integration=WARN diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java index 5219a2f69d..8c816b6a8a 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/ScatterGatherHandlerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -26,8 +26,6 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.Executors; -import javax.management.MBeanServer; - import org.junit.Test; import org.junit.runner.RunWith; @@ -48,7 +46,7 @@ import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.config.EnableIntegration; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.handler.BridgeHandler; -import org.springframework.integration.handler.ScatterGatherHandler; +import org.springframework.integration.scattergather.ScatterGatherHandler; import org.springframework.integration.jmx.config.EnableIntegrationMBeanExport; import org.springframework.integration.router.RecipientListRouter; import org.springframework.integration.store.SimpleMessageStore; diff --git a/src/reference/docbook/whats-new.xml b/src/reference/docbook/whats-new.xml index 57cbb75efb..b57d3440f5 100644 --- a/src/reference/docbook/whats-new.xml +++ b/src/reference/docbook/whats-new.xml @@ -25,11 +25,19 @@
File Outbound Channel Adapter - The <int-file:outbound-channel-adapter> and + The <int-file:outbound-channel-adapter> and <int-file:outbound-gateway> now support an append-new-line attribute. - If set to true, a new line is appended to the file after a message is written. + If set to true, a new line is appended to the file after a message is written. The default attribute value is false. -
+ +
+ Class Package Change + + The ScatterGatherHandler class has been moved from the + org.springframework.integration.handler to the + org.springframework.integration.scattergather. + +