From c2ee2161a1cc008f2c542a4192dbd3a67a50a8f1 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Tue, 17 Dec 2013 14:38:36 -0500 Subject: [PATCH] INT-3242 Final Polish for 4.0.0.M2 - Rename EiMessageHeaderAccessor to IntegrationMessageHeaderAccessor - Remove GenericMessage - Minor TODOs - Start a new What's new" chapter in the reference JIRA: https://jira.springsource.org/browse/INT-3242 --- .../amqp/support/DefaultAmqpHeaderMapper.java | 6 +- ... => IntegrationMessageHeaderAccessor.java} | 12 +- ...tractAggregatingMessageGroupProcessor.java | 4 +- .../AbstractCorrelatingMessageHandler.java | 10 +- .../aggregator/MessageSequenceComparator.java | 6 +- .../ResequencingMessageGroupProcessor.java | 4 +- .../ResequencingMessageHandler.java | 4 +- .../aggregator/SequenceNumberComparator.java | 6 +- .../SequenceSizeReleaseStrategy.java | 6 +- .../integration/channel/PriorityChannel.java | 14 +- .../CorrelationStrategyFactoryBean.java | 4 +- .../xml/StandardHeaderEnricherParser.java | 8 +- ...ressionEvaluatingRequestHandlerAdvice.java | 2 +- .../integration/message/GenericMessage.java | 67 -- .../selector/UnexpiredMessageSelector.java | 4 +- .../integration/store/SimpleMessageGroup.java | 4 +- .../integration/support/IdGenerators.java | 10 +- .../integration/support/MessageBuilder.java | 30 +- .../AbstractJsonInboundMessageMapper.java | 10 +- .../MethodInvokingReleaseStrategyTests.java | 8 +- .../aggregator/ResequencerTests.java | 44 +- .../AggregatorExpressionIntegrationTests.java | 8 +- .../AggregatorIntegrationTests.java | 8 +- ...aultMessageAggregatorIntegrationTests.java | 8 +- .../ResequencerIntegrationTests.java | 14 +- .../PartialSequencesWithGapsTests.java | 6 +- .../integration/config/ChainParserTests.java | 4 +- ...esequencerWithMessageStoreParserTests.java | 8 +- .../config/TestAggregatorBean.java | 4 +- ...tatedEndpointWithCustomizedAggregator.java | 4 +- ...nnotatedEndpointWithDefaultAggregator.java | 4 +- ...tAnnotatedEndpointWithReleaseStrategy.java | 4 +- .../xml/HeaderEnricherOverwriteTests.java | 6 +- .../config/xml/HeaderEnricherTests.java | 14 +- ...nitionHandlerAwareEndpointParserTests.java | 8 +- .../BroadcastingDispatcherTests.java | 28 +- .../endpoint/CorrelationIdTests.java | 24 +- .../ServiceActivatorEndpointTests.java | 6 +- .../gateway/GatewayWithHeaderAnnotations.java | 4 +- .../HeaderAnnotationTransformerTests.java | 10 +- .../message/GenericMessageTests.java | 10 +- .../message/MessageBuilderTests.java | 34 +- .../router/RecipientListRouterTests.java | 26 +- .../router/config/RouterParserTests.java | 20 +- .../router/config/SplitterParserTests.java | 6 +- .../splitter/DefaultSplitterTests.java | 4 +- .../splitter/MethodInvokingSplitterTests.java | 26 +- .../transformer/HeaderFilterTests.java | 4 +- .../AbstractRemoteFileOutboundGateway.java | 3 +- .../tcp/connection/TcpMessageMapperTests.java | 10 +- .../jdbc/JdbcMessageStoreTests.java | 20 +- ...lJdbcMessageStoreMultipleChannelTests.java | 6 +- .../mysql/MySqlJdbcMessageStoreTests.java | 20 +- .../integration/jms/AbstractJmsChannel.java | 4 +- .../integration/jms/JmsOutboundGateway.java | 6 +- .../jms/JmsSendingMessageHandler.java | 4 +- .../test/matcher/HeaderMatcher.java | 10 +- src/reference/docbook/changes-2.2-3.0.xml | 679 ++++++++++++++++- src/reference/docbook/changes-3.0-4.0.xml | 9 + src/reference/docbook/history.xml | 6 +- src/reference/docbook/index.xml | 4 +- src/reference/docbook/whats-new.xml | 685 +----------------- 62 files changed, 995 insertions(+), 1036 deletions(-) rename spring-integration-core/src/main/java/org/springframework/integration/{EiMessageHeaderAccessor.java => IntegrationMessageHeaderAccessor.java} (86%) delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java create mode 100644 src/reference/docbook/changes-3.0-4.0.xml diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java index 19f8138683..6f76454cc3 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java @@ -24,7 +24,7 @@ import java.util.Map; import org.springframework.amqp.core.MessageDeliveryMode; import org.springframework.amqp.core.MessageProperties; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.amqp.AmqpHeaders; import org.springframework.integration.mapping.AbstractHeaderMapper; import org.springframework.integration.mapping.support.JsonHeaders; @@ -133,7 +133,7 @@ public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper 0) { - headers.put(EiMessageHeaderAccessor.PRIORITY, priority); + headers.put(IntegrationMessageHeaderAccessor.PRIORITY, priority); } String receivedExchange = amqpMessageProperties.getReceivedExchange(); if (StringUtils.hasText(receivedExchange)) { @@ -258,7 +258,7 @@ public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper message) { + public IntegrationMessageHeaderAccessor(Message message) { super(message); } @@ -88,16 +88,16 @@ public class EiMessageHeaderAccessor extends MessageHeaderAccessor { protected void verifyType(String headerName, Object headerValue) { if (headerName != null && headerValue != null) { super.verifyType(headerName, headerValue); - if (EiMessageHeaderAccessor.EXPIRATION_DATE.equals(headerName)) { + if (IntegrationMessageHeaderAccessor.EXPIRATION_DATE.equals(headerName)) { Assert.isTrue(headerValue instanceof Date || headerValue instanceof Long, "The '" + headerName + "' header value must be a Date or Long."); } - else if (EiMessageHeaderAccessor.SEQUENCE_NUMBER.equals(headerName) - || EiMessageHeaderAccessor.SEQUENCE_SIZE.equals(headerName)) { + else if (IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER.equals(headerName) + || IntegrationMessageHeaderAccessor.SEQUENCE_SIZE.equals(headerName)) { Assert.isTrue(Integer.class.isAssignableFrom(headerValue.getClass()), "The '" + headerName + "' header value must be an Integer."); } - else if (EiMessageHeaderAccessor.PRIORITY.equals(headerName)) { + else if (IntegrationMessageHeaderAccessor.PRIORITY.equals(headerName)) { Assert.isTrue(Integer.class.isAssignableFrom(headerValue.getClass()), "The '" + headerName + "' header value must be an Integer."); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java index f185a9bbe7..7b75068d70 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractAggregatingMessageGroupProcessor.java @@ -20,7 +20,7 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.store.MessageGroup; import org.springframework.integration.support.MessageBuilder; import org.springframework.messaging.Message; @@ -68,7 +68,7 @@ public abstract class AbstractAggregatingMessageGroupProcessor implements Messag MessageHeaders currentHeaders = message.getHeaders(); for (String key : currentHeaders.keySet()) { if (MessageHeaders.ID.equals(key) || MessageHeaders.TIMESTAMP.equals(key) - || EiMessageHeaderAccessor.SEQUENCE_SIZE.equals(key) || EiMessageHeaderAccessor.SEQUENCE_NUMBER.equals(key)) { + || IntegrationMessageHeaderAccessor.SEQUENCE_SIZE.equals(key) || IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER.equals(key)) { continue; } Object value = currentHeaders.get(key); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java index e188d231f8..0566041ba0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanFactory; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.NullChannel; import org.springframework.integration.core.MessageProducer; import org.springframework.integration.handler.AbstractMessageHandler; @@ -104,7 +104,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageH setMessageStore(store); this.outputProcessor = processor; this.correlationStrategy = correlationStrategy == null ? - new HeaderAttributeCorrelationStrategy(EiMessageHeaderAccessor.CORRELATION_ID) : correlationStrategy; + new HeaderAttributeCorrelationStrategy(IntegrationMessageHeaderAccessor.CORRELATION_ID) : correlationStrategy; this.releaseStrategy = releaseStrategy == null ? new SequenceSizeReleaseStrategy() : releaseStrategy; this.messagingTemplate.setSendTimeout(DEFAULT_SEND_TIMEOUT); sequenceAware = this.releaseStrategy instanceof SequenceSizeReleaseStrategy; @@ -348,7 +348,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageH Message lastReleasedMessage = sorted.get(partialSequence.size()-1); - return new EiMessageHeaderAccessor(lastReleasedMessage).getSequenceNumber(); + return new IntegrationMessageHeaderAccessor(lastReleasedMessage).getSequenceNumber(); } private MessageGroup store(Object correlationKey, Message message) { @@ -469,7 +469,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageH if (this.size() == 0) { return true; } - EiMessageHeaderAccessor messageHeaderAccessor = new EiMessageHeaderAccessor(message); + IntegrationMessageHeaderAccessor messageHeaderAccessor = new IntegrationMessageHeaderAccessor(message); Integer messageSequenceNumber = messageHeaderAccessor.getSequenceNumber(); if (messageSequenceNumber != null && messageSequenceNumber > 0) { Integer messageSequenceSize = messageHeaderAccessor.getSequenceSize(); @@ -485,7 +485,7 @@ public abstract class AbstractCorrelatingMessageHandler extends AbstractMessageH private boolean containsSequenceNumber(Collection> messages, Integer messageSequenceNumber) { for (Message member : messages) { - Integer memberSequenceNumber = new EiMessageHeaderAccessor(member).getSequenceNumber(); + Integer memberSequenceNumber = new IntegrationMessageHeaderAccessor(member).getSequenceNumber(); if (messageSequenceNumber.equals(memberSequenceNumber)) { return true; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageSequenceComparator.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageSequenceComparator.java index de8baa05a9..ef3546c3bf 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageSequenceComparator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageSequenceComparator.java @@ -18,7 +18,7 @@ package org.springframework.integration.aggregator; import java.util.Comparator; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.Message; /** @@ -30,8 +30,8 @@ import org.springframework.messaging.Message; public class MessageSequenceComparator implements Comparator> { public int compare(Message message1, Message message2) { - Integer s1 = new EiMessageHeaderAccessor(message1).getSequenceNumber(); - Integer s2 = new EiMessageHeaderAccessor(message2).getSequenceNumber(); + Integer s1 = new IntegrationMessageHeaderAccessor(message1).getSequenceNumber(); + Integer s2 = new IntegrationMessageHeaderAccessor(message2).getSequenceNumber(); if (s1 == null) { s1 = 0; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageGroupProcessor.java index 64bf62c6d5..841790be84 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageGroupProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageGroupProcessor.java @@ -20,7 +20,7 @@ import java.util.Comparator; import java.util.List; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.store.MessageGroup; /** @@ -60,6 +60,6 @@ public class ResequencingMessageGroupProcessor implements MessageGroupProcessor } private Integer extractSequenceNumber(Message message) { - return new EiMessageHeaderAccessor(message).getSequenceNumber(); + return new IntegrationMessageHeaderAccessor(message).getSequenceNumber(); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java index 73598dfabd..5881e0b161 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/ResequencingMessageHandler.java @@ -16,7 +16,7 @@ package org.springframework.integration.aggregator; import java.util.Collection; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.store.MessageGroup; import org.springframework.integration.store.MessageGroupStore; @@ -53,7 +53,7 @@ public class ResequencingMessageHandler extends AbstractCorrelatingMessageHandle int sequenceSize = 0; Message message = messageGroup.getOne(); if (message != null){ - sequenceSize = new EiMessageHeaderAccessor(message).getSequenceSize(); + sequenceSize = new IntegrationMessageHeaderAccessor(message).getSequenceSize(); } // If there is no sequence then it must be incomplete or unbounded if (sequenceSize > 0 && sequenceSize == size){ diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceNumberComparator.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceNumberComparator.java index a4854c73cb..a591b92d54 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceNumberComparator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceNumberComparator.java @@ -15,7 +15,7 @@ package org.springframework.integration.aggregator; import java.util.Comparator; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.Message; /** @@ -32,8 +32,8 @@ public class SequenceNumberComparator implements Comparator> { * rank. */ public int compare(Message o1, Message o2) { - Integer sequenceNumber1 = new EiMessageHeaderAccessor(o1).getSequenceNumber(); - Integer sequenceNumber2 = new EiMessageHeaderAccessor(o2).getSequenceNumber(); + Integer sequenceNumber1 = new IntegrationMessageHeaderAccessor(o1).getSequenceNumber(); + Integer sequenceNumber2 = new IntegrationMessageHeaderAccessor(o2).getSequenceNumber(); if (sequenceNumber1 == sequenceNumber2) { return 0; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java index 0fcf0284d7..69f95e76e0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/SequenceSizeReleaseStrategy.java @@ -25,7 +25,7 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.store.MessageGroup; /** @@ -78,7 +78,7 @@ public class SequenceSizeReleaseStrategy implements ReleaseStrategy { List> sorted = new ArrayList>(messages); Collections.sort(sorted, comparator); - int nextSequenceNumber = new EiMessageHeaderAccessor(sorted.get(0)).getSequenceNumber(); + int nextSequenceNumber = new IntegrationMessageHeaderAccessor(sorted.get(0)).getSequenceNumber(); int lastReleasedMessageSequence = messageGroup.getLastReleasedMessageSequenceNumber(); if (nextSequenceNumber - lastReleasedMessageSequence == 1){ @@ -92,7 +92,7 @@ public class SequenceSizeReleaseStrategy implements ReleaseStrategy { canRelease = true; } else { - int sequenceSize = new EiMessageHeaderAccessor(messageGroup.getOne()).getSequenceSize(); + int sequenceSize = new IntegrationMessageHeaderAccessor(messageGroup.getOne()).getSequenceSize(); // If there is no sequence then it must be incomplete.... if (sequenceSize == size){ canRelease = true; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java index 310936f5df..e021095578 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/PriorityChannel.java @@ -20,7 +20,7 @@ import java.util.Comparator; import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.atomic.AtomicLong; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.util.UpperBound; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; @@ -43,7 +43,7 @@ public class PriorityChannel extends QueueChannel { * is a non-positive value, the queue will be unbounded. Message priority * will be determined by the provided {@link Comparator}. If the comparator * is null, the priority will be based upon the value of - * {@link EiMessageHeaderAccessor#getPriority()}. + * {@link IntegrationMessageHeaderAccessor#getPriority()}. */ public PriorityChannel(int capacity, Comparator> comparator) { super(new PriorityBlockingQueue>(11, new SequenceFallbackComparator(comparator))); @@ -52,7 +52,7 @@ public class PriorityChannel extends QueueChannel { /** * Create a channel with the specified queue capacity. Message priority - * will be based upon the value of {@link EiMessageHeaderAccessor#getPriority()}. + * will be based upon the value of {@link IntegrationMessageHeaderAccessor#getPriority()}. */ public PriorityChannel(int capacity) { this(capacity, null); @@ -62,7 +62,7 @@ public class PriorityChannel extends QueueChannel { * Create a channel with an unbounded queue. Message priority will be * determined by the provided {@link Comparator}. If the comparator * is null, the priority will be based upon the value of - * {@link EiMessageHeaderAccessor#getPriority()}. + * {@link IntegrationMessageHeaderAccessor#getPriority()}. */ public PriorityChannel(Comparator> comparator) { this(0, comparator); @@ -70,7 +70,7 @@ public class PriorityChannel extends QueueChannel { /** * Create a channel with an unbounded queue. Message priority will be - * based on the value of {@link EiMessageHeaderAccessor#getPriority()}. + * based on the value of {@link IntegrationMessageHeaderAccessor#getPriority()}. */ public PriorityChannel() { this(0, null); @@ -109,8 +109,8 @@ public class PriorityChannel extends QueueChannel { compareResult = this.targetComparator.compare(message1, message2); } else { - Integer priority1 = new EiMessageHeaderAccessor(message1).getPriority(); - Integer priority2 = new EiMessageHeaderAccessor(message2).getPriority(); + Integer priority1 = new IntegrationMessageHeaderAccessor(message1).getPriority(); + Integer priority2 = new IntegrationMessageHeaderAccessor(message2).getPriority(); priority1 = priority1 != null ? priority1 : 0; priority2 = priority2 != null ? priority2 : 0; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java index ee89bb05f6..aabc154b6b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java @@ -18,7 +18,7 @@ package org.springframework.integration.config; import java.lang.reflect.Method; import org.springframework.beans.factory.FactoryBean; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.aggregator.CorrelationStrategy; import org.springframework.integration.aggregator.HeaderAttributeCorrelationStrategy; import org.springframework.integration.aggregator.MethodInvokingCorrelationStrategy; @@ -33,7 +33,7 @@ import org.springframework.util.StringUtils; */ public class CorrelationStrategyFactoryBean implements FactoryBean { - private CorrelationStrategy delegate = new HeaderAttributeCorrelationStrategy(EiMessageHeaderAccessor.CORRELATION_ID); + private CorrelationStrategy delegate = new HeaderAttributeCorrelationStrategy(IntegrationMessageHeaderAccessor.CORRELATION_ID); /** * Create a factory and set up the delegate which clients of the factory will see as its product. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/StandardHeaderEnricherParser.java b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/StandardHeaderEnricherParser.java index 625357df22..5a5f6e2018 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/xml/StandardHeaderEnricherParser.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/xml/StandardHeaderEnricherParser.java @@ -20,7 +20,7 @@ import org.w3c.dom.Element; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.MessageHeaders; import org.springframework.util.StringUtils; @@ -39,9 +39,9 @@ public class StandardHeaderEnricherParser extends HeaderEnricherParserSupport { public StandardHeaderEnricherParser() { this.addElementToHeaderMapping("reply-channel", MessageHeaders.REPLY_CHANNEL); this.addElementToHeaderMapping("error-channel", MessageHeaders.ERROR_CHANNEL); - this.addElementToHeaderMapping("correlation-id", EiMessageHeaderAccessor.CORRELATION_ID); - this.addElementToHeaderMapping("expiration-date", EiMessageHeaderAccessor.EXPIRATION_DATE, Long.class); - this.addElementToHeaderMapping("priority", EiMessageHeaderAccessor.PRIORITY, Integer.class); + this.addElementToHeaderMapping("correlation-id", IntegrationMessageHeaderAccessor.CORRELATION_ID); + this.addElementToHeaderMapping("expiration-date", IntegrationMessageHeaderAccessor.EXPIRATION_DATE, Long.class); + this.addElementToHeaderMapping("priority", IntegrationMessageHeaderAccessor.PRIORITY, Integer.class); } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java index 5fe60bd69e..a97c1f75c6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/advice/ExpressionEvaluatingRequestHandlerAdvice.java @@ -34,7 +34,7 @@ import org.springframework.util.Assert; * Two expressions 'onSuccessExpression' and 'onFailureExpression' are evaluated when * appropriate. If the evaluation returns a result, a message is sent to the onSuccessChannel * or onFailureChannel as appropriate; the message is the input message with a header - * {@link org.springframework.integration.EiMessageHeaderAccessor#POSTPROCESS_RESULT} containing the evaluation result. + * {@link org.springframework.integration.IntegrationMessageHeaderAccessor#POSTPROCESS_RESULT} containing the evaluation result. * The failure expression is NOT evaluated if the success expression throws an exception. * @author Gary Russell * @since 2.2 diff --git a/spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java b/spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java deleted file mode 100644 index 6725a9257c..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/message/GenericMessage.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2002-2013 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.integration.message; - -import java.util.Map; - -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageHeaders; - -/** - * Base Message class defining common properties such as id, payload, and headers. - * Once created this object is immutable. - * - * @author Mark Fisher - * - * @deprecated - use spring-messaging GenericMessage - this remains only until we migrate XD to the latest snapshot - */ -// TODO Remove -@Deprecated -public class GenericMessage extends org.springframework.messaging.support.GenericMessage implements Message { - - private static final long serialVersionUID = 3649200745084232821L; - - /** - * Create a new message with the given payload. - * - * @param payload the message payload - */ - public GenericMessage(T payload) { - this(payload, null); - } - - /** - * Create a new message with the given payload. The provided map - * will be used to populate the message headers - * - * @param payload the message payload - * @param headers message headers - * @see MessageHeaders - */ - public GenericMessage(T payload, Map headers) { - super(payload, headers); - } - - protected MessageHeaders createMessageHeaders(Map headers) { - return new MessageHeaders(headers); - } - - @Override - public MessageHeaders getHeaders() { - return super.getHeaders(); - } -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/selector/UnexpiredMessageSelector.java b/spring-integration-core/src/main/java/org/springframework/integration/selector/UnexpiredMessageSelector.java index 9a297178a6..01ff8cdd61 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/selector/UnexpiredMessageSelector.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/selector/UnexpiredMessageSelector.java @@ -17,7 +17,7 @@ package org.springframework.integration.selector; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.core.MessageSelector; /** @@ -30,7 +30,7 @@ import org.springframework.integration.core.MessageSelector; public class UnexpiredMessageSelector implements MessageSelector { public boolean accept(Message message) { - Long expirationDate = new EiMessageHeaderAccessor(message).getExpirationDate(); + Long expirationDate = new IntegrationMessageHeaderAccessor(message).getExpirationDate(); if (expirationDate == null) { return true; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java index c7d5c9d371..7fa5d0b599 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageGroup.java @@ -18,7 +18,7 @@ import java.util.Collections; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.Message; /** @@ -124,7 +124,7 @@ public class SimpleMessageGroup implements MessageGroup { if (size() == 0) { return 0; } - return new EiMessageHeaderAccessor(getOne()).getSequenceSize(); + return new IntegrationMessageHeaderAccessor(getOne()).getSequenceSize(); } public int size() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java b/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java index 0dd338f71d..a64bdd4f20 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/IdGenerators.java @@ -22,8 +22,8 @@ import java.util.concurrent.atomic.AtomicLong; import org.springframework.util.IdGenerator; -// TODO Discuss and agree where these should go. In SI or in Spring 4? /** + * Alterative {@link IdGenerator} implementations. * * @author Andy Wilkinson * @since 4.0 @@ -31,6 +31,10 @@ import org.springframework.util.IdGenerator; */ public class IdGenerators { + /** + * UUID.randomUUID() + * + */ public static class JdkIdGenerator implements IdGenerator { @Override @@ -40,6 +44,10 @@ public class IdGenerators { } + /** + * Begins with 1; incremented on each use. + * + */ public static class SimpleIncrementingIdGenerator implements IdGenerator { private final AtomicLong topBits = new AtomicLong(); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java b/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java index 087a0635a0..9599d409af 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/MessageBuilder.java @@ -23,7 +23,7 @@ import java.util.Date; import java.util.List; import java.util.Map; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; @@ -41,7 +41,7 @@ public final class MessageBuilder { private final T payload; - private final EiMessageHeaderAccessor headerAccessor; + private final IntegrationMessageHeaderAccessor headerAccessor; private final Message originalMessage; @@ -54,7 +54,7 @@ public final class MessageBuilder { Assert.notNull(payload, "payload must not be null"); this.payload = payload; this.originalMessage = originalMessage; - this.headerAccessor = new EiMessageHeaderAccessor(originalMessage); + this.headerAccessor = new IntegrationMessageHeaderAccessor(originalMessage); if (originalMessage != null) { this.modified = (!this.payload.equals(originalMessage.getPayload())); } @@ -139,26 +139,26 @@ public final class MessageBuilder { } public MessageBuilder setExpirationDate(Long expirationDate) { - return this.setHeader(EiMessageHeaderAccessor.EXPIRATION_DATE, expirationDate); + return this.setHeader(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, expirationDate); } public MessageBuilder setExpirationDate(Date expirationDate) { if (expirationDate != null) { - return this.setHeader(EiMessageHeaderAccessor.EXPIRATION_DATE, expirationDate.getTime()); + return this.setHeader(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, expirationDate.getTime()); } else { - return this.setHeader(EiMessageHeaderAccessor.EXPIRATION_DATE, null); + return this.setHeader(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, null); } } public MessageBuilder setCorrelationId(Object correlationId) { - return this.setHeader(EiMessageHeaderAccessor.CORRELATION_ID, correlationId); + return this.setHeader(IntegrationMessageHeaderAccessor.CORRELATION_ID, correlationId); } public MessageBuilder pushSequenceDetails(Object correlationId, int sequenceNumber, int sequenceSize) { Object incomingCorrelationId = this.headerAccessor.getCorrelationId(); @SuppressWarnings("unchecked") - List> incomingSequenceDetails = (List>) this.headerAccessor.getHeader(EiMessageHeaderAccessor.SEQUENCE_DETAILS); + List> incomingSequenceDetails = (List>) this.headerAccessor.getHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS); if (incomingCorrelationId != null) { if (incomingSequenceDetails == null) { incomingSequenceDetails = new ArrayList>(); @@ -171,13 +171,13 @@ public final class MessageBuilder { incomingSequenceDetails = Collections.unmodifiableList(incomingSequenceDetails); } if (incomingSequenceDetails != null) { - setHeader(EiMessageHeaderAccessor.SEQUENCE_DETAILS, incomingSequenceDetails); + setHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS, incomingSequenceDetails); } return setCorrelationId(correlationId).setSequenceNumber(sequenceNumber).setSequenceSize(sequenceSize); } public MessageBuilder popSequenceDetails() { - String key = EiMessageHeaderAccessor.SEQUENCE_DETAILS; + String key = IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS; @SuppressWarnings("unchecked") List> incomingSequenceDetails = (List>) this.headerAccessor.getHeader(key); if (incomingSequenceDetails == null) { @@ -198,10 +198,10 @@ public final class MessageBuilder { setSequenceSize(sequenceSize); } if (!incomingSequenceDetails.isEmpty()) { - this.headerAccessor.setHeader(EiMessageHeaderAccessor.SEQUENCE_DETAILS, incomingSequenceDetails); + this.headerAccessor.setHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS, incomingSequenceDetails); } else { - this.headerAccessor.removeHeader(EiMessageHeaderAccessor.SEQUENCE_DETAILS); + this.headerAccessor.removeHeader(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS); } return this; } @@ -223,15 +223,15 @@ public final class MessageBuilder { } public MessageBuilder setSequenceNumber(Integer sequenceNumber) { - return this.setHeader(EiMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); + return this.setHeader(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); } public MessageBuilder setSequenceSize(Integer sequenceSize) { - return this.setHeader(EiMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); + return this.setHeader(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); } public MessageBuilder setPriority(Integer priority) { - return this.setHeader(EiMessageHeaderAccessor.PRIORITY, priority); + return this.setHeader(IntegrationMessageHeaderAccessor.PRIORITY, priority); } @SuppressWarnings("unchecked") diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJsonInboundMessageMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJsonInboundMessageMapper.java index fef2a71de2..8345646afd 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJsonInboundMessageMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/json/AbstractJsonInboundMessageMapper.java @@ -20,7 +20,7 @@ import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.mapping.InboundMessageMapper; import org.springframework.util.Assert; @@ -41,10 +41,10 @@ public abstract class AbstractJsonInboundMessageMapper

implements InboundMess protected static final Map> DEFAULT_HEADER_TYPES = new HashMap>(); static { - DEFAULT_HEADER_TYPES.put(EiMessageHeaderAccessor.PRIORITY, Integer.class); - DEFAULT_HEADER_TYPES.put(EiMessageHeaderAccessor.EXPIRATION_DATE, Long.class); - DEFAULT_HEADER_TYPES.put(EiMessageHeaderAccessor.SEQUENCE_SIZE, Integer.class); - DEFAULT_HEADER_TYPES.put(EiMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class); + DEFAULT_HEADER_TYPES.put(IntegrationMessageHeaderAccessor.PRIORITY, Integer.class); + DEFAULT_HEADER_TYPES.put(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, Long.class); + DEFAULT_HEADER_TYPES.put(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, Integer.class); + DEFAULT_HEADER_TYPES.put(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, Integer.class); } protected final Type payloadType; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java index a71a92ee25..2a5423e925 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingReleaseStrategyTests.java @@ -24,7 +24,7 @@ import java.util.List; import org.junit.Assert; import org.junit.Test; import org.springframework.core.convert.ConversionFailedException; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.store.MessageGroup; import org.springframework.integration.store.SimpleMessageGroup; @@ -56,7 +56,7 @@ public class MethodInvokingReleaseStrategyTests { @SuppressWarnings("unused") public boolean checkCompletenessOnNonParameterizedListOfMessages(List> messages) { Assert.assertTrue(messages.size() > 0); - return messages.size() > new EiMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); + return messages.size() > new IntegrationMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); } } ReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), @@ -71,7 +71,7 @@ public class MethodInvokingReleaseStrategyTests { @SuppressWarnings("unused") public boolean checkCompletenessOnListOfMessagesParametrizedWithWildcard(List> messages) { Assert.assertTrue(messages.size() > 0); - return messages.size() > new EiMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); + return messages.size() > new IntegrationMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); } } ReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), @@ -86,7 +86,7 @@ public class MethodInvokingReleaseStrategyTests { @SuppressWarnings("unused") public boolean checkCompletenessOnListOfMessagesParametrizedWithString(List> messages) { Assert.assertTrue(messages.size() > 0); - return messages.size() > new EiMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); + return messages.size() > new IntegrationMessageHeaderAccessor(messages.iterator().next()).getSequenceSize(); } } ReleaseStrategy adapter = new MethodInvokingReleaseStrategy(new TestReleaseStrategy(), diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java index 0b16a57a15..e8205de4da 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java @@ -28,7 +28,7 @@ import java.util.Collections; import org.junit.Before; import org.junit.Test; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.store.MessageGroupStore; import org.springframework.integration.store.SimpleMessageStore; @@ -69,11 +69,11 @@ public class ResequencerTests { Message reply2 = replyChannel.receive(0); Message reply3 = replyChannel.receive(0); assertNotNull(reply1); - assertThat( new EiMessageHeaderAccessor(reply1).getSequenceNumber(), is(1)); + assertThat( new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber(), is(1)); assertNotNull(reply2); - assertThat(new EiMessageHeaderAccessor(reply2).getSequenceNumber(), is(2)); + assertThat(new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber(), is(2)); assertNotNull(reply3); - assertThat( new EiMessageHeaderAccessor(reply3).getSequenceNumber(), is(3)); + assertThat( new IntegrationMessageHeaderAccessor(reply3).getSequenceNumber(), is(3)); } @Test @@ -142,11 +142,11 @@ public class ResequencerTests { Message reply2 = replyChannel.receive(0); Message reply3 = replyChannel.receive(0); assertNotNull(reply1); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(reply1).getSequenceNumber()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber()); assertNotNull(reply2); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceNumber()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber()); assertNotNull(reply3); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(reply3).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(reply3).getSequenceNumber()); } @Test @@ -165,18 +165,18 @@ public class ResequencerTests { Message reply3 = replyChannel.receive(0); // only messages 1 and 2 should have been received by now assertNotNull(reply1); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(reply1).getSequenceNumber()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber()); assertNotNull(reply2); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceNumber()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber()); assertNull(reply3); // when sending the last message, the whole sequence must have been sent this.resequencer.handleMessage(message4); reply3 = replyChannel.receive(0); Message reply4 = replyChannel.receive(0); assertNotNull(reply3); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(reply3).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(reply3).getSequenceNumber()); assertNotNull(reply4); - assertEquals(new Integer(4), new EiMessageHeaderAccessor(reply4).getSequenceNumber()); + assertEquals(new Integer(4), new IntegrationMessageHeaderAccessor(reply4).getSequenceNumber()); } @Test @@ -195,18 +195,18 @@ public class ResequencerTests { Message reply3 = replyChannel.receive(0); // only messages 1 and 2 should have been received by now assertNotNull(reply1); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(reply1).getSequenceNumber()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber()); assertNotNull(reply2); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceNumber()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber()); assertNull(reply3); // when sending the last message, the whole sequence must have been sent this.resequencer.handleMessage(message4); reply3 = replyChannel.receive(0); Message reply4 = replyChannel.receive(0); assertNotNull(reply3); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(reply3).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(reply3).getSequenceNumber()); assertNotNull(reply4); - assertEquals(new Integer(4), new EiMessageHeaderAccessor(reply4).getSequenceNumber()); + assertEquals(new Integer(4), new IntegrationMessageHeaderAccessor(reply4).getSequenceNumber()); } @Test @@ -227,8 +227,8 @@ public class ResequencerTests { assertNotNull(reply1); assertNotNull(reply2); assertNull(reply3); - ArrayList sequence = new ArrayList(Arrays.asList(new EiMessageHeaderAccessor(reply1).getSequenceNumber(), - new EiMessageHeaderAccessor(reply2).getSequenceNumber())); + ArrayList sequence = new ArrayList(Arrays.asList(new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber(), + new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber())); Collections.sort(sequence); assertEquals("[1, 2]", sequence.toString()); // when sending the last message, the whole sequence must have been sent @@ -251,7 +251,7 @@ public class ResequencerTests { Message discard2 = discardChannel.receive(0); // message2 has been discarded because it came in with the wrong sequence size assertNotNull(discard1); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(discard1).getSequenceNumber()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(discard1).getSequenceNumber()); assertNull(discard2); } @@ -292,13 +292,13 @@ public class ResequencerTests { reply3 = replyChannel.receive(0); Message reply4 = replyChannel.receive(0); assertNotNull(reply1); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(reply1).getSequenceNumber()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber()); assertNotNull(reply2); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceNumber()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber()); assertNotNull(reply3); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(reply3).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(reply3).getSequenceNumber()); assertNotNull(reply4); - assertEquals(new Integer(4), new EiMessageHeaderAccessor(reply4).getSequenceNumber()); + assertEquals(new Integer(4), new IntegrationMessageHeaderAccessor(reply4).getSequenceNumber()); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorExpressionIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorExpressionIntegrationTests.java index aa3e16a7be..eef2c5b274 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorExpressionIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorExpressionIntegrationTests.java @@ -25,7 +25,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.PollableChannel; @@ -60,9 +60,9 @@ public class AggregatorExpressionIntegrationTests { private Map stubHeaders(int sequenceNumber, int sequenceSize, int correllationId) { Map headers = new HashMap(); - headers.put(EiMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); - headers.put(EiMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); - headers.put(EiMessageHeaderAccessor.CORRELATION_ID, correllationId); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); + headers.put(IntegrationMessageHeaderAccessor.CORRELATION_ID, correllationId); return headers; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorIntegrationTests.java index 56d0c2156c..f7eceb391b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/AggregatorIntegrationTests.java @@ -30,7 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.PollableChannel; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -129,9 +129,9 @@ public class AggregatorIntegrationTests { private Map stubHeaders(int sequenceNumber, int sequenceSize, int correllationId) { Map headers = new HashMap(); - headers.put(EiMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); - headers.put(EiMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); - headers.put(EiMessageHeaderAccessor.CORRELATION_ID, correllationId); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); + headers.put(IntegrationMessageHeaderAccessor.CORRELATION_ID, correllationId); return headers; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java index 32460c9db1..671e825863 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/DefaultMessageAggregatorIntegrationTests.java @@ -30,7 +30,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.PollableChannel; @@ -70,9 +70,9 @@ public class DefaultMessageAggregatorIntegrationTests { private Map stubHeaders(int sequenceNumber, int sequenceSize, int correllationId) { Map headers = new HashMap(); - headers.put(EiMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); - headers.put(EiMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); - headers.put(EiMessageHeaderAccessor.CORRELATION_ID, correllationId); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); + headers.put(IntegrationMessageHeaderAccessor.CORRELATION_ID, correllationId); return headers; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/ResequencerIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/ResequencerIntegrationTests.java index 1839ed07bb..3d84340bd1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/ResequencerIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/integration/ResequencerIntegrationTests.java @@ -21,7 +21,7 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.aggregator.ResequencingMessageHandler; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.endpoint.EventDrivenConsumer; @@ -60,15 +60,15 @@ public class ResequencerIntegrationTests { inputChannel.send(message1); message1 = outputChannel.receive(0); assertNotNull(message1); - assertEquals((Integer)1, new EiMessageHeaderAccessor(message1).getSequenceNumber()); + assertEquals((Integer)1, new IntegrationMessageHeaderAccessor(message1).getSequenceNumber()); inputChannel.send(message2); message2 = outputChannel.receive(0); message3 = outputChannel.receive(0); assertNotNull(message2); assertNotNull(message3); - assertEquals((Integer)2, new EiMessageHeaderAccessor(message2).getSequenceNumber()); - assertEquals((Integer)3, new EiMessageHeaderAccessor(message3).getSequenceNumber()); + assertEquals((Integer)2, new IntegrationMessageHeaderAccessor(message2).getSequenceNumber()); + assertEquals((Integer)3, new IntegrationMessageHeaderAccessor(message3).getSequenceNumber()); inputChannel.send(message5); assertNull(outputChannel.receive(0)); @@ -83,9 +83,9 @@ public class ResequencerIntegrationTests { assertNotNull(message4); assertNotNull(message5); assertNotNull(message6); - assertEquals((Integer)4, new EiMessageHeaderAccessor(message4).getSequenceNumber()); - assertEquals((Integer)5, new EiMessageHeaderAccessor(message5).getSequenceNumber()); - assertEquals((Integer)6, new EiMessageHeaderAccessor(message6).getSequenceNumber()); + assertEquals((Integer)4, new IntegrationMessageHeaderAccessor(message4).getSequenceNumber()); + assertEquals((Integer)5, new IntegrationMessageHeaderAccessor(message5).getSequenceNumber()); + assertEquals((Integer)6, new IntegrationMessageHeaderAccessor(message6).getSequenceNumber()); assertEquals(0, store.getMessageGroup("A").getMessages().size()); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/PartialSequencesWithGapsTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/PartialSequencesWithGapsTests.java index c78039a171..580586e1e5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/PartialSequencesWithGapsTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/scenarios/PartialSequencesWithGapsTests.java @@ -24,7 +24,7 @@ import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessagingException; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.SubscribableChannel; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.support.MessageBuilder; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -64,8 +64,8 @@ public class PartialSequencesWithGapsTests { in.send(message(6, 6)); in.send(message(2, 6)); in.send(message(1, 6)); - assertThat(new EiMessageHeaderAccessor(received.poll()).getSequenceNumber(), is(1)); - assertThat(new EiMessageHeaderAccessor(received.poll()).getSequenceNumber(), is(2)); + assertThat(new IntegrationMessageHeaderAccessor(received.poll()).getSequenceNumber(), is(1)); + assertThat(new IntegrationMessageHeaderAccessor(received.poll()).getSequenceNumber(), is(2)); received.poll(); received.poll(); in.send(message(5, 6)); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java index f1c3269ea4..09e1781bf7 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/ChainParserTests.java @@ -48,7 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.MessageRejectedException; import org.springframework.integration.endpoint.AbstractEndpoint; import org.springframework.integration.gateway.GatewayProxyFactoryBean; @@ -192,7 +192,7 @@ public class ChainParserTests { Message reply = this.replyOutput.receive(1000); assertNotNull(reply); assertEquals("foo", reply.getPayload()); - assertEquals("ABC", new EiMessageHeaderAccessor(reply).getCorrelationId()); + assertEquals("ABC", new IntegrationMessageHeaderAccessor(reply).getCorrelationId()); assertEquals("XYZ", reply.getHeaders().get("testValue")); assertEquals(123, reply.getHeaders().get("testRef")); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java index a9d9bf6b3f..cb23cc627d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/ResequencerWithMessageStoreParserTests.java @@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.PollableChannel; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.store.MessageGroupStore; import org.springframework.integration.support.MessageBuilder; import org.springframework.test.context.ContextConfiguration; @@ -64,11 +64,11 @@ public class ResequencerWithMessageStoreParserTests { Message message3 = output.receive(500); assertNotNull(message1); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(message1).getSequenceNumber()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(message1).getSequenceNumber()); assertNotNull(message2); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(message2).getSequenceNumber()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(message2).getSequenceNumber()); assertNotNull(message3); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(message3).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(message3).getSequenceNumber()); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java index b1d77ec348..a123147b4b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/TestAggregatorBean.java @@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.aggregator.MessageSequenceComparator; import org.springframework.integration.annotation.Aggregator; import org.springframework.messaging.support.GenericMessage; @@ -45,7 +45,7 @@ public class TestAggregatorBean { for (Message message : sortableList) { buffer.append(message.getPayload().toString()); if (null == correlationId) { - correlationId = new EiMessageHeaderAccessor(message).getCorrelationId(); + correlationId = new IntegrationMessageHeaderAccessor(message).getCorrelationId(); } } Message returnedMessage = new GenericMessage(buffer.toString()); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithCustomizedAggregator.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithCustomizedAggregator.java index 8909d5eb21..b48d47db45 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithCustomizedAggregator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithCustomizedAggregator.java @@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.aggregator.MessageSequenceComparator; import org.springframework.integration.annotation.Aggregator; import org.springframework.messaging.support.GenericMessage; @@ -51,7 +51,7 @@ public class TestAnnotatedEndpointWithCustomizedAggregator { for (Message message : sortableList) { buffer.append(message.getPayload().toString()); if (null == correlationId) { - correlationId = new EiMessageHeaderAccessor(message).getCorrelationId(); + correlationId = new IntegrationMessageHeaderAccessor(message).getCorrelationId(); } } Message returnedMessage = new GenericMessage(buffer.toString()); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithDefaultAggregator.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithDefaultAggregator.java index e89a003b10..469333b3e4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithDefaultAggregator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithDefaultAggregator.java @@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.aggregator.MessageSequenceComparator; import org.springframework.integration.annotation.Aggregator; import org.springframework.integration.annotation.MessageEndpoint; @@ -46,7 +46,7 @@ public class TestAnnotatedEndpointWithDefaultAggregator { for (Message message : sortableList) { buffer.append(message.getPayload().toString()); if (null == correlationId) { - correlationId =new EiMessageHeaderAccessor(message).getCorrelationId(); + correlationId =new IntegrationMessageHeaderAccessor(message).getCorrelationId(); } } Message returnedMessage = new GenericMessage(buffer.toString()); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithReleaseStrategy.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithReleaseStrategy.java index fc8b772cc3..526bb0b6d4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithReleaseStrategy.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/TestAnnotatedEndpointWithReleaseStrategy.java @@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.aggregator.MessageSequenceComparator; import org.springframework.integration.annotation.Aggregator; import org.springframework.integration.annotation.MessageEndpoint; @@ -47,7 +47,7 @@ public class TestAnnotatedEndpointWithReleaseStrategy { for (Message message : sortableList) { buffer.append(message.getPayload().toString()); if (null == correlationId) { - correlationId = new EiMessageHeaderAccessor(message).getCorrelationId(); + correlationId = new IntegrationMessageHeaderAccessor(message).getCorrelationId(); } } Message returnedMessage = new GenericMessage(buffer.toString()); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java index c3a9c3052b..c1b65cc3d2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherOverwriteTests.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.QueueChannel; import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.support.MessageBuilder; @@ -146,7 +146,7 @@ public class HeaderEnricherOverwriteTests { template.setDefaultDestination(channel); Message result = template.sendAndReceive(new GenericMessage("test")); assertNotNull(result); - assertEquals(new Integer(42), new EiMessageHeaderAccessor(result).getPriority()); + assertEquals(new Integer(42), new IntegrationMessageHeaderAccessor(result).getPriority()); } @Test @@ -160,7 +160,7 @@ public class HeaderEnricherOverwriteTests { input.send(message); Message result = replyChannel.receive(0); assertNotNull(result); - assertEquals(new Integer(77), new EiMessageHeaderAccessor(result).getPriority()); + assertEquals(new Integer(77), new IntegrationMessageHeaderAccessor(result).getPriority()); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java index 56a9f3cec4..25ee595346 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/HeaderEnricherTests.java @@ -29,7 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.parsing.BeanDefinitionParsingException; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.transformer.MessageTransformationException; @@ -105,7 +105,7 @@ public class HeaderEnricherTests { MessageChannel channel = context.getBean("correlationIdValueInput", MessageChannel.class); Message result = template.sendAndReceive(channel, new GenericMessage("test")); assertNotNull(result); - assertEquals("ABC", new EiMessageHeaderAccessor(result).getCorrelationId()); + assertEquals("ABC", new IntegrationMessageHeaderAccessor(result).getCorrelationId()); } @Test @@ -114,7 +114,7 @@ public class HeaderEnricherTests { MessageChannel channel = context.getBean("correlationIdValueWithTypeInput", MessageChannel.class); Message result = template.sendAndReceive(channel, new GenericMessage("test")); assertNotNull(result); - Object correlationId = new EiMessageHeaderAccessor(result).getCorrelationId(); + Object correlationId = new IntegrationMessageHeaderAccessor(result).getCorrelationId(); assertEquals(Long.class, correlationId.getClass()); assertEquals(new Long(123), correlationId); } @@ -125,7 +125,7 @@ public class HeaderEnricherTests { MessageChannel channel = context.getBean("correlationIdRefInput", MessageChannel.class); Message result = template.sendAndReceive(channel, new GenericMessage("test")); assertNotNull(result); - assertEquals(new Integer(123), new EiMessageHeaderAccessor(result).getCorrelationId()); + assertEquals(new Integer(123), new IntegrationMessageHeaderAccessor(result).getCorrelationId()); } @Test @@ -134,7 +134,7 @@ public class HeaderEnricherTests { MessageChannel channel = context.getBean("expirationDateValueInput", MessageChannel.class); Message result = template.sendAndReceive(channel, new GenericMessage("test")); assertNotNull(result); - assertEquals(new Long(1111), new EiMessageHeaderAccessor(result).getExpirationDate()); + assertEquals(new Long(1111), new IntegrationMessageHeaderAccessor(result).getExpirationDate()); } @Test @@ -143,7 +143,7 @@ public class HeaderEnricherTests { MessageChannel channel = context.getBean("expirationDateRefInput", MessageChannel.class); Message result = template.sendAndReceive(channel, new GenericMessage("test")); assertNotNull(result); - assertEquals(new Long(9999), new EiMessageHeaderAccessor(result).getExpirationDate()); + assertEquals(new Long(9999), new IntegrationMessageHeaderAccessor(result).getExpirationDate()); } @Test @@ -152,7 +152,7 @@ public class HeaderEnricherTests { MessageChannel channel = context.getBean("priorityInput", MessageChannel.class); Message result = template.sendAndReceive(channel, new GenericMessage("test")); assertNotNull(result); - assertEquals(new Integer(42), new EiMessageHeaderAccessor(result).getPriority()); + assertEquals(new Integer(42), new IntegrationMessageHeaderAccessor(result).getPriority()); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerDefinitionHandlerAwareEndpointParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerDefinitionHandlerAwareEndpointParserTests.java index 651f079ad0..50c251a243 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerDefinitionHandlerAwareEndpointParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/InnerDefinitionHandlerAwareEndpointParserTests.java @@ -35,7 +35,7 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationContext; import org.springframework.context.support.GenericApplicationContext; import org.springframework.core.io.InputStreamResource; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.endpoint.EventDrivenConsumer; import org.springframework.messaging.support.GenericMessage; @@ -282,9 +282,9 @@ public class InnerDefinitionHandlerAwareEndpointParserTests { private Map stubHeaders(int sequenceNumber, int sequenceSize, int correllationId) { Map headers = new HashMap(); - headers.put(EiMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); - headers.put(EiMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); - headers.put(EiMessageHeaderAccessor.CORRELATION_ID, correllationId); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, sequenceNumber); + headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, sequenceSize); + headers.put(IntegrationMessageHeaderAccessor.CORRELATION_ID, correllationId); return headers; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java index 7358e54aaa..1dd8d47b8f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/dispatcher/BroadcastingDispatcherTests.java @@ -38,7 +38,7 @@ import org.springframework.core.task.TaskExecutor; import org.springframework.messaging.Message; import org.springframework.messaging.MessagingException; import org.springframework.messaging.MessageHandler; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.support.MessageBuilder; @@ -250,10 +250,10 @@ public class BroadcastingDispatcherTests { dispatcher.addHandler(target2); dispatcher.dispatch(new GenericMessage("test")); assertEquals(2, messages.size()); - assertEquals(0, (int) new EiMessageHeaderAccessor(messages.get(0)).getSequenceNumber()); - assertEquals(0, (int) new EiMessageHeaderAccessor(messages.get(0)).getSequenceSize()); - assertEquals(0, (int) new EiMessageHeaderAccessor(messages.get(1)).getSequenceNumber()); - assertEquals(0, (int) new EiMessageHeaderAccessor(messages.get(1)).getSequenceSize()); + assertEquals(0, (int) new IntegrationMessageHeaderAccessor(messages.get(0)).getSequenceNumber()); + assertEquals(0, (int) new IntegrationMessageHeaderAccessor(messages.get(0)).getSequenceSize()); + assertEquals(0, (int) new IntegrationMessageHeaderAccessor(messages.get(1)).getSequenceNumber()); + assertEquals(0, (int) new IntegrationMessageHeaderAccessor(messages.get(1)).getSequenceSize()); } @Test @@ -271,15 +271,15 @@ public class BroadcastingDispatcherTests { Object originalId = inputMessage.getHeaders().getId(); dispatcher.dispatch(inputMessage); assertEquals(3, messages.size()); - assertEquals(1, (int) new EiMessageHeaderAccessor(messages.get(0)).getSequenceNumber()); - assertEquals(3, (int) new EiMessageHeaderAccessor(messages.get(0)).getSequenceSize()); - assertEquals(originalId, new EiMessageHeaderAccessor(messages.get(0)).getCorrelationId()); - assertEquals(2, (int) new EiMessageHeaderAccessor(messages.get(1)).getSequenceNumber()); - assertEquals(3, (int) new EiMessageHeaderAccessor(messages.get(1)).getSequenceSize()); - assertEquals(originalId, new EiMessageHeaderAccessor(messages.get(1)).getCorrelationId()); - assertEquals(3, (int) new EiMessageHeaderAccessor(messages.get(2)).getSequenceNumber()); - assertEquals(3, (int) new EiMessageHeaderAccessor(messages.get(2)).getSequenceSize()); - assertEquals(originalId, new EiMessageHeaderAccessor(messages.get(2)).getCorrelationId()); + assertEquals(1, (int) new IntegrationMessageHeaderAccessor(messages.get(0)).getSequenceNumber()); + assertEquals(3, (int) new IntegrationMessageHeaderAccessor(messages.get(0)).getSequenceSize()); + assertEquals(originalId, new IntegrationMessageHeaderAccessor(messages.get(0)).getCorrelationId()); + assertEquals(2, (int) new IntegrationMessageHeaderAccessor(messages.get(1)).getSequenceNumber()); + assertEquals(3, (int) new IntegrationMessageHeaderAccessor(messages.get(1)).getSequenceSize()); + assertEquals(originalId, new IntegrationMessageHeaderAccessor(messages.get(1)).getCorrelationId()); + assertEquals(3, (int) new IntegrationMessageHeaderAccessor(messages.get(2)).getSequenceNumber()); + assertEquals(3, (int) new IntegrationMessageHeaderAccessor(messages.get(2)).getSequenceSize()); + assertEquals(originalId, new IntegrationMessageHeaderAccessor(messages.get(2)).getCorrelationId()); } /** diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java index a2ab58f072..70eec47964 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/CorrelationIdTests.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.handler.ServiceActivatingHandler; @@ -48,7 +48,7 @@ public class CorrelationIdTests { endpoint.start(); assertTrue(inputChannel.send(message)); Message reply = outputChannel.receive(0); - assertEquals(correlationId, new EiMessageHeaderAccessor(reply).getCorrelationId()); + assertEquals(correlationId, new IntegrationMessageHeaderAccessor(reply).getCorrelationId()); } @Test @@ -63,8 +63,8 @@ public class CorrelationIdTests { endpoint.start(); assertTrue(inputChannel.send(message)); Message reply = outputChannel.receive(0); - assertEquals(new EiMessageHeaderAccessor(message).getCorrelationId(), new EiMessageHeaderAccessor(reply).getCorrelationId()); - assertTrue(new EiMessageHeaderAccessor(message).getCorrelationId().equals(new EiMessageHeaderAccessor(reply).getCorrelationId())); + assertEquals(new IntegrationMessageHeaderAccessor(message).getCorrelationId(), new IntegrationMessageHeaderAccessor(reply).getCorrelationId()); + assertTrue(new IntegrationMessageHeaderAccessor(message).getCorrelationId().equals(new IntegrationMessageHeaderAccessor(reply).getCorrelationId())); } @Test @@ -80,7 +80,7 @@ public class CorrelationIdTests { endpoint.start(); assertTrue(inputChannel.send(message)); Message reply = outputChannel.receive(0); - assertEquals("456-XYZ", new EiMessageHeaderAccessor(reply).getCorrelationId()); + assertEquals("456-XYZ", new IntegrationMessageHeaderAccessor(reply).getCorrelationId()); } @Test @@ -94,7 +94,7 @@ public class CorrelationIdTests { endpoint.start(); assertTrue(inputChannel.send(message)); Message reply = outputChannel.receive(0); - assertEquals("456-XYZ", new EiMessageHeaderAccessor(reply).getCorrelationId()); + assertEquals("456-XYZ", new IntegrationMessageHeaderAccessor(reply).getCorrelationId()); } @Test @@ -107,8 +107,8 @@ public class CorrelationIdTests { splitter.handleMessage(message); Message reply1 = testChannel.receive(100); Message reply2 = testChannel.receive(100); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply1).getCorrelationId()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply2).getCorrelationId()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply1).getCorrelationId()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply2).getCorrelationId()); } @Test @@ -123,10 +123,10 @@ public class CorrelationIdTests { splitter.handleMessage(message); Message reply1 = testChannel.receive(100); Message reply2 = testChannel.receive(100); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply1).getCorrelationId()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply2).getCorrelationId()); - assertTrue("Sequence details missing", reply1.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); - assertTrue("Sequence details missing", reply2.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply1).getCorrelationId()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply2).getCorrelationId()); + assertTrue("Sequence details missing", reply1.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertTrue("Sequence details missing", reply2.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); } @SuppressWarnings("unused") diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java index 8b8e55cefc..49fc4a050a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/ServiceActivatorEndpointTests.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import org.junit.Test; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.channel.TestChannelResolver; import org.springframework.integration.handler.ReplyRequiredException; @@ -178,7 +178,7 @@ public class ServiceActivatorEndpointTests { .setReplyChannel(replyChannel).build(); endpoint.handleMessage(message); Message reply = replyChannel.receive(500); - assertNull(new EiMessageHeaderAccessor(reply).getCorrelationId()); + assertNull(new IntegrationMessageHeaderAccessor(reply).getCorrelationId()); } @Test @@ -195,7 +195,7 @@ public class ServiceActivatorEndpointTests { .setReplyChannel(replyChannel).build(); endpoint.handleMessage(message); Message reply = replyChannel.receive(500); - Object correlationId = new EiMessageHeaderAccessor(reply).getCorrelationId(); + Object correlationId = new IntegrationMessageHeaderAccessor(reply).getCorrelationId(); assertFalse(message.getHeaders().getId().equals(correlationId)); assertEquals("ABC-123", correlationId); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java index f5ab5e4386..276fa313b5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java @@ -22,7 +22,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.annotation.Header; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -49,7 +49,7 @@ public class GatewayWithHeaderAnnotations { public static interface TestService { // wrt INT-1205, priority no longer has a $ prefix, so here we are testing the $custom header as well - public String test(String str, @Header(EiMessageHeaderAccessor.PRIORITY) int priority, @Header("$custom") String custom); + public String test(String str, @Header(IntegrationMessageHeaderAccessor.PRIORITY) int priority, @Header("$custom") String custom); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java index d9ba5a5b49..4aa91f9ba4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/HeaderAnnotationTransformerTests.java @@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.annotation.Header; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.support.MessageBuilder; @@ -46,7 +46,7 @@ public class HeaderAnnotationTransformerTests { Message result = outputChannel.receive(0); assertNotNull(result); assertEquals("testabc", result.getPayload()); - assertEquals("abc", new EiMessageHeaderAccessor(result).getCorrelationId()); + assertEquals("abc", new IntegrationMessageHeaderAccessor(result).getCorrelationId()); } @Test // INT-1082 @@ -61,7 +61,7 @@ public class HeaderAnnotationTransformerTests { Message result = outputChannel.receive(0); assertNotNull(result); assertEquals("ABC", result.getPayload()); - assertEquals("abc", new EiMessageHeaderAccessor(result).getCorrelationId()); + assertEquals("abc", new IntegrationMessageHeaderAccessor(result).getCorrelationId()); } @Test @@ -98,7 +98,7 @@ public class HeaderAnnotationTransformerTests { public static class TestTransformer { public String appendCorrelationId(Object payload, - @Header(value = EiMessageHeaderAccessor.CORRELATION_ID, required = true) Object correlationId) { + @Header(value = IntegrationMessageHeaderAccessor.CORRELATION_ID, required = true) Object correlationId) { return payload.toString() + correlationId.toString(); } @@ -106,7 +106,7 @@ public class HeaderAnnotationTransformerTests { return payload.toString() + header.toString(); } - public String evalCorrelationId(@Header(value = EiMessageHeaderAccessor.CORRELATION_ID + ".toUpperCase()") String result) { + public String evalCorrelationId(@Header(value = IntegrationMessageHeaderAccessor.CORRELATION_ID + ".toUpperCase()") String result) { return result.toString(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java index 061297c8a8..b3ee5eb50e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/GenericMessageTests.java @@ -23,7 +23,7 @@ import java.util.Map; import org.junit.Test; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.support.GenericMessage; /** @@ -36,13 +36,13 @@ public class GenericMessageTests { Map headerMap = new HashMap(); headerMap.put("testAttribute", new Integer(123)); headerMap.put("testProperty", "foo"); - headerMap.put(EiMessageHeaderAccessor.SEQUENCE_SIZE, 42); - headerMap.put(EiMessageHeaderAccessor.SEQUENCE_NUMBER, 24); + headerMap.put(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, 42); + headerMap.put(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, 24); GenericMessage message = new GenericMessage("test", headerMap); assertEquals(new Integer(123), message.getHeaders().get("testAttribute")); assertEquals("foo", message.getHeaders().get("testProperty", String.class)); - assertEquals(new Integer(42), new EiMessageHeaderAccessor(message).getSequenceSize()); - assertEquals(new Integer(24), new EiMessageHeaderAccessor(message).getSequenceNumber()); + assertEquals(new Integer(42), new IntegrationMessageHeaderAccessor(message).getSequenceSize()); + assertEquals(new Integer(24), new IntegrationMessageHeaderAccessor(message).getSequenceNumber()); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/message/MessageBuilderTests.java b/spring-integration-core/src/test/java/org/springframework/integration/message/MessageBuilderTests.java index 9b12a68d18..e474bc124c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/message/MessageBuilderTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/message/MessageBuilderTests.java @@ -29,7 +29,7 @@ import java.util.UUID; import org.junit.Test; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.support.MessageBuilder; /** @@ -123,7 +123,7 @@ public class MessageBuilderTests { public void testPriority() { Message importantMessage = MessageBuilder.withPayload(1) .setPriority(123).build(); - assertEquals(new Integer(123), new EiMessageHeaderAccessor(importantMessage).getPriority()); + assertEquals(new Integer(123), new IntegrationMessageHeaderAccessor(importantMessage).getPriority()); } @Test @@ -131,9 +131,9 @@ public class MessageBuilderTests { Message message1 = MessageBuilder.withPayload(1) .setPriority(42).build(); Message message2 = MessageBuilder.fromMessage(message1) - .setHeaderIfAbsent(EiMessageHeaderAccessor.PRIORITY, 13) + .setHeaderIfAbsent(IntegrationMessageHeaderAccessor.PRIORITY, 13) .build(); - assertEquals(new Integer(42), new EiMessageHeaderAccessor(message2).getPriority()); + assertEquals(new Integer(42), new IntegrationMessageHeaderAccessor(message2).getPriority()); } @Test @@ -141,7 +141,7 @@ public class MessageBuilderTests { Long past = System.currentTimeMillis() - (60 * 1000); Message expiredMessage = MessageBuilder.withPayload(1) .setExpirationDate(past).build(); - assertEquals(past, new EiMessageHeaderAccessor(expiredMessage).getExpirationDate()); + assertEquals(past, new IntegrationMessageHeaderAccessor(expiredMessage).getExpirationDate()); } @Test @@ -149,7 +149,7 @@ public class MessageBuilderTests { Long past = System.currentTimeMillis() - (60 * 1000); Message expiredMessage = MessageBuilder.withPayload(1) .setExpirationDate(new Date(past)).build(); - assertEquals(past, new EiMessageHeaderAccessor(expiredMessage).getExpirationDate()); + assertEquals(past, new IntegrationMessageHeaderAccessor(expiredMessage).getExpirationDate()); } @Test @@ -175,39 +175,39 @@ public class MessageBuilderTests { @Test public void testPushAndPopSequenceDetails() throws Exception { Message message1 = MessageBuilder.withPayload(1).pushSequenceDetails("foo", 1, 2).build(); - assertFalse(message1.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message1.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); Message message2 = MessageBuilder.fromMessage(message1).pushSequenceDetails("bar", 1, 1).build(); - assertTrue(message2.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertTrue(message2.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); Message message3 = MessageBuilder.fromMessage(message2).popSequenceDetails().build(); - assertFalse(message3.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message3.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); } @Test public void testPushAndPopSequenceDetailsWhenNoCorrelationId() throws Exception { Message message1 = MessageBuilder.withPayload(1).build(); - assertFalse(message1.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message1.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); Message message2 = MessageBuilder.fromMessage(message1).pushSequenceDetails("bar", 1, 1).build(); - assertFalse(message2.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message2.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); Message message3 = MessageBuilder.fromMessage(message2).popSequenceDetails().build(); - assertFalse(message3.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message3.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); } @Test public void testPopSequenceDetailsWhenNotPopped() throws Exception { Message message1 = MessageBuilder.withPayload(1).build(); - assertFalse(message1.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message1.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); Message message2 = MessageBuilder.fromMessage(message1).popSequenceDetails().build(); - assertFalse(message2.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message2.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); } @Test public void testPushAndPopSequenceDetailsWhenNoSequence() throws Exception { Message message1 = MessageBuilder.withPayload(1).setCorrelationId("foo").build(); - assertFalse(message1.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message1.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); Message message2 = MessageBuilder.fromMessage(message1).pushSequenceDetails("bar", 1, 1).build(); - assertTrue(message2.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertTrue(message2.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); Message message3 = MessageBuilder.fromMessage(message2).popSequenceDetails().build(); - assertFalse(message3.getHeaders().containsKey(EiMessageHeaderAccessor.SEQUENCE_DETAILS)); + assertFalse(message3.getHeaders().containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_DETAILS)); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java index e22b955437..7098510a16 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RecipientListRouterTests.java @@ -26,7 +26,7 @@ import java.util.List; import org.junit.Test; import org.springframework.beans.DirectFieldAccessor; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.core.MessageSelector; import org.springframework.messaging.support.GenericMessage; @@ -297,13 +297,13 @@ public class RecipientListRouterTests { assertNotNull(result1a); assertNotNull(result1b); assertEquals("test", result1a.getPayload()); - assertEquals(0, new EiMessageHeaderAccessor(result1a).getSequenceNumber().intValue()); - assertEquals(0, new EiMessageHeaderAccessor(result1a).getSequenceSize().intValue()); - assertNull(new EiMessageHeaderAccessor(result1a).getCorrelationId()); + assertEquals(0, new IntegrationMessageHeaderAccessor(result1a).getSequenceNumber().intValue()); + assertEquals(0, new IntegrationMessageHeaderAccessor(result1a).getSequenceSize().intValue()); + assertNull(new IntegrationMessageHeaderAccessor(result1a).getCorrelationId()); assertEquals("test", result1b.getPayload()); - assertEquals(0, new EiMessageHeaderAccessor(result1b).getSequenceNumber().intValue()); - assertEquals(0, new EiMessageHeaderAccessor(result1b).getSequenceSize().intValue()); - assertNull(new EiMessageHeaderAccessor(result1b).getCorrelationId()); + assertEquals(0, new IntegrationMessageHeaderAccessor(result1b).getSequenceNumber().intValue()); + assertEquals(0, new IntegrationMessageHeaderAccessor(result1b).getSequenceSize().intValue()); + assertNull(new IntegrationMessageHeaderAccessor(result1b).getCorrelationId()); } @Test @@ -325,13 +325,13 @@ public class RecipientListRouterTests { assertNotNull(result1a); assertNotNull(result1b); assertEquals("test", result1a.getPayload()); - assertEquals(1,new EiMessageHeaderAccessor(result1a).getSequenceNumber().intValue()); - assertEquals(2, new EiMessageHeaderAccessor(result1a).getSequenceSize().intValue()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(result1a).getCorrelationId()); + assertEquals(1,new IntegrationMessageHeaderAccessor(result1a).getSequenceNumber().intValue()); + assertEquals(2, new IntegrationMessageHeaderAccessor(result1a).getSequenceSize().intValue()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(result1a).getCorrelationId()); assertEquals("test", result1b.getPayload()); - assertEquals(2, new EiMessageHeaderAccessor(result1b).getSequenceNumber().intValue()); - assertEquals(2, new EiMessageHeaderAccessor(result1b).getSequenceSize().intValue()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(result1b).getCorrelationId()); + assertEquals(2, new IntegrationMessageHeaderAccessor(result1b).getSequenceNumber().intValue()); + assertEquals(2, new IntegrationMessageHeaderAccessor(result1b).getSequenceSize().intValue()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(result1b).getCorrelationId()); } @Test(expected = IllegalArgumentException.class) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java index f794c29d4f..0d8b3e78ff 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests.java @@ -33,7 +33,7 @@ import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.annotation.Router; import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.router.AbstractMappingMessageRouter; @@ -188,15 +188,15 @@ public class RouterParserTests { Message message1 = this.sequenceOut1.receive(1000); Message message2 = this.sequenceOut2.receive(1000); Message message3 = this.sequenceOut3.receive(1000); - assertEquals(originalMessage.getHeaders().getId(), new EiMessageHeaderAccessor(message1).getCorrelationId()); - assertEquals(originalMessage.getHeaders().getId(), new EiMessageHeaderAccessor(message2).getCorrelationId()); - assertEquals(originalMessage.getHeaders().getId(), new EiMessageHeaderAccessor(message3).getCorrelationId()); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(message1).getSequenceNumber()); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(message1).getSequenceSize()); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(message2).getSequenceNumber()); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(message2).getSequenceSize()); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(message3).getSequenceNumber()); - assertEquals(new Integer(3), new EiMessageHeaderAccessor(message3).getSequenceSize()); + assertEquals(originalMessage.getHeaders().getId(), new IntegrationMessageHeaderAccessor(message1).getCorrelationId()); + assertEquals(originalMessage.getHeaders().getId(), new IntegrationMessageHeaderAccessor(message2).getCorrelationId()); + assertEquals(originalMessage.getHeaders().getId(), new IntegrationMessageHeaderAccessor(message3).getCorrelationId()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(message1).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(message1).getSequenceSize()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(message2).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(message2).getSequenceSize()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(message3).getSequenceNumber()); + assertEquals(new Integer(3), new IntegrationMessageHeaderAccessor(message3).getSequenceSize()); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterParserTests.java index 5e9675c968..1e60444c10 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/SplitterParserTests.java @@ -21,7 +21,7 @@ import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.DirectChannel; import org.springframework.messaging.PollableChannel; import org.springframework.integration.handler.ReplyRequiredException; @@ -114,8 +114,8 @@ public class SplitterParserTests { PollableChannel output = (PollableChannel) context.getBean("output"); inputChannel.send(MessageBuilder.withPayload(Collections.emptyList()).build()); Message message = output.receive(1000); - assertThat(new EiMessageHeaderAccessor(message).getSequenceNumber(), is(0)); - assertThat(new EiMessageHeaderAccessor(message).getSequenceSize(), is(0)); + assertThat(new IntegrationMessageHeaderAccessor(message).getSequenceNumber(), is(0)); + assertThat(new IntegrationMessageHeaderAccessor(message).getSequenceSize(), is(0)); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java index fe5233dc8c..210500871a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/DefaultSplitterTests.java @@ -29,7 +29,7 @@ import java.util.List; import org.junit.Test; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.endpoint.EventDrivenConsumer; @@ -95,7 +95,7 @@ public class DefaultSplitterTests { endpoint.start(); assertTrue(inputChannel.send(message)); Message reply = outputChannel.receive(0); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply).getCorrelationId()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply).getCorrelationId()); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java index 48fd152d87..3ccf681fd6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/splitter/MethodInvokingSplitterTests.java @@ -27,7 +27,7 @@ import java.util.List; import org.junit.Test; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.annotation.Header; import org.springframework.integration.annotation.Splitter; import org.springframework.integration.channel.QueueChannel; @@ -330,14 +330,14 @@ public class MethodInvokingSplitterTests { List> replies = replyChannel.clear(); Message reply1 = replies.get(0); assertNotNull(reply1); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply1).getSequenceSize()); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(reply1).getSequenceNumber()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply1).getCorrelationId()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply1).getSequenceSize()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply1).getCorrelationId()); Message reply2 = replies.get(1); assertNotNull(reply2); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceSize()); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceNumber()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply2).getCorrelationId()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceSize()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply2).getCorrelationId()); } @Test @@ -350,14 +350,14 @@ public class MethodInvokingSplitterTests { List> replies = replyChannel.clear(); Message reply1 = replies.get(0); assertNotNull(reply1); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply1).getSequenceSize()); - assertEquals(new Integer(1), new EiMessageHeaderAccessor(reply1).getSequenceNumber()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply1).getCorrelationId()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply1).getSequenceSize()); + assertEquals(new Integer(1), new IntegrationMessageHeaderAccessor(reply1).getSequenceNumber()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply1).getCorrelationId()); Message reply2 = replies.get(1); assertNotNull(reply2); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceSize()); - assertEquals(new Integer(2), new EiMessageHeaderAccessor(reply2).getSequenceNumber()); - assertEquals(message.getHeaders().getId(), new EiMessageHeaderAccessor(reply2).getCorrelationId()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceSize()); + assertEquals(new Integer(2), new IntegrationMessageHeaderAccessor(reply2).getSequenceNumber()); + assertEquals(message.getHeaders().getId(), new IntegrationMessageHeaderAccessor(reply2).getCorrelationId()); } @Test diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/HeaderFilterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/HeaderFilterTests.java index 1a489ad464..6f7f13a212 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/HeaderFilterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/HeaderFilterTests.java @@ -25,7 +25,7 @@ import java.util.UUID; import org.junit.Test; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.support.MessageBuilder; import org.springframework.integration.transformer.HeaderFilter; @@ -71,7 +71,7 @@ public class HeaderFilterTests { assertNull(result.getHeaders().get("z")); assertEquals("testErrorChannel", result.getHeaders().getErrorChannel()); assertEquals(replyChannel, result.getHeaders().getReplyChannel()); - assertEquals(correlationId, new EiMessageHeaderAccessor(result).getCorrelationId()); + assertEquals(correlationId, new IntegrationMessageHeaderAccessor(result).getCorrelationId()); } } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java index 8102a7fd54..cb8cea30c0 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java @@ -788,8 +788,7 @@ public abstract class AbstractRemoteFileOutboundGateway extends AbstractReply private File generateLocalDirectory(Message message, String remoteDirectory) { EvaluationContext evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); evaluationContext.setVariable("remoteDirectory", remoteDirectory); - // TODO Change 'desiredResultType' as 'File.class' after fix of SPR-10953. - File localDir = new File(this.localDirectoryExpression.getValue(evaluationContext, message, String.class)); + File localDir = this.localDirectoryExpression.getValue(evaluationContext, message, File.class); if (!localDir.exists()) { Assert.isTrue(localDir.mkdirs(), "Failed to make local directory: " + localDir); } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapperTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapperTests.java index b366f08cec..92f65f396c 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapperTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpMessageMapperTests.java @@ -32,7 +32,7 @@ import org.junit.Test; import org.springframework.core.serializer.DefaultDeserializer; import org.springframework.core.serializer.DefaultSerializer; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.ip.IpHeaders; import org.springframework.integration.ip.tcp.serializer.MapJsonSerializer; import org.springframework.integration.support.MessageBuilder; @@ -110,7 +110,7 @@ public class TcpMessageMapperTests { .getHeaders().get(IpHeaders.IP_ADDRESS)); assertEquals(1234, message .getHeaders().get(IpHeaders.REMOTE_PORT)); - assertEquals(Integer.valueOf(0), new EiMessageHeaderAccessor(message).getSequenceNumber()); + assertEquals(Integer.valueOf(0), new IntegrationMessageHeaderAccessor(message).getSequenceNumber()); message = mapper.toMessage(connection); assertEquals(TEST_PAYLOAD, new String((byte[]) message.getPayload())); assertEquals("MyHost", message @@ -119,7 +119,7 @@ public class TcpMessageMapperTests { .getHeaders().get(IpHeaders.IP_ADDRESS)); assertEquals(1234, message .getHeaders().get(IpHeaders.REMOTE_PORT)); - assertEquals(Integer.valueOf(0), new EiMessageHeaderAccessor(message).getSequenceNumber()); + assertEquals(Integer.valueOf(0), new IntegrationMessageHeaderAccessor(message).getSequenceNumber()); } @Test @@ -172,11 +172,11 @@ public class TcpMessageMapperTests { .getHeaders().get(IpHeaders.IP_ADDRESS)); assertEquals(1234, message .getHeaders().get(IpHeaders.REMOTE_PORT)); - EiMessageHeaderAccessor headerAccessor = new EiMessageHeaderAccessor(message); + IntegrationMessageHeaderAccessor headerAccessor = new IntegrationMessageHeaderAccessor(message); assertEquals(Integer.valueOf(1), headerAccessor.getSequenceNumber()); assertEquals(message.getHeaders().get(IpHeaders.CONNECTION_ID), headerAccessor.getCorrelationId()); message = mapper.toMessage(connection); - headerAccessor = new EiMessageHeaderAccessor(message); + headerAccessor = new IntegrationMessageHeaderAccessor(message); assertEquals(TEST_PAYLOAD, new String((byte[]) message.getPayload())); assertEquals("MyHost", message .getHeaders().get(IpHeaders.HOSTNAME)); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/JdbcMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/JdbcMessageStoreTests.java index d87ff38c46..216dd62a3b 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/JdbcMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/JdbcMessageStoreTests.java @@ -43,7 +43,7 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.serializer.Deserializer; import org.springframework.core.serializer.Serializer; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.history.MessageHistory; import org.springframework.messaging.support.GenericMessage; @@ -176,7 +176,7 @@ public class JdbcMessageStoreTests { message = messageStore.addMessage(message); message = MessageBuilder.fromMessage(message).setCorrelationId("Y").build(); message = messageStore.addMessage(message); - assertEquals("Y", new EiMessageHeaderAccessor(messageStore.getMessage(message.getHeaders().getId())).getCorrelationId()); + assertEquals("Y", new IntegrationMessageHeaderAccessor(messageStore.getMessage(message.getHeaders().getId())).getCorrelationId()); } @Test @@ -426,11 +426,11 @@ public class JdbcMessageStoreTests { assertNotNull(messageFromGroup1); assertNotNull(messageFromGroup2); - LOG.info("messageFromGroup1: " + messageFromGroup1.getHeaders().getId() + "; Sequence #: " + new EiMessageHeaderAccessor(messageFromGroup1).getSequenceNumber()); - LOG.info("messageFromGroup2: " + messageFromGroup2.getHeaders().getId() + "; Sequence #: " + new EiMessageHeaderAccessor(messageFromGroup1).getSequenceNumber()); + LOG.info("messageFromGroup1: " + messageFromGroup1.getHeaders().getId() + "; Sequence #: " + new IntegrationMessageHeaderAccessor(messageFromGroup1).getSequenceNumber()); + LOG.info("messageFromGroup2: " + messageFromGroup2.getHeaders().getId() + "; Sequence #: " + new IntegrationMessageHeaderAccessor(messageFromGroup1).getSequenceNumber()); - assertEquals(Integer.valueOf(1), messageFromGroup1.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); - assertEquals(Integer.valueOf(2), messageFromGroup2.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(1), messageFromGroup1.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(2), messageFromGroup2.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); } @@ -468,11 +468,11 @@ public class JdbcMessageStoreTests { assertNotNull(messageFromRegion1); assertNotNull(messageFromRegion2); - LOG.info("messageFromRegion1: " + messageFromRegion1.getHeaders().getId() + "; Sequence #: " + new EiMessageHeaderAccessor(messageFromRegion1).getSequenceNumber()); - LOG.info("messageFromRegion2: " + messageFromRegion2.getHeaders().getId() + "; Sequence #: " + new EiMessageHeaderAccessor(messageFromRegion1).getSequenceNumber()); + LOG.info("messageFromRegion1: " + messageFromRegion1.getHeaders().getId() + "; Sequence #: " + new IntegrationMessageHeaderAccessor(messageFromRegion1).getSequenceNumber()); + LOG.info("messageFromRegion2: " + messageFromRegion2.getHeaders().getId() + "; Sequence #: " + new IntegrationMessageHeaderAccessor(messageFromRegion1).getSequenceNumber()); - assertEquals(Integer.valueOf(1), messageFromRegion1.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); - assertEquals(Integer.valueOf(2), messageFromRegion2.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(1), messageFromRegion1.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(2), messageFromRegion2.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); } diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java index 20a3baa02e..e1b46d3454 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreMultipleChannelTests.java @@ -38,7 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.support.MessageBuilder; import org.springframework.jdbc.core.JdbcTemplate; @@ -150,7 +150,7 @@ public class MySqlJdbcMessageStoreMultipleChannelTests { public void first(Message message ) { - int sequenceNumber = new EiMessageHeaderAccessor(message).getSequenceNumber(); + int sequenceNumber = new IntegrationMessageHeaderAccessor(message).getSequenceNumber(); LOG.info("First handling sequence number: " + sequenceNumber + "; Message ID: " + message.getHeaders().getId()); @@ -163,7 +163,7 @@ public class MySqlJdbcMessageStoreMultipleChannelTests { public void second(Message message ) { - int sequenceNumber = new EiMessageHeaderAccessor(message).getSequenceNumber(); + int sequenceNumber = new IntegrationMessageHeaderAccessor(message).getSequenceNumber(); LOG.info("Second handling sequence number: " + sequenceNumber + "; Message ID: " + message.getHeaders().getId()); if (sequenceNumber != 2) { diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreTests.java index bf46040ede..02285d1722 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlJdbcMessageStoreTests.java @@ -45,7 +45,7 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.serializer.Deserializer; import org.springframework.core.serializer.Serializer; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.history.MessageHistory; import org.springframework.integration.jdbc.JdbcMessageStore; @@ -215,7 +215,7 @@ public class MySqlJdbcMessageStoreTests { message = messageStore.addMessage(message); message = MessageBuilder.fromMessage(message).setCorrelationId("Y").build(); message = messageStore.addMessage(message); - assertEquals("Y", new EiMessageHeaderAccessor(messageStore.getMessage(message.getHeaders().getId())).getCorrelationId()); + assertEquals("Y", new IntegrationMessageHeaderAccessor(messageStore.getMessage(message.getHeaders().getId())).getCorrelationId()); } @Test @@ -466,11 +466,11 @@ public class MySqlJdbcMessageStoreTests { assertNotNull(messageFromGroup1); assertNotNull(messageFromGroup2); - LOG.info("messageFromGroup1: " + messageFromGroup1.getHeaders().getId() + "; Sequence #: " + new EiMessageHeaderAccessor(messageFromGroup1).getSequenceNumber()); - LOG.info("messageFromGroup2: " + messageFromGroup2.getHeaders().getId() + "; Sequence #: " + new EiMessageHeaderAccessor(messageFromGroup2).getSequenceNumber()); + LOG.info("messageFromGroup1: " + messageFromGroup1.getHeaders().getId() + "; Sequence #: " + new IntegrationMessageHeaderAccessor(messageFromGroup1).getSequenceNumber()); + LOG.info("messageFromGroup2: " + messageFromGroup2.getHeaders().getId() + "; Sequence #: " + new IntegrationMessageHeaderAccessor(messageFromGroup2).getSequenceNumber()); - assertEquals(Integer.valueOf(1), (Integer) messageFromGroup1.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); - assertEquals(Integer.valueOf(2), (Integer) messageFromGroup2.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(1), (Integer) messageFromGroup1.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(2), (Integer) messageFromGroup2.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); } @@ -510,11 +510,11 @@ public class MySqlJdbcMessageStoreTests { assertNotNull(messageFromRegion1); assertNotNull(messageFromRegion2); - LOG.info("messageFromRegion1: " + messageFromRegion1.getHeaders().getId() + "; Sequence #: " + new EiMessageHeaderAccessor(messageFromRegion1).getSequenceNumber()); - LOG.info("messageFromRegion2: " + messageFromRegion2.getHeaders().getId() + "; Sequence #: " +new EiMessageHeaderAccessor(messageFromRegion2).getSequenceNumber()); + LOG.info("messageFromRegion1: " + messageFromRegion1.getHeaders().getId() + "; Sequence #: " + new IntegrationMessageHeaderAccessor(messageFromRegion1).getSequenceNumber()); + LOG.info("messageFromRegion2: " + messageFromRegion2.getHeaders().getId() + "; Sequence #: " +new IntegrationMessageHeaderAccessor(messageFromRegion2).getSequenceNumber()); - assertEquals(Integer.valueOf(1), (Integer) messageFromRegion1.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); - assertEquals(Integer.valueOf(2), (Integer) messageFromRegion2.getHeaders().get(EiMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(1), (Integer) messageFromRegion1.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); + assertEquals(Integer.valueOf(2), (Integer) messageFromRegion2.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)); } } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java index 8a5865bc53..cd35ff8655 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/AbstractJmsChannel.java @@ -17,7 +17,7 @@ package org.springframework.integration.jms; import org.springframework.messaging.Message; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.channel.AbstractMessageChannel; import org.springframework.jms.core.JmsTemplate; import org.springframework.util.Assert; @@ -45,7 +45,7 @@ public abstract class AbstractJmsChannel extends AbstractMessageChannel { @Override protected boolean doSend(Message message, long timeout) { try { - DynamicJmsTemplateProperties.setPriority(new EiMessageHeaderAccessor(message).getPriority()); + DynamicJmsTemplateProperties.setPriority(new IntegrationMessageHeaderAccessor(message).getPriority()); this.jmsTemplate.convertAndSend(message); } finally { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java index a128a549a6..520a9551e7 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java @@ -44,7 +44,7 @@ import javax.jms.Topic; import org.springframework.context.SmartLifecycle; import org.springframework.expression.Expression; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.MessageHandlingException; import org.springframework.integration.MessageTimeoutException; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; @@ -668,7 +668,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp jmsRequest.setJMSReplyTo(replyTo); connection.start(); - Integer priority = new EiMessageHeaderAccessor(requestMessage).getPriority(); + Integer priority = new IntegrationMessageHeaderAccessor(requestMessage).getPriority(); if (priority == null) { priority = this.priority; } @@ -722,7 +722,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp jmsRequest.setJMSReplyTo(replyTo); connection.start(); - Integer priority = new EiMessageHeaderAccessor(requestMessage).getPriority(); + Integer priority = new IntegrationMessageHeaderAccessor(requestMessage).getPriority(); if (priority == null) { priority = this.priority; } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java index 4964155183..6780f01050 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java @@ -20,7 +20,7 @@ import javax.jms.Destination; import javax.jms.JMSException; import org.springframework.expression.Expression; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.handler.AbstractMessageHandler; import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor; import org.springframework.jms.core.JmsTemplate; @@ -109,7 +109,7 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { Object objectToSend = (this.extractPayload) ? message.getPayload() : message; MessagePostProcessor messagePostProcessor = new HeaderMappingMessagePostProcessor(message, this.headerMapper); try { - DynamicJmsTemplateProperties.setPriority(new EiMessageHeaderAccessor(message).getPriority()); + DynamicJmsTemplateProperties.setPriority(new IntegrationMessageHeaderAccessor(message).getPriority()); this.send(destination, objectToSend, messagePostProcessor); } finally { diff --git a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java index 15c647ff84..241b9f5a80 100644 --- a/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java +++ b/spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java @@ -25,7 +25,7 @@ import org.hamcrest.Factory; import org.hamcrest.Matcher; import org.junit.Assert; -import org.springframework.integration.EiMessageHeaderAccessor; +import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.Message; import org.springframework.messaging.MessageHeaders; @@ -127,7 +127,7 @@ public class HeaderMatcher extends TypeSafeMatcher> { @Factory public static Matcher> hasCorrelationId(T value) { - return new HeaderMatcher(MapContentMatchers.hasEntry(EiMessageHeaderAccessor.CORRELATION_ID, value)); + return new HeaderMatcher(MapContentMatchers.hasEntry(IntegrationMessageHeaderAccessor.CORRELATION_ID, value)); } @Factory @@ -137,7 +137,7 @@ public class HeaderMatcher extends TypeSafeMatcher> { @Factory public static Matcher> hasSequenceNumber(Matcher matcher) { - return new HeaderMatcher(MapContentMatchers.hasEntry(EiMessageHeaderAccessor.SEQUENCE_NUMBER, matcher)); + return new HeaderMatcher(MapContentMatchers.hasEntry(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER, matcher)); } @Factory @@ -147,7 +147,7 @@ public class HeaderMatcher extends TypeSafeMatcher> { @Factory public static Matcher> hasSequenceSize(Matcher value) { - return new HeaderMatcher(MapContentMatchers.hasEntry(EiMessageHeaderAccessor.SEQUENCE_SIZE, value)); + return new HeaderMatcher(MapContentMatchers.hasEntry(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, value)); } @Factory @@ -157,7 +157,7 @@ public class HeaderMatcher extends TypeSafeMatcher> { @Factory public static Matcher> hasExpirationDate(Matcher matcher) { - return new HeaderMatcher(MapContentMatchers.hasEntry(EiMessageHeaderAccessor.EXPIRATION_DATE, matcher)); + return new HeaderMatcher(MapContentMatchers.hasEntry(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, matcher)); } @Factory diff --git a/src/reference/docbook/changes-2.2-3.0.xml b/src/reference/docbook/changes-2.2-3.0.xml index 66ed50d02d..b455017054 100644 --- a/src/reference/docbook/changes-2.2-3.0.xml +++ b/src/reference/docbook/changes-2.2-3.0.xml @@ -1,9 +1,676 @@

- Changes between 2.2 and 3.0 - - For an overview of the changes in Spring Integration 3.0 since version 2.2, - please see . - + xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:xlink="http://www.w3.org/1999/xlink"> + Changes Between 2.2 and 3.0 +
+ New Components +
+ HTTP Request Mapping + + The HTTP module now provides powerful Request Mapping support for Inbound Endpoints. Class UriPathHandlerMapping + was replaced by IntegrationRequestMappingHandlerMapping, which is registered under the bean name + integrationRequestMappingHandlerMapping in the application context. Upon parsing of the HTTP Inbound Endpoint, + a new IntegrationRequestMappingHandlerMapping bean is either registered or an existing bean is being reused. + To achieve flexible Request Mapping configuration, Spring Integration provides the <request-mapping/> + sub-element for the <http:inbound-channel-adapter/> and the <http:inbound-gateway/>. + Both HTTP Inbound Endpoints are now fully based on the Request Mapping infrastructure that was introduced with Spring MVC 3.1. + For example, multiple paths are supported on a single inbound endpoint. + For more information see . + +
+
+ Spring Expression Language (SpEL) Configuration + + A new IntegrationEvaluationContextFactoryBean is provided to allow + configuration of custom PropertyAccessors and functions for + use in SpEL expressions throughout the framework. For more information see . + +
+
+ SpEL Functions Support + + To customize the SpEL EvaluationContext with static + Method functions, the new <spel-function/> + component is introduced. Two built-in functions are also provided (#jsonPath + and #xpath). For more information see . + +
+
+ SpEL PropertyAccessors Support + + To customize the SpEL EvaluationContext with + PropertyAccessor implementations + the new <spel-property-accessors/> component is introduced. + For more information see . + +
+
+ Redis: New Components + + A new Redis-based + MetadataStore + implementation has been added. The RedisMetadataStore can + be used to maintain state of a MetadataStore + across application restarts. This new MetadataStore + implementation can be used with adapters such as: + + + Twitter Inbound Adapters + Feed Inbound Channel Adapter + + + New queue-based components have been added. The <int-redis:queue-inbound-channel-adapter/> + and the <int-redis:queue-outbound-channel-adapter/> components are provided + to perform 'right pop' and 'left push' operations on a Redis List, respectively. + + + For more information see . + +
+
+ Header Channel Registry + + It is now possible to instruct the framework to store reply and error channels + in a registry for later resolution. This is useful for cases where + the replyChannel or errorChannel might be lost; for example + when serializing + a message. See for more information. + +
+
+ MongoDB support: New ConfigurableMongoDbMessageStore + + In addition to the existing eMongoDbMessageStore, a new + ConfigurableMongoDbMessageStore has been introduced. + This provides a more robust and flexible implementation of MessageStore + for MongoDB. + It does not have backward compatibility, with the existing store, + but it is recommended to use it for new applications. Existing applications can use it, but messages + in the old store will not be available. + See for more information. + +
+
+ Syslog Support + + Building on the 2.2 SyslogToMapTransformer Spring + Integration 3.0 now introduces + UDP and TCP inbound channel adapters especially tailored + for receiving SYSLOG messages. For more information, see + . + +
+
+ 'Tail' Support + + File 'tail'ing inbound channel adapters are now provided to generate messages when + lines are added to the end of text files; see . + +
+
+ JMX Support + + + + A new <int-jmx:tree-polling-channel-adapter/> is provided; this + adapter queries the JMX MBean tree and sends a message with a payload that is the + graph of objects that matches the query. By default the MBeans are mapped to + primitives and simple Objects like Map, List and arrays - permitting simple + transformation, for example, to JSON. + + + The IntegrationMBeanExporter now allows the configuration of + a custom ObjectNamingStrategy using the naming-strategy + attribute. + + + + + For more information, see . + +
+
+ TCP/IP Connection Events and Connection Management + + TcpConnections now emit + ApplicationEvents (specifically + TcpConnectionEvents) when connections are + opened, closed, or an exception occurs. This allows applications + to be informed of changes to TCP connections using the normal + Spring ApplicationListener + mechanism. + + + AbstractTcpConnection has been renamed + TcpConnectionSupport; custom connections that + are subclasses of this class, can use its methods to publish events. + Similarly, AbstractTcpConnectionInterceptor has + been renamed to TcpConnectionInterceptorSupport. + + + In addition, a new <int-ip:tcp-connection-event-inbound-channel-adapter/> + is provided; by default, this adapter sends all TcpConnectionEvents + to a Channel. + + + Further, the TCP Connection Factories, now provide a new method + getOpenConnectionIds(), which returns a list of identifiers for all + open connections; this allows applications, for example, to broadcast to all + open connections. + + + Finally, the connection factories also provide a new method + closeConnection(String connectionId) which allows applications + to explicitly close a connection using its ID. + + + For more information see . + +
+
+ Inbound Channel Adapter Script Support + + The <int:inbound-channel-adapter/> now supports <expression/> + and <script/> sub-elements to create a + MessageSource; see . + +
+
+ Content Enricher: Headers Enrichment Support + + The Content Enricher now provides configuration for <header/> + sub-elements, to enrich the outbound Message with headers based on the reply Message from the underlying + message flow. For more information see . + +
+
+ +
+ General Changes +
+ Message ID Generation + + Previously, message ids were generated using the JDK UUID.randomUUID() method. With this + release, the default mechanism has been changed to use a more efficient algorithm which + is significantly faster. In addition, the ability to change + the strategy used to generate message ids has been added. + For more information see . + +
+
+ <gateway> Changes + + + + It is now possible to set common headers across all gateway methods, and more options + are provided for adding, to the message, information about which method was invoked. + + + It is now possible to entirely customize the way that gateway method calls are mapped + to messages. + + + The GatewayMethodMetadata is now public class and it makes possible flexibly + to configure the GatewayProxyFactoryBean programmatically from Java code. + + + + + For more information see . + +
+
+ HTTP Endpoint Changes + + + + Outbound Endpoint 'encode-uri' - <http:outbound-gateway/> + and <http:outbound-channel-adapter/> now + provide an encode-uri attribute to allow disabling the encoding of the URI object + before sending the request. + + + Inbound Endpoint 'merge-with-default-converters' - + <http:inbound-gateway/> and <http:inbound-channel-adapter/> now + have a merge-with-default-converters attribute to include the list of default + HttpMessageConverters after the custom message converters. + + + 'If-(Un)Modified-Since' HTTP Headers - previously, + 'If-Modified-Since' and 'If-Unmodified-Since' HTTP headers were incorrectly processed + within from/to HTTP headers mapping in the DefaultHttpHeaderMapper. + Now, in addition correcting that issue, DefaultHttpHeaderMapper provides + date parsing from formatted strings for any HTTP headers that accept date-time values. + + + Inbound Endpoint Expression Variables - + In addition to the existing #requestParams and #pathVariables, + the <http:inbound-gateway/> and <http:inbound-channel-adapter/> + now support additional useful variables: #matrixVariables, #requestAttributes, + #requestHeaders and #cookies. These variables are available in + both payload and header expressions. + + + Outbound Endpoint 'uri-variables-expression' - HTTP Outbound Endpoints + now support the uri-variables-expression attribute to specify + an Expression to evaluate a Map + for all URI variable placeholders within URL template. This allows selection of a different + map of expressions based on the outgoing message. + + + + + For more information see . + +
+
+ Jackson Support (JSON) + + + + A new abstraction for JSON conversion has been introduced. Implementations for Jackson 1.x + and Jackson 2 are currently provided, with the version being determined by presence on + the classpath. Previously, only Jackson 1.x was supported. + + + The ObjectToJsonTransformer and JsonToObjectTransformer + now emit/consume headers containing type information. + + + + + For more information, see 'JSON Transformers' in . + +
+
+ Chain Elements 'id' Attribute + + Previously, the id attribute for elements within a <chain> was + ignored and, in some cases, disallowed. Now, the id attribute is allowed + for all elements within a <chain>. The bean names of chain elements is a combination + of the surrounding chain's id and the id of the element + itself. For example: 'fooChain$child.fooTransformer.handler'. + For more information see . + +
+
+ Aggregator 'empty-group-min-timeout' property + + The AbstractCorrelatingMessageHandler provides a new property + empty-group-min-timeout + to allow empty group expiry to run on a longer schedule than expiring partial groups. Empty groups will + not be removed from the MessageStore until they have not been modified + for at least this number of milliseconds. For more information see . + +
+
+ Persistent File List Filters (file, (S)FTP) + + New FileListFilters that use a persistent MetadataStore are + now available. These can be used to prevent duplicate files after a system restart. See + , , and for more information. + +
+
+ Scripting Support: Variables Changes + + A new variables attribute has been introduced for scripting components. + In addition, variable bindings are now allowed for inline scripts. + See and for more information. + +
+
+ Direct Channel Load Balancing configuration + + Previously, when configuring LoadBalancingStrategy on the channel's 'dispatcher' sub-element, + the only available option was to use a pre-defined enumeration of values which did not allow one to set a custom implementation + of the LoadBalancingStrategy. You can now use load-balancer-ref to provide + a reference to a custom implementation of the LoadBalancingStrategy. + For more information see . + +
+
+ PublishSubscribeChannel Behavior + + Previously, sending to a <publish-subscribe-channel/> that had + no subscribers would return a false result. If used in conjunction with + a MessagingTemplate, this would result in an exception being thrown. + Now, the PublishSubscribeChannel has a property + minSubscribers (default 0). If the message is sent to at least the minimum + number of subscribers, the send is deemed to be successful (even if zero). If an application + is expecting to get an exception under these conditions, set the minimum subscribers to at + least 1. + +
+
+ FTP, SFTP and FTPS Changes + + The FTP, SFTP and FTPS endpoints no longer cache sessions by default + + + The deprecated cached-sessions attribute has been removed from all endpoints. + Previously, the embedded caching mechanism controlled by this attribute's value didn't + provide a way to limit the size of the cache, which could + grow indefinitely. The CachingConnectionFactory was introduced in + release 2.1 and it became the preferred (and is now the only) way to cache sessions. + + + The CachingConnectionFactory now provides a new method + resetCache(). This immediately closes idle sessions and causes in-use + sessions to be closed as and when they are returned to the cache. + + + The DefaultSftpSessionFactory (in conjunction with a + CachingSessionFactory) now supports multiplexing channels over + a single SSH connection (SFTP Only). + + + FTP, SFTP and FTPS Inbound Adapters + + + Previously, there was no way to override the default filter used to process files retrieved + from a remote server. The filter attribute determines which files are retrieved + but the FileReadingMessageSource uses an + AcceptOnceFileListFilter. This means that if a new copy of a file + is retrieved, with the same name as a previously copied file, no message was sent from the + adapter. + + + With this release, a new attribute local-filter allows you to override the + default filter, for example with an AcceptAllFileListFilter, or some + other custom filter. + + + For users that wish the behavior of the AcceptOnceFileListFilter + to be maintained across JVM executions, a custom filter that retains state, perhaps on + the file system, can now be configured. + + + Inbound Channel Adapters now support the preserve-timestamp attribute, which + sets the local file modified timestamp to the timestamp from the server (default false). + + + FTP, SFTP and FTPS Gateways + + + + + The gateways now support the mv command, enabling + the renaming of remote files. + + + The gateways now support recursive ls and + mget commands, enabling + the retrieval of a remote file tree. + + + The gateways now support put and + mput commands, enabling + sending file(s) to the remote server. + + + The local-filename-generator-expression attribute is now supported, + enabling the naming of local files during retrieval. By default, the same + name as the remote file is used. + + + The local-directory-expression attribute is now supported, + enabling the naming of local directories during retrieval based on the remote directory. + + + + + Remote File Template + + + A new higher-level abstraction (RemoteFileTemplate) is provided over the + Session implementations used by the FTP and SFTP modules. While it is + used internally by endpoints, this abstraction can also be used programmatically and, like all + Spring *Template implementations, reliably closes the underlying session while allowing + low level access to the session when needed. + + + For more information, see + and . + +
+
+ 'requires-reply' Attribute for Outbound Gateways + + All Outbound Gateways (e.g. <jdbc:outbound-gateway/> or <jms:outbound-gateway/>) + are designed for 'request-reply' scenarios. A response is expected from the external service and + will be published to the reply-channel, or the replyChannel message header. + However, there are some cases where the external system might not always return a + result, e.g. a <jdbc:outbound-gateway/>, when a SELECT ends with an empty ResultSet + or, say, a Web Service is One-Way. An option is therefore needed to configure whether or not a + reply is required. + For this purpose, the requires-reply attribute has been introduced for Outbound Gateway components. + In most cases, the default value for requires-reply is true and, if there is not any result, + a ReplyRequiredException will be thrown. Changing the value to false + means that, if an external service doesn't return anything, the message-flow will end at that point, + similar to an Outbound Channel Adapter. + + + The WebService outbound gateway has an additional attribute ignore-empty-responses; this is used to + treat an empty String response as if no response was received. It is true by default but can be set to false to + allow the application to receive an empty String in the reply message payload. When the attribute is true an empty + string is treated as no response for the purposes of the requires-reply attribute. + requires-reply is false by default for the WebService outbound gateway. + + + Note, the requiresReply property was previously present in the AbstractReplyProducingMessageHandler + but set to false, and there wasn't any way to configure it on Outbound Gateways using the XML namespace. + + + Previously, a gateway receiving no reply would silently end the flow (with a DEBUG log message); with this change an + exception will now be thrown by default by most gateways. To revert to the previous behavior, + set requires-reply to false. + +
+
+ AMQP Outbound Gateway Header Mapping + + Previously, the <int-amqp:outbound-gateway/> mapped headers before invoking the message + converter, and the converter could overwrite headers such as content-type. The + outbound adapter maps the headers after the conversion, which means headers like + content-type from the outbound Message (if present) are used. + + + Starting with this release, the gateway now maps the headers after the message conversion, + consistent with the adapter. If your application relies on the previous behavior (where the + converter's headers overrode the mapped headers), you either need to filter those headers + (before the message reaches the gateway) + or set them appropriately. The headers affected by the SimpleMessageConverter + are content-type and content-encoding. Custom message converters + may set other headers. + +
+
+ Stored Procedure Components Improvements + + For more complex database-specific types, not supported by the standard + CallableStatement.getObject method, 2 new additional + attributes were introduced to the <sql-parameter-definition/> + element with OUT-direction: + + + type-name + return-type + + + + The row-mapper attribute of the Stored Procedure Inbound Channel Adapter + <returning-resultset/> sub-element + now supports a reference to a RowMapper bean + definition. Previously, it contained just a class name (which is still supported). + + + For more information see . + + +
+
+ Web Service Outbound URI Configuration + + Web Service Outbound Gateway 'uri' attribute now supports <uri-variable/> substitution for all + URI-schemes supported by Spring Web Services. For more information see . + +
+
+ Redis Adapter Changes + + + + The Redis Inbound Channel Adapter can now use a null value for serializer + property, with the raw data being the message payload. + + + The Redis Outbound Channel Adapter now has the topic-expression property to determine + the Redis topic against the Message at runtime. + + + The Redis Inbound Channel Adapter, in addition to the existing topics attribute, + now has the topic-patterns attribute. + + + + + For more information, see . + +
+
+ Advising Filters + + Previously, when a <filter/> had a <request-handler-advice-chain/>, the discard + action was all performed within the scope of the advice chain (including any downstream flow + on the discard-channel). The filter element now has an attribute + discard-within-advice (default true), to allow the discard action to + be performed after the advice chain completes. See . + +
+
+ Advising Endpoints using Annotations + + Request Handler Advice Chains can now be configured using annotations. See + . + +
+
+ ObjectToStringTransformer Improvements + + This transformer now correctly transforms byte[] and char[] + payloads to String. For more information see . + +
+
+ JPA Support Changes + + Payloads to persist or + merge can now be of type + java.lang.Iterable. + + + In that case, each object returned by the + Iterable is treated as + an entity and persisted or merged using the underlying + EntityManager. + NULL values returned by the iterator are ignored. + + + The JPA adapters now have additional attributes to optionally 'flush' and 'clear' + entities from the associated persistence context after performing persistence operations. + + + Retrieving gateways had no mechanism to specify the first record to be retrieved which + is a common use case. The retrieving gateways now support specifying this parameter + using a first-result and first-result-expression attributes + to the gateway definition. . + + + The JPA retrieving gateway and inbound adapter now have an attribute to specify the maximum + number of results in a result set as an expression. In addition, the + max-results attribute has been introduced to replace + max-number-of-results, which has been deprecated. + max-results and max-results-expression + are used to provide the maximum number of results, + or an expression to compute the maximum number of results, respectively, in the + result set. + + For more information see . +
+
+ Delayer: delay expression + + Previously, the <delayer> provided a delay-header-name attribute + to determine the delay value at runtime. In complex cases it was necessary + to precede the <delayer> with a <header-enricher>. + Spring Integration 3.0 introduced the expression attribute and expression + sub-element for dynamic delay determination. The delay-header-name attribute is now deprecated + because the header evaluation can be specified in the expression. In addition, + the ignore-expression-failures was introduced to control the behavior when an + expression evaluation fails. + For more information see . + +
+
+ JDBC Message Store Improvements + + Spring Integration 3.0 adds a new set of DDL + scripts for MySQL version 5.6.4 and higher. + Now MySQL supports fractional + seconds and is thus improving the FIFO ordering when + polling from a MySQL-based Message Store. For more information, + please see . + +
+
+ IMAP Idle Connection Exceptions + + Previously, if an IMAP idle connection failed, it was logged but there was no mechanism to + inform an application. Such exceptions now generate ApplicationEvents. + Applications can obtain these events using an <int-event:inbound-channel-adapter> + or any ApplicationListener configured to receive an + ImapIdleExceptionEvent or one of its super classes. + +
+
+ Message Headers and TCP + + The TCP connection factories now enable the configuration of a flexible mechanism to + transfer selected headers (as well as the payload) over TCP. A new + TcpMessageMapper + enables the selection of the headers, and an appropriate (de)serializer needs to be + configured to write the resulting Map to the + TCP stream. A MapJsonSerializer is provided as a convenient + mechanism to transfer headers and payload over TCP. + For more information see . + +
+
+ JMS Message Driven Channel Adapter + + Previously, when configuring a <message-driven-channel-adapter/>, if you wished to + use a specific TaskExecutor, it was necessary to declare a container + bean and provide it to the adapter using the container attribute. The + task-executor is now provided, allowing it to be set directly on the adapter. This is + in addition to several other container attributes that were already available. + +
+
+ RMI Inbound Gateway + + The RMI Inbound Gateway now supports an error-channel attribute. See + . + +
+
+ XsltPayloadTransformer + + You can now specify the transformer factory class name using the + transformer-factory-class attribute. See + +
+
diff --git a/src/reference/docbook/changes-3.0-4.0.xml b/src/reference/docbook/changes-3.0-4.0.xml new file mode 100644 index 0000000000..b5e1f78c00 --- /dev/null +++ b/src/reference/docbook/changes-3.0-4.0.xml @@ -0,0 +1,9 @@ + +
+ Changes between 3.0 and 4.0 + + For an overview of the changes in Spring Integration 4.0 since version 3.0, + please see . + +
diff --git a/src/reference/docbook/history.xml b/src/reference/docbook/history.xml index 05f8822bda..e27b46b547 100644 --- a/src/reference/docbook/history.xml +++ b/src/reference/docbook/history.xml @@ -4,8 +4,10 @@ xmlns:xi="http://www.w3.org/2001/XInclude"> Change History - - + + + + diff --git a/src/reference/docbook/index.xml b/src/reference/docbook/index.xml index d1a7ba6bf2..62b8d4a7eb 100644 --- a/src/reference/docbook/index.xml +++ b/src/reference/docbook/index.xml @@ -69,9 +69,9 @@ For those who are already familiar with Spring Integration, this chapter - provides a brief overview of the new features of version 2.2. If you are + provides a brief overview of the new features of version 4.0. If you are interested in the changes and features, that were introduced in earlier - versions, please take a look at chapter: + versions, please see chapter: diff --git a/src/reference/docbook/whats-new.xml b/src/reference/docbook/whats-new.xml index 4db5c8ddf5..40577f7c5c 100644 --- a/src/reference/docbook/whats-new.xml +++ b/src/reference/docbook/whats-new.xml @@ -2,682 +2,23 @@ - What's new in Spring Integration 3.0? + What's new in Spring Integration 4.0? This chapter provides an overview of the new features and improvements - that have been introduced with Spring Integration 3.0. If you are interested + that have been introduced with Spring Integration 4.0. If you are interested in more details, please see the Issue Tracker tickets that - were resolved as part of the 3.0 development process. + were resolved as part of the 4.0 development process. - -
- New Components -
- HTTP Request Mapping - - The HTTP module now provides powerful Request Mapping support for Inbound Endpoints. Class UriPathHandlerMapping - was replaced by IntegrationRequestMappingHandlerMapping, which is registered under the bean name - integrationRequestMappingHandlerMapping in the application context. Upon parsing of the HTTP Inbound Endpoint, - a new IntegrationRequestMappingHandlerMapping bean is either registered or an existing bean is being reused. - To achieve flexible Request Mapping configuration, Spring Integration provides the <request-mapping/> - sub-element for the <http:inbound-channel-adapter/> and the <http:inbound-gateway/>. - Both HTTP Inbound Endpoints are now fully based on the Request Mapping infrastructure that was introduced with Spring MVC 3.1. - For example, multiple paths are supported on a single inbound endpoint. - For more information see . - -
-
- Spring Expression Language (SpEL) Configuration - - A new IntegrationEvaluationContextFactoryBean is provided to allow - configuration of custom PropertyAccessors and functions for - use in SpEL expressions throughout the framework. For more information see . - -
-
- SpEL Functions Support - - To customize the SpEL EvaluationContext with static - Method functions, the new <spel-function/> - component is introduced. Two built-in functions are also provided (#jsonPath - and #xpath). For more information see . - -
-
- SpEL PropertyAccessors Support - - To customize the SpEL EvaluationContext with - PropertyAccessor implementations - the new <spel-property-accessors/> component is introduced. - For more information see . - -
-
- Redis: New Components - - A new Redis-based - MetadataStore - implementation has been added. The RedisMetadataStore can - be used to maintain state of a MetadataStore - across application restarts. This new MetadataStore - implementation can be used with adapters such as: - - - Twitter Inbound Adapters - Feed Inbound Channel Adapter - - - New queue-based components have been added. The <int-redis:queue-inbound-channel-adapter/> - and the <int-redis:queue-outbound-channel-adapter/> components are provided - to perform 'right pop' and 'left push' operations on a Redis List, respectively. - - - For more information see . - -
-
- Header Channel Registry - - It is now possible to instruct the framework to store reply and error channels - in a registry for later resolution. This is useful for cases where - the replyChannel or errorChannel might be lost; for example - when serializing - a message. See for more information. - -
-
- MongoDB support: New ConfigurableMongoDbMessageStore - - In addition to the existing eMongoDbMessageStore, a new - ConfigurableMongoDbMessageStore has been introduced. - This provides a more robust and flexible implementation of MessageStore - for MongoDB. - It does not have backward compatibility, with the existing store, - but it is recommended to use it for new applications. Existing applications can use it, but messages - in the old store will not be available. - See for more information. - -
-
- Syslog Support - - Building on the 2.2 SyslogToMapTransformer Spring - Integration 3.0 now introduces - UDP and TCP inbound channel adapters especially tailored - for receiving SYSLOG messages. For more information, see - . - -
-
- 'Tail' Support - - File 'tail'ing inbound channel adapters are now provided to generate messages when - lines are added to the end of text files; see . - -
-
- JMX Support - - - - A new <int-jmx:tree-polling-channel-adapter/> is provided; this - adapter queries the JMX MBean tree and sends a message with a payload that is the - graph of objects that matches the query. By default the MBeans are mapped to - primitives and simple Objects like Map, List and arrays - permitting simple - transformation, for example, to JSON. - - - The IntegrationMBeanExporter now allows the configuration of - a custom ObjectNamingStrategy using the naming-strategy - attribute. - - - - - For more information, see . - -
-
- TCP/IP Connection Events and Connection Management - - TcpConnections now emit - ApplicationEvents (specifically - TcpConnectionEvents) when connections are - opened, closed, or an exception occurs. This allows applications - to be informed of changes to TCP connections using the normal - Spring ApplicationListener - mechanism. - - - AbstractTcpConnection has been renamed - TcpConnectionSupport; custom connections that - are subclasses of this class, can use its methods to publish events. - Similarly, AbstractTcpConnectionInterceptor has - been renamed to TcpConnectionInterceptorSupport. - - - In addition, a new <int-ip:tcp-connection-event-inbound-channel-adapter/> - is provided; by default, this adapter sends all TcpConnectionEvents - to a Channel. - - - Further, the TCP Connection Factories, now provide a new method - getOpenConnectionIds(), which returns a list of identifiers for all - open connections; this allows applications, for example, to broadcast to all - open connections. - - - Finally, the connection factories also provide a new method - closeConnection(String connectionId) which allows applications - to explicitly close a connection using its ID. - - - For more information see . - -
-
- Inbound Channel Adapter Script Support - - The <int:inbound-channel-adapter/> now supports <expression/> - and <script/> sub-elements to create a - MessageSource; see . - -
-
- Content Enricher: Headers Enrichment Support - - The Content Enricher now provides configuration for <header/> - sub-elements, to enrich the outbound Message with headers based on the reply Message from the underlying - message flow. For more information see . - -
-
- -
+
General Changes -
- Message ID Generation - - Previously, message ids were generated using the JDK UUID.randomUUID() method. With this - release, the default mechanism has been changed to use a more efficient algorithm which - is significantly faster. In addition, the ability to change - the strategy used to generate message ids has been added. - For more information see . - -
-
- <gateway> Changes - - - - It is now possible to set common headers across all gateway methods, and more options - are provided for adding, to the message, information about which method was invoked. - - - It is now possible to entirely customize the way that gateway method calls are mapped - to messages. - - - The GatewayMethodMetadata is now public class and it makes possible flexibly - to configure the GatewayProxyFactoryBean programmatically from Java code. - - - - - For more information see . - -
-
- HTTP Endpoint Changes - - - - Outbound Endpoint 'encode-uri' - <http:outbound-gateway/> - and <http:outbound-channel-adapter/> now - provide an encode-uri attribute to allow disabling the encoding of the URI object - before sending the request. - - - Inbound Endpoint 'merge-with-default-converters' - - <http:inbound-gateway/> and <http:inbound-channel-adapter/> now - have a merge-with-default-converters attribute to include the list of default - HttpMessageConverters after the custom message converters. - - - 'If-(Un)Modified-Since' HTTP Headers - previously, - 'If-Modified-Since' and 'If-Unmodified-Since' HTTP headers were incorrectly processed - within from/to HTTP headers mapping in the DefaultHttpHeaderMapper. - Now, in addition correcting that issue, DefaultHttpHeaderMapper provides - date parsing from formatted strings for any HTTP headers that accept date-time values. - - - Inbound Endpoint Expression Variables - - In addition to the existing #requestParams and #pathVariables, - the <http:inbound-gateway/> and <http:inbound-channel-adapter/> - now support additional useful variables: #matrixVariables, #requestAttributes, - #requestHeaders and #cookies. These variables are available in - both payload and header expressions. - - - Outbound Endpoint 'uri-variables-expression' - HTTP Outbound Endpoints - now support the uri-variables-expression attribute to specify - an Expression to evaluate a Map - for all URI variable placeholders within URL template. This allows selection of a different - map of expressions based on the outgoing message. - - - - - For more information see . - -
-
- Jackson Support (JSON) - - - - A new abstraction for JSON conversion has been introduced. Implementations for Jackson 1.x - and Jackson 2 are currently provided, with the version being determined by presence on - the classpath. Previously, only Jackson 1.x was supported. - - - The ObjectToJsonTransformer and JsonToObjectTransformer - now emit/consume headers containing type information. - - - - - For more information, see 'JSON Transformers' in . - -
-
- Chain Elements 'id' Attribute - - Previously, the id attribute for elements within a <chain> was - ignored and, in some cases, disallowed. Now, the id attribute is allowed - for all elements within a <chain>. The bean names of chain elements is a combination - of the surrounding chain's id and the id of the element - itself. For example: 'fooChain$child.fooTransformer.handler'. - For more information see . - -
-
- Aggregator 'empty-group-min-timeout' property - - The AbstractCorrelatingMessageHandler provides a new property - empty-group-min-timeout - to allow empty group expiry to run on a longer schedule than expiring partial groups. Empty groups will - not be removed from the MessageStore until they have not been modified - for at least this number of milliseconds. For more information see . - -
-
- Persistent File List Filters (file, (S)FTP) - - New FileListFilters that use a persistent MetadataStore are - now available. These can be used to prevent duplicate files after a system restart. See - , , and for more information. - -
-
- Scripting Support: Variables Changes - - A new variables attribute has been introduced for scripting components. - In addition, variable bindings are now allowed for inline scripts. - See and for more information. - -
-
- Direct Channel Load Balancing configuration - - Previously, when configuring LoadBalancingStrategy on the channel's 'dispatcher' sub-element, - the only available option was to use a pre-defined enumeration of values which did not allow one to set a custom implementation - of the LoadBalancingStrategy. You can now use load-balancer-ref to provide - a reference to a custom implementation of the LoadBalancingStrategy. - For more information see . - -
-
- PublishSubscribeChannel Behavior - - Previously, sending to a <publish-subscribe-channel/> that had - no subscribers would return a false result. If used in conjunction with - a MessagingTemplate, this would result in an exception being thrown. - Now, the PublishSubscribeChannel has a property - minSubscribers (default 0). If the message is sent to at least the minimum - number of subscribers, the send is deemed to be successful (even if zero). If an application - is expecting to get an exception under these conditions, set the minimum subscribers to at - least 1. - -
-
- FTP, SFTP and FTPS Changes - - The FTP, SFTP and FTPS endpoints no longer cache sessions by default - - - The deprecated cached-sessions attribute has been removed from all endpoints. - Previously, the embedded caching mechanism controlled by this attribute's value didn't - provide a way to limit the size of the cache, which could - grow indefinitely. The CachingConnectionFactory was introduced in - release 2.1 and it became the preferred (and is now the only) way to cache sessions. - - - The CachingConnectionFactory now provides a new method - resetCache(). This immediately closes idle sessions and causes in-use - sessions to be closed as and when they are returned to the cache. - - - The DefaultSftpSessionFactory (in conjunction with a - CachingSessionFactory) now supports multiplexing channels over - a single SSH connection (SFTP Only). - - - FTP, SFTP and FTPS Inbound Adapters - - - Previously, there was no way to override the default filter used to process files retrieved - from a remote server. The filter attribute determines which files are retrieved - but the FileReadingMessageSource uses an - AcceptOnceFileListFilter. This means that if a new copy of a file - is retrieved, with the same name as a previously copied file, no message was sent from the - adapter. - - - With this release, a new attribute local-filter allows you to override the - default filter, for example with an AcceptAllFileListFilter, or some - other custom filter. - - - For users that wish the behavior of the AcceptOnceFileListFilter - to be maintained across JVM executions, a custom filter that retains state, perhaps on - the file system, can now be configured. - - - Inbound Channel Adapters now support the preserve-timestamp attribute, which - sets the local file modified timestamp to the timestamp from the server (default false). - - - FTP, SFTP and FTPS Gateways - - - - - The gateways now support the mv command, enabling - the renaming of remote files. - - - The gateways now support recursive ls and - mget commands, enabling - the retrieval of a remote file tree. - - - The gateways now support put and - mput commands, enabling - sending file(s) to the remote server. - - - The local-filename-generator-expression attribute is now supported, - enabling the naming of local files during retrieval. By default, the same - name as the remote file is used. - - - The local-directory-expression attribute is now supported, - enabling the naming of local directories during retrieval based on the remote directory. - - - - - Remote File Template - - - A new higher-level abstraction (RemoteFileTemplate) is provided over the - Session implementations used by the FTP and SFTP modules. While it is - used internally by endpoints, this abstraction can also be used programmatically and, like all - Spring *Template implementations, reliably closes the underlying session while allowing - low level access to the session when needed. - - - For more information, see - and . - -
-
- 'requires-reply' Attribute for Outbound Gateways - - All Outbound Gateways (e.g. <jdbc:outbound-gateway/> or <jms:outbound-gateway/>) - are designed for 'request-reply' scenarios. A response is expected from the external service and - will be published to the reply-channel, or the replyChannel message header. - However, there are some cases where the external system might not always return a - result, e.g. a <jdbc:outbound-gateway/>, when a SELECT ends with an empty ResultSet - or, say, a Web Service is One-Way. An option is therefore needed to configure whether or not a - reply is required. - For this purpose, the requires-reply attribute has been introduced for Outbound Gateway components. - In most cases, the default value for requires-reply is true and, if there is not any result, - a ReplyRequiredException will be thrown. Changing the value to false - means that, if an external service doesn't return anything, the message-flow will end at that point, - similar to an Outbound Channel Adapter. - - - The WebService outbound gateway has an additional attribute ignore-empty-responses; this is used to - treat an empty String response as if no response was received. It is true by default but can be set to false to - allow the application to receive an empty String in the reply message payload. When the attribute is true an empty - string is treated as no response for the purposes of the requires-reply attribute. - requires-reply is false by default for the WebService outbound gateway. - - - Note, the requiresReply property was previously present in the AbstractReplyProducingMessageHandler - but set to false, and there wasn't any way to configure it on Outbound Gateways using the XML namespace. - - - Previously, a gateway receiving no reply would silently end the flow (with a DEBUG log message); with this change an - exception will now be thrown by default by most gateways. To revert to the previous behavior, - set requires-reply to false. - -
-
- AMQP Outbound Gateway Header Mapping - - Previously, the <int-amqp:outbound-gateway/> mapped headers before invoking the message - converter, and the converter could overwrite headers such as content-type. The - outbound adapter maps the headers after the conversion, which means headers like - content-type from the outbound Message (if present) are used. - - - Starting with this release, the gateway now maps the headers after the message conversion, - consistent with the adapter. If your application relies on the previous behavior (where the - converter's headers overrode the mapped headers), you either need to filter those headers - (before the message reaches the gateway) - or set them appropriately. The headers affected by the SimpleMessageConverter - are content-type and content-encoding. Custom message converters - may set other headers. - -
-
- Stored Procedure Components Improvements - - For more complex database-specific types, not supported by the standard - CallableStatement.getObject method, 2 new additional - attributes were introduced to the <sql-parameter-definition/> - element with OUT-direction: - - - type-name - return-type - - - - The row-mapper attribute of the Stored Procedure Inbound Channel Adapter - <returning-resultset/> sub-element - now supports a reference to a RowMapper bean - definition. Previously, it contained just a class name (which is still supported). - - - For more information see . - - -
-
- Web Service Outbound URI Configuration - - Web Service Outbound Gateway 'uri' attribute now supports <uri-variable/> substitution for all - URI-schemes supported by Spring Web Services. For more information see . - -
-
- Redis Adapter Changes - - - - The Redis Inbound Channel Adapter can now use a null value for serializer - property, with the raw data being the message payload. - - - The Redis Outbound Channel Adapter now has the topic-expression property to determine - the Redis topic against the Message at runtime. - - - The Redis Inbound Channel Adapter, in addition to the existing topics attribute, - now has the topic-patterns attribute. - - - - - For more information, see . - -
-
- Advising Filters - - Previously, when a <filter/> had a <request-handler-advice-chain/>, the discard - action was all performed within the scope of the advice chain (including any downstream flow - on the discard-channel). The filter element now has an attribute - discard-within-advice (default true), to allow the discard action to - be performed after the advice chain completes. See . - -
-
- Advising Endpoints using Annotations - - Request Handler Advice Chains can now be configured using annotations. See - . - -
-
- ObjectToStringTransformer Improvements - - This transformer now correctly transforms byte[] and char[] - payloads to String. For more information see . - -
-
- JPA Support Changes - - Payloads to persist or - merge can now be of type - java.lang.Iterable. - - - In that case, each object returned by the - Iterable is treated as - an entity and persisted or merged using the underlying - EntityManager. - NULL values returned by the iterator are ignored. - - - The JPA adapters now have additional attributes to optionally 'flush' and 'clear' - entities from the associated persistence context after performing persistence operations. - - - Retrieving gateways had no mechanism to specify the first record to be retrieved which - is a common use case. The retrieving gateways now support specifying this parameter - using a first-result and first-result-expression attributes - to the gateway definition. . - - - The JPA retrieving gateway and inbound adapter now have an attribute to specify the maximum - number of results in a result set as an expression. In addition, the - max-results attribute has been introduced to replace - max-number-of-results, which has been deprecated. - max-results and max-results-expression - are used to provide the maximum number of results, - or an expression to compute the maximum number of results, respectively, in the - result set. - - For more information see . -
-
- Delayer: delay expression - - Previously, the <delayer> provided a delay-header-name attribute - to determine the delay value at runtime. In complex cases it was necessary - to precede the <delayer> with a <header-enricher>. - Spring Integration 3.0 introduced the expression attribute and expression - sub-element for dynamic delay determination. The delay-header-name attribute is now deprecated - because the header evaluation can be specified in the expression. In addition, - the ignore-expression-failures was introduced to control the behavior when an - expression evaluation fails. - For more information see . - -
-
- JDBC Message Store Improvements - - Spring Integration 3.0 adds a new set of DDL - scripts for MySQL version 5.6.4 and higher. - Now MySQL supports fractional - seconds and is thus improving the FIFO ordering when - polling from a MySQL-based Message Store. For more information, - please see . - -
-
- IMAP Idle Connection Exceptions - - Previously, if an IMAP idle connection failed, it was logged but there was no mechanism to - inform an application. Such exceptions now generate ApplicationEvents. - Applications can obtain these events using an <int-event:inbound-channel-adapter> - or any ApplicationListener configured to receive an - ImapIdleExceptionEvent or one of its super classes. - -
-
- Message Headers and TCP - - The TCP connection factories now enable the configuration of a flexible mechanism to - transfer selected headers (as well as the payload) over TCP. A new - TcpMessageMapper - enables the selection of the headers, and an appropriate (de)serializer needs to be - configured to write the resulting Map to the - TCP stream. A MapJsonSerializer is provided as a convenient - mechanism to transfer headers and payload over TCP. - For more information see . - -
-
- JMS Message Driven Channel Adapter - - Previously, when configuring a <message-driven-channel-adapter/>, if you wished to - use a specific TaskExecutor, it was necessary to declare a container - bean and provide it to the adapter using the container attribute. The - task-executor is now provided, allowing it to be set directly on the adapter. This is - in addition to several other container attributes that were already available. - -
-
- RMI Inbound Gateway - - The RMI Inbound Gateway now supports an error-channel attribute. See - . - -
-
- XsltPayloadTransformer - - You can now specify the transformer factory class name using the - transformer-factory-class attribute. See - -
+ + Core messaging abstractions (Message, + MessageChannel etc) have moved to the Spring + Framework spring-messaging module. Users who reference these + classes directly in their code will need to make changes as described in + the first section of the + Migration Guide. +