INT-4390: Fix tangles
JIRA: https://jira.spring.io/browse/INT-4390 Phase I: flow context/registration cycle - extract interfaces - rename implementations to `Standard...` Phase II - dsl<->dsl.channel tangles Move the channel specs to dsl. Fix missing refactorings (Not related to DSL) - rename core `event` package to `events` - avoid collision with event module package - fix tangle caused by `MessageGroupExpiredEvent`. Phase III - dsl<->config.dsl - move classes from config.dsl to dsl (Not related to DSL) - fix many tangles caused by graph being a sub-package of support.management - make `graph` a top-level package (Not related to DSL) - move `IntegrationManagementConfigurer` from `management` to `config` - tangle between core and management * Polishing Copyrights, diamonds, some JavaDocs and What's New
This commit is contained in:
committed by
Artem Bilan
parent
7f25cba262
commit
82f252dd00
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.integration.amqp.channel.AbstractAmqpChannel;
|
||||
import org.springframework.integration.amqp.config.AmqpChannelFactoryBean;
|
||||
import org.springframework.integration.amqp.support.AmqpHeaderMapper;
|
||||
import org.springframework.integration.dsl.channel.MessageChannelSpec;
|
||||
import org.springframework.integration.dsl.MessageChannelSpec;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -36,6 +36,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.0
|
||||
*/
|
||||
public class AmqpPollableMessageChannelSpec<S extends AmqpPollableMessageChannelSpec<S>>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2018 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.
|
||||
@@ -18,13 +18,14 @@ package org.springframework.integration.aggregator;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
import org.springframework.integration.support.context.NamedComponent;
|
||||
|
||||
/**
|
||||
* Event representing the expiration of a message group.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.0.1
|
||||
*/
|
||||
public class MessageGroupExpiredEvent extends IntegrationEvent {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2015 the original author or authors.
|
||||
* Copyright 2014-2018 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.
|
||||
@@ -24,7 +24,6 @@ import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.integration.support.management.IntegrationManagement;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
|
||||
/**
|
||||
* Enables default configuring of management in Spring Integration components in an existing application.
|
||||
@@ -33,6 +32,7 @@ import org.springframework.integration.support.management.IntegrationManagementC
|
||||
* bean is defined under the name {@code integrationManagementConfigurer}.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-2018 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.
|
||||
@@ -30,7 +30,6 @@ import org.springframework.context.annotation.Role;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -42,6 +41,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
@Configuration
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management;
|
||||
package org.springframework.integration.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -31,7 +31,18 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.support.management.AbstractMessageChannelMetrics;
|
||||
import org.springframework.integration.support.management.AbstractMessageHandlerMetrics;
|
||||
import org.springframework.integration.support.management.ConfigurableMetricsAware;
|
||||
import org.springframework.integration.support.management.DefaultMetricsFactory;
|
||||
import org.springframework.integration.support.management.IntegrationManagement;
|
||||
import org.springframework.integration.support.management.IntegrationManagement.ManagementOverrides;
|
||||
import org.springframework.integration.support.management.MessageChannelMetrics;
|
||||
import org.springframework.integration.support.management.MessageHandlerMetrics;
|
||||
import org.springframework.integration.support.management.MessageSourceMetrics;
|
||||
import org.springframework.integration.support.management.MessageSourceMetricsConfigurer;
|
||||
import org.springframework.integration.support.management.MetricsFactory;
|
||||
import org.springframework.integration.support.management.PollableChannelManagement;
|
||||
import org.springframework.integration.support.management.metrics.MetricsCaptor;
|
||||
import org.springframework.integration.support.management.micrometer.MicrometerMetricsCaptor;
|
||||
import org.springframework.integration.support.utils.PatternMatchUtils;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Provides config classes of the Spring Integration Java DSL.
|
||||
*/
|
||||
package org.springframework.integration.config.dsl;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
* Copyright 2015-2018 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.
|
||||
@@ -23,7 +23,7 @@ import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.config.IntegrationManagementConfigurer;
|
||||
|
||||
/**
|
||||
* Parser for the <management/> element.
|
||||
@@ -37,6 +37,7 @@ public class IntegrationManagementParser extends AbstractBeanDefinitionParser {
|
||||
@Override
|
||||
protected String resolveId(Element element, AbstractBeanDefinition definition, ParserContext parserContext)
|
||||
throws BeanDefinitionStoreException {
|
||||
|
||||
return IntegrationManagementConfigurer.MANAGEMENT_CONFIGURER_NAME;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -19,14 +19,6 @@ package org.springframework.integration.dsl;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.springframework.integration.dsl.channel.DirectChannelSpec;
|
||||
import org.springframework.integration.dsl.channel.ExecutorChannelSpec;
|
||||
import org.springframework.integration.dsl.channel.FluxMessageChannelSpec;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.channel.PriorityChannelSpec;
|
||||
import org.springframework.integration.dsl.channel.PublishSubscribeChannelSpec;
|
||||
import org.springframework.integration.dsl.channel.QueueChannelSpec;
|
||||
import org.springframework.integration.dsl.channel.RendezvousChannelSpec;
|
||||
import org.springframework.integration.store.ChannelMessageStore;
|
||||
import org.springframework.integration.store.PriorityCapableChannelMessageStore;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import org.springframework.integration.channel.FluxMessageChannel;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,7 +21,6 @@ import java.util.function.Consumer;
|
||||
|
||||
import org.springframework.context.SmartLifecycle;
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.dsl.channel.MessageChannelSpec;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.integration.gateway.MessagingGatewaySupport;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config.dsl;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -41,14 +41,6 @@ import org.springframework.integration.config.ConsumerEndpointFactoryBean;
|
||||
import org.springframework.integration.config.IntegrationConfigUtils;
|
||||
import org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean;
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.dsl.ComponentsRegistration;
|
||||
import org.springframework.integration.dsl.ConsumerEndpointSpec;
|
||||
import org.springframework.integration.dsl.IntegrationComponentSpec;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlowBuilder;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.SourcePollingChannelAdapterSpec;
|
||||
import org.springframework.integration.dsl.StandardIntegrationFlow;
|
||||
import org.springframework.integration.dsl.support.MessageChannelReference;
|
||||
import org.springframework.integration.gateway.AnnotationGatewayProxyFactoryBean;
|
||||
import org.springframework.integration.support.context.NamedComponent;
|
||||
@@ -46,8 +46,6 @@ import org.springframework.integration.context.IntegrationContextUtils;
|
||||
import org.springframework.integration.core.GenericSelector;
|
||||
import org.springframework.integration.core.MessageProducer;
|
||||
import org.springframework.integration.core.MessageSelector;
|
||||
import org.springframework.integration.dsl.channel.MessageChannelSpec;
|
||||
import org.springframework.integration.dsl.channel.WireTapSpec;
|
||||
import org.springframework.integration.dsl.support.FixedSubscriberChannelPrototype;
|
||||
import org.springframework.integration.dsl.support.MessageChannelReference;
|
||||
import org.springframework.integration.expression.ControlBusMethodFilter;
|
||||
@@ -111,7 +109,7 @@ import reactor.util.function.Tuple2;
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @see org.springframework.integration.config.dsl.IntegrationFlowBeanPostProcessor
|
||||
* @see org.springframework.integration.dsl.IntegrationFlowBeanPostProcessor
|
||||
*/
|
||||
public abstract class IntegrationFlowDefinition<B extends IntegrationFlowDefinition<B>> {
|
||||
|
||||
@@ -190,7 +188,7 @@ public abstract class IntegrationFlowDefinition<B extends IntegrationFlowDefinit
|
||||
* fluent API.
|
||||
* @param messageChannelSpec the {@link MessageChannelSpec} to use.
|
||||
* @return the current {@link IntegrationFlowDefinition}.
|
||||
* @see org.springframework.integration.dsl.channel.MessageChannels
|
||||
* @see org.springframework.integration.dsl.MessageChannels
|
||||
*/
|
||||
public B channel(MessageChannelSpec<?, ?> messageChannelSpec) {
|
||||
Assert.notNull(messageChannelSpec, "'messageChannelSpec' must not be null");
|
||||
@@ -201,7 +199,7 @@ public abstract class IntegrationFlowDefinition<B extends IntegrationFlowDefinit
|
||||
* Populate the provided {@link MessageChannel} instance
|
||||
* at the current {@link IntegrationFlow} chain position.
|
||||
* The {@code messageChannel} can be an existing bean, or fresh instance, in which case
|
||||
* the {@link org.springframework.integration.config.dsl.IntegrationFlowBeanPostProcessor}
|
||||
* the {@link org.springframework.integration.dsl.IntegrationFlowBeanPostProcessor}
|
||||
* will populate it as a bean with a generated name.
|
||||
* @param messageChannel the {@link MessageChannel} to populate.
|
||||
* @return the current {@link IntegrationFlowDefinition}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -24,7 +24,6 @@ import org.reactivestreams.Publisher;
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.channel.FluxMessageChannel;
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.dsl.channel.MessageChannelSpec;
|
||||
import org.springframework.integration.dsl.support.FixedSubscriberChannelPrototype;
|
||||
import org.springframework.integration.dsl.support.MessageChannelReference;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
@@ -46,7 +45,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @see org.springframework.integration.config.dsl.IntegrationFlowBeanPostProcessor
|
||||
* @see org.springframework.integration.dsl.IntegrationFlowBeanPostProcessor
|
||||
*/
|
||||
public final class IntegrationFlows {
|
||||
|
||||
@@ -90,7 +89,7 @@ public final class IntegrationFlows {
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}.
|
||||
* @param messageChannelSpec the MessageChannelSpec to populate {@link MessageChannel} instance.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see org.springframework.integration.dsl.channel.MessageChannels
|
||||
* @see org.springframework.integration.dsl.MessageChannels
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageChannelSpec<?, ?> messageChannelSpec) {
|
||||
Assert.notNull(messageChannelSpec, "'messageChannelSpec' must not be null");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import org.springframework.integration.channel.AbstractMessageChannel;
|
||||
import org.springframework.integration.dispatcher.LoadBalancingStrategy;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -25,8 +25,6 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.integration.channel.AbstractMessageChannel;
|
||||
import org.springframework.integration.channel.interceptor.WireTap;
|
||||
import org.springframework.integration.dsl.ComponentsRegistration;
|
||||
import org.springframework.integration.dsl.IntegrationComponentSpec;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.converter.MessageConverter;
|
||||
import org.springframework.messaging.support.ChannelInterceptor;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.Executor;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -20,8 +20,6 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.springframework.integration.dsl.channel.PublishSubscribeChannelSpec;
|
||||
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import org.springframework.integration.channel.RendezvousChannel;
|
||||
|
||||
@@ -60,7 +60,7 @@ import org.springframework.context.SmartLifecycle;
|
||||
* @since 5.0
|
||||
*
|
||||
* @see IntegrationFlows
|
||||
* @see org.springframework.integration.config.dsl.IntegrationFlowBeanPostProcessor
|
||||
* @see org.springframework.integration.dsl.IntegrationFlowBeanPostProcessor
|
||||
* @see org.springframework.integration.dsl.context.IntegrationFlowContext
|
||||
*/
|
||||
public class StandardIntegrationFlow implements IntegrationFlow, SmartLifecycle {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl.channel;
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
@@ -22,8 +22,6 @@ import java.util.Map;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.integration.channel.interceptor.WireTap;
|
||||
import org.springframework.integration.core.MessageSelector;
|
||||
import org.springframework.integration.dsl.ComponentsRegistration;
|
||||
import org.springframework.integration.dsl.IntegrationComponentSpec;
|
||||
import org.springframework.integration.filter.ExpressionEvaluatingSelector;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Contains MessageChannel Builders DSL.
|
||||
*/
|
||||
package org.springframework.integration.dsl.channel;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.config.dsl;
|
||||
package org.springframework.integration.dsl.context;
|
||||
|
||||
import java.beans.Introspector;
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
import org.springframework.integration.config.IntegrationConfigurationInitializer;
|
||||
import org.springframework.integration.dsl.IntegrationComponentSpec;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
import org.springframework.integration.dsl.IntegrationFlowBeanPostProcessor;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
|
||||
* {@link IntegrationComponentSpec#get()}.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
* @since 5.0
|
||||
*
|
||||
* @see org.springframework.integration.config.IntegrationConfigurationBeanFactoryPostProcessor
|
||||
@@ -58,7 +59,7 @@ public class DslIntegrationConfigurationInitializer implements IntegrationConfig
|
||||
registry.registerBeanDefinition(INTEGRATION_FLOW_BPP_BEAN_NAME,
|
||||
new RootBeanDefinition(IntegrationFlowBeanPostProcessor.class));
|
||||
registry.registerBeanDefinition(INTEGRATION_FLOW_CONTEXT_BEAN_NAME,
|
||||
new RootBeanDefinition(IntegrationFlowContext.class));
|
||||
new RootBeanDefinition(StandardIntegrationFlowContext.class));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
* Copyright 2018 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.
|
||||
@@ -16,24 +16,12 @@
|
||||
|
||||
package org.springframework.integration.dsl.context;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.BeanFactoryUtils;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.integration.core.MessagingTemplate;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.support.context.NamedComponent;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* A public API for dynamic (manual) registration of {@link IntegrationFlow}s,
|
||||
@@ -58,28 +46,13 @@ import org.springframework.util.Assert;
|
||||
* It can be used for access to the target {@link IntegrationFlow} or for manipulation with its lifecycle.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @see IntegrationFlowRegistration
|
||||
*/
|
||||
public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
|
||||
private final Map<String, IntegrationFlowRegistration> registry = new HashMap<>();
|
||||
|
||||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
private IntegrationFlowContext() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
Assert.isInstanceOf(ConfigurableListableBeanFactory.class, beanFactory,
|
||||
"To use Spring Integration Java DSL the 'beanFactory' has to be an instance of " +
|
||||
"'ConfigurableListableBeanFactory'. " +
|
||||
"Consider using 'GenericApplicationContext' implementation.");
|
||||
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
|
||||
}
|
||||
public interface IntegrationFlowContext {
|
||||
|
||||
/**
|
||||
* Associate provided {@link IntegrationFlow} with an {@link IntegrationFlowRegistrationBuilder}
|
||||
@@ -87,52 +60,7 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* @param integrationFlow the {@link IntegrationFlow} to register
|
||||
* @return the IntegrationFlowRegistrationBuilder associated with the provided {@link IntegrationFlow}
|
||||
*/
|
||||
public IntegrationFlowRegistrationBuilder registration(IntegrationFlow integrationFlow) {
|
||||
return new IntegrationFlowRegistrationBuilder(integrationFlow);
|
||||
}
|
||||
|
||||
private void register(IntegrationFlowRegistrationBuilder builder) {
|
||||
IntegrationFlow integrationFlow = builder.integrationFlowRegistration.getIntegrationFlow();
|
||||
String flowId = builder.integrationFlowRegistration.getId();
|
||||
if (flowId == null) {
|
||||
flowId = generateBeanName(integrationFlow, null);
|
||||
builder.id(flowId);
|
||||
}
|
||||
else if (this.registry.containsKey(flowId)) {
|
||||
throw new IllegalArgumentException("An IntegrationFlow '" + this.registry.get(flowId) +
|
||||
"' with flowId '" + flowId + "' is already registered.\n" +
|
||||
"An existing IntegrationFlowRegistration must be destroyed before overriding.");
|
||||
}
|
||||
IntegrationFlow theFlow = (IntegrationFlow) registerBean(integrationFlow, flowId, null);
|
||||
builder.integrationFlowRegistration.setIntegrationFlow(theFlow);
|
||||
|
||||
final String theFlowId = flowId;
|
||||
builder.additionalBeans.forEach((key, value) -> registerBean(key, value, theFlowId));
|
||||
|
||||
if (builder.autoStartup) {
|
||||
builder.integrationFlowRegistration.start();
|
||||
}
|
||||
this.registry.put(flowId, builder.integrationFlowRegistration);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Object registerBean(Object bean, String beanName, String parentName) {
|
||||
if (beanName == null) {
|
||||
beanName = generateBeanName(bean, parentName);
|
||||
}
|
||||
|
||||
BeanDefinition beanDefinition =
|
||||
BeanDefinitionBuilder.genericBeanDefinition((Class<Object>) bean.getClass(), () -> bean)
|
||||
.getRawBeanDefinition();
|
||||
|
||||
((BeanDefinitionRegistry) this.beanFactory).registerBeanDefinition(beanName, beanDefinition);
|
||||
|
||||
if (parentName != null) {
|
||||
this.beanFactory.registerDependentBean(parentName, beanName);
|
||||
}
|
||||
|
||||
return this.beanFactory.getBean(beanName);
|
||||
}
|
||||
IntegrationFlowRegistrationBuilder registration(IntegrationFlow integrationFlow);
|
||||
|
||||
/**
|
||||
* Obtain an {@link IntegrationFlowRegistration} for the {@link IntegrationFlow}
|
||||
@@ -140,30 +68,14 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* @param flowId the bean name to obtain
|
||||
* @return the IntegrationFlowRegistration for provided {@code id} or {@code null}
|
||||
*/
|
||||
public IntegrationFlowRegistration getRegistrationById(String flowId) {
|
||||
return this.registry.get(flowId);
|
||||
}
|
||||
IntegrationFlowRegistration getRegistrationById(String flowId);
|
||||
|
||||
/**
|
||||
* Destroy an {@link IntegrationFlow} bean (as well as all its dependant beans)
|
||||
* for provided {@code flowId} and clean up all the local cache for it.
|
||||
* @param flowId the bean name to destroy from
|
||||
*/
|
||||
public synchronized void remove(String flowId) {
|
||||
if (this.registry.containsKey(flowId)) {
|
||||
IntegrationFlowRegistration flowRegistration = this.registry.remove(flowId);
|
||||
flowRegistration.stop();
|
||||
|
||||
Arrays.stream(this.beanFactory.getDependentBeans(flowId))
|
||||
.forEach(((BeanDefinitionRegistry) this.beanFactory)::removeBeanDefinition);
|
||||
|
||||
((BeanDefinitionRegistry) this.beanFactory).removeBeanDefinition(flowId);
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("Only manually registered IntegrationFlows can be removed. "
|
||||
+ "But [" + flowId + "] ins't one of them.");
|
||||
}
|
||||
}
|
||||
void remove(String flowId);
|
||||
|
||||
/**
|
||||
* Obtain a {@link MessagingTemplate} with its default destination set to the input channel
|
||||
@@ -174,51 +86,91 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* @param flowId the bean name to obtain the input channel from
|
||||
* @return the {@link MessagingTemplate} instance
|
||||
*/
|
||||
public MessagingTemplate messagingTemplateFor(String flowId) {
|
||||
return this.registry.get(flowId)
|
||||
.getMessagingTemplate();
|
||||
}
|
||||
MessagingTemplate messagingTemplateFor(String flowId);
|
||||
|
||||
/**
|
||||
* Provide the state of the mapping of integration flow names to their
|
||||
* {@link IntegrationFlowRegistration} instances.
|
||||
* @return the registry of flow ids and their registration.
|
||||
*/
|
||||
public Map<String, IntegrationFlowRegistration> getRegistry() {
|
||||
return Collections.unmodifiableMap(this.registry);
|
||||
}
|
||||
Map<String, IntegrationFlowRegistration> getRegistry();
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @since 5.1
|
||||
*
|
||||
*/
|
||||
interface IntegrationFlowRegistration extends BeanFactoryAware {
|
||||
|
||||
/**
|
||||
* Return the flow id.
|
||||
* @return the id.
|
||||
*/
|
||||
String getId();
|
||||
|
||||
/**
|
||||
* Set the flow id.
|
||||
* @param id the id.
|
||||
*/
|
||||
void setId(String id);
|
||||
|
||||
/**
|
||||
* Return the flow.
|
||||
* @return the flow.
|
||||
*/
|
||||
IntegrationFlow getIntegrationFlow();
|
||||
|
||||
/**
|
||||
* Set the integration flow.
|
||||
* @param integrationFlow the flow.
|
||||
*/
|
||||
void setIntegrationFlow(IntegrationFlow integrationFlow);
|
||||
|
||||
/**
|
||||
* Return the flow input channel.
|
||||
* @return the channel.
|
||||
*/
|
||||
MessageChannel getInputChannel();
|
||||
|
||||
/**
|
||||
* Set the flow context.
|
||||
* @param integrationFlowContext the context.
|
||||
*/
|
||||
void setIntegrationFlowContext(IntegrationFlowContext integrationFlowContext);
|
||||
|
||||
/**
|
||||
* Obtain a {@link MessagingTemplate} with its default destination set to the input channel
|
||||
* of the {@link IntegrationFlow}.
|
||||
* <p> Any {@link IntegrationFlow} bean (not only manually registered) can be used for this method.
|
||||
* <p> If {@link IntegrationFlow} doesn't start with the {@link MessageChannel}, the
|
||||
* {@link IllegalStateException} is thrown.
|
||||
* @return the {@link MessagingTemplate} instance
|
||||
*/
|
||||
MessagingTemplate getMessagingTemplate();
|
||||
|
||||
/**
|
||||
* Start the registration.
|
||||
*/
|
||||
void start();
|
||||
|
||||
/**
|
||||
* Stop the registration.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* Destroy the {@link IntegrationFlow} bean (as well as all its dependent beans)
|
||||
* and clean up all the local cache for it.
|
||||
*/
|
||||
void destroy();
|
||||
|
||||
private String generateBeanName(Object instance, String parentName) {
|
||||
if (instance instanceof NamedComponent && ((NamedComponent) instance).getComponentName() != null) {
|
||||
return ((NamedComponent) instance).getComponentName();
|
||||
}
|
||||
String generatedBeanName = (parentName != null ? parentName : "") + instance.getClass().getName();
|
||||
String id = generatedBeanName;
|
||||
int counter = -1;
|
||||
while (counter == -1 || this.beanFactory.containsBean(id)) {
|
||||
counter++;
|
||||
id = generatedBeanName + BeanFactoryUtils.GENERATED_BEAN_NAME_SEPARATOR + counter;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Builder pattern implementation for the options to register {@link IntegrationFlow}
|
||||
* in the application context.
|
||||
*/
|
||||
public final class IntegrationFlowRegistrationBuilder {
|
||||
|
||||
private Map<Object, String> additionalBeans = new HashMap<>();
|
||||
|
||||
private final IntegrationFlowRegistration integrationFlowRegistration;
|
||||
|
||||
private boolean autoStartup = true;
|
||||
|
||||
IntegrationFlowRegistrationBuilder(IntegrationFlow integrationFlow) {
|
||||
this.integrationFlowRegistration = new IntegrationFlowRegistration(integrationFlow);
|
||||
this.integrationFlowRegistration.setBeanFactory(IntegrationFlowContext.this.beanFactory);
|
||||
this.integrationFlowRegistration.setIntegrationFlowContext(IntegrationFlowContext.this);
|
||||
}
|
||||
interface IntegrationFlowRegistrationBuilder {
|
||||
|
||||
/**
|
||||
* Specify an {@code id} for the {@link IntegrationFlow} to register.
|
||||
@@ -228,10 +180,7 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* @param id the id for the {@link IntegrationFlow} to register
|
||||
* @return the current builder instance
|
||||
*/
|
||||
public IntegrationFlowRegistrationBuilder id(String id) {
|
||||
this.integrationFlowRegistration.setId(id);
|
||||
return this;
|
||||
}
|
||||
IntegrationFlowRegistrationBuilder id(String id);
|
||||
|
||||
/**
|
||||
* The {@code boolean} flag to indication if an {@link IntegrationFlow} must be started
|
||||
@@ -239,10 +188,7 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* @param autoStartup start or not the {@link IntegrationFlow} automatically after registration.
|
||||
* @return the current builder instance
|
||||
*/
|
||||
public IntegrationFlowRegistrationBuilder autoStartup(boolean autoStartup) {
|
||||
this.autoStartup = autoStartup;
|
||||
return this;
|
||||
}
|
||||
IntegrationFlowRegistrationBuilder autoStartup(boolean autoStartup);
|
||||
|
||||
/**
|
||||
* Add an object which will be registered as an {@link IntegrationFlow} dependant bean in the
|
||||
@@ -251,9 +197,7 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* @param bean an additional arbitrary bean to register into the application context.
|
||||
* @return the current builder instance
|
||||
*/
|
||||
public IntegrationFlowRegistrationBuilder addBean(Object bean) {
|
||||
return addBean(null, bean);
|
||||
}
|
||||
IntegrationFlowRegistrationBuilder addBean(Object bean);
|
||||
|
||||
/**
|
||||
* Add an object which will be registered as an {@link IntegrationFlow} dependant bean in the
|
||||
@@ -263,10 +207,7 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* @param bean an additional arbitrary bean to register into the application context.
|
||||
* @return the current builder instance
|
||||
*/
|
||||
public IntegrationFlowRegistrationBuilder addBean(String name, Object bean) {
|
||||
this.additionalBeans.put(bean, name);
|
||||
return this;
|
||||
}
|
||||
IntegrationFlowRegistrationBuilder addBean(String name, Object bean);
|
||||
|
||||
/**
|
||||
* Register an {@link IntegrationFlow} and all the dependant and support components
|
||||
@@ -274,10 +215,7 @@ public final class IntegrationFlowContext implements BeanFactoryAware {
|
||||
* control object.
|
||||
* @return the {@link IntegrationFlowRegistration} instance.
|
||||
*/
|
||||
public IntegrationFlowRegistration register() {
|
||||
IntegrationFlowContext.this.register(this);
|
||||
return this.integrationFlowRegistration;
|
||||
}
|
||||
IntegrationFlowRegistration register();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
* Copyright 2016-2018 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.dsl.context;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.BeanFactoryUtils;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.integration.core.MessagingTemplate;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.support.context.NamedComponent;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Standard implementation of {@link IntegrationFlowContext}.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.1
|
||||
*
|
||||
*/
|
||||
public final class StandardIntegrationFlowContext implements IntegrationFlowContext, BeanFactoryAware {
|
||||
|
||||
private final Map<String, IntegrationFlowRegistration> registry = new HashMap<>();
|
||||
|
||||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
private StandardIntegrationFlowContext() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
Assert.isInstanceOf(ConfigurableListableBeanFactory.class, beanFactory,
|
||||
"To use Spring Integration Java DSL the 'beanFactory' has to be an instance of " +
|
||||
"'ConfigurableListableBeanFactory'. " +
|
||||
"Consider using 'GenericApplicationContext' implementation.");
|
||||
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Associate provided {@link IntegrationFlow} with an {@link StandardIntegrationFlowRegistrationBuilder}
|
||||
* for additional options and farther registration in the application context.
|
||||
* @param integrationFlow the {@link IntegrationFlow} to register
|
||||
* @return the IntegrationFlowRegistrationBuilder associated with the provided {@link IntegrationFlow}
|
||||
*/
|
||||
@Override
|
||||
public StandardIntegrationFlowRegistrationBuilder registration(IntegrationFlow integrationFlow) {
|
||||
return new StandardIntegrationFlowRegistrationBuilder(integrationFlow);
|
||||
}
|
||||
|
||||
private void register(StandardIntegrationFlowRegistrationBuilder builder) {
|
||||
IntegrationFlow integrationFlow = builder.integrationFlowRegistration.getIntegrationFlow();
|
||||
String flowId = builder.integrationFlowRegistration.getId();
|
||||
if (flowId == null) {
|
||||
flowId = generateBeanName(integrationFlow, null);
|
||||
builder.id(flowId);
|
||||
}
|
||||
else if (this.registry.containsKey(flowId)) {
|
||||
throw new IllegalArgumentException("An IntegrationFlow '" + this.registry.get(flowId) +
|
||||
"' with flowId '" + flowId + "' is already registered.\n" +
|
||||
"An existing IntegrationFlowRegistration must be destroyed before overriding.");
|
||||
}
|
||||
IntegrationFlow theFlow = (IntegrationFlow) registerBean(integrationFlow, flowId, null);
|
||||
builder.integrationFlowRegistration.setIntegrationFlow(theFlow);
|
||||
|
||||
final String theFlowId = flowId;
|
||||
builder.additionalBeans.forEach((key, value) -> registerBean(key, value, theFlowId));
|
||||
|
||||
if (builder.autoStartup) {
|
||||
builder.integrationFlowRegistration.start();
|
||||
}
|
||||
this.registry.put(flowId, builder.integrationFlowRegistration);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Object registerBean(Object bean, String beanName, String parentName) {
|
||||
if (beanName == null) {
|
||||
beanName = generateBeanName(bean, parentName);
|
||||
}
|
||||
|
||||
BeanDefinition beanDefinition =
|
||||
BeanDefinitionBuilder.genericBeanDefinition((Class<Object>) bean.getClass(), () -> bean)
|
||||
.getRawBeanDefinition();
|
||||
|
||||
((BeanDefinitionRegistry) this.beanFactory).registerBeanDefinition(beanName, beanDefinition);
|
||||
|
||||
if (parentName != null) {
|
||||
this.beanFactory.registerDependentBean(parentName, beanName);
|
||||
}
|
||||
|
||||
return this.beanFactory.getBean(beanName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain an {@link IntegrationFlowRegistration} for the {@link IntegrationFlow}
|
||||
* associated with the provided {@code flowId}.
|
||||
* @param flowId the bean name to obtain
|
||||
* @return the IntegrationFlowRegistration for provided {@code id} or {@code null}
|
||||
*/
|
||||
@Override
|
||||
public IntegrationFlowRegistration getRegistrationById(String flowId) {
|
||||
return this.registry.get(flowId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy an {@link IntegrationFlow} bean (as well as all its dependant beans)
|
||||
* for provided {@code flowId} and clean up all the local cache for it.
|
||||
* @param flowId the bean name to destroy from
|
||||
*/
|
||||
@Override
|
||||
public synchronized void remove(String flowId) {
|
||||
if (this.registry.containsKey(flowId)) {
|
||||
IntegrationFlowRegistration flowRegistration = this.registry.remove(flowId);
|
||||
flowRegistration.stop();
|
||||
|
||||
Arrays.stream(this.beanFactory.getDependentBeans(flowId))
|
||||
.forEach(((BeanDefinitionRegistry) this.beanFactory)::removeBeanDefinition);
|
||||
|
||||
((BeanDefinitionRegistry) this.beanFactory).removeBeanDefinition(flowId);
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("Only manually registered IntegrationFlows can be removed. "
|
||||
+ "But [" + flowId + "] ins't one of them.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a {@link MessagingTemplate} with its default destination set to the input channel
|
||||
* of the {@link IntegrationFlow} for provided {@code flowId}.
|
||||
* <p> Any {@link IntegrationFlow} bean (not only manually registered) can be used for this method.
|
||||
* <p> If {@link IntegrationFlow} doesn't start with the {@link MessageChannel}, the
|
||||
* {@link IllegalStateException} is thrown.
|
||||
* @param flowId the bean name to obtain the input channel from
|
||||
* @return the {@link MessagingTemplate} instance
|
||||
*/
|
||||
@Override
|
||||
public MessagingTemplate messagingTemplateFor(String flowId) {
|
||||
return this.registry.get(flowId)
|
||||
.getMessagingTemplate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the state of the mapping of integration flow names to their
|
||||
* {@link IntegrationFlowRegistration} instances.
|
||||
* @return the registry of flow ids and their registration.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, IntegrationFlowRegistration> getRegistry() {
|
||||
return Collections.unmodifiableMap(this.registry);
|
||||
}
|
||||
|
||||
private String generateBeanName(Object instance, String parentName) {
|
||||
if (instance instanceof NamedComponent && ((NamedComponent) instance).getComponentName() != null) {
|
||||
return ((NamedComponent) instance).getComponentName();
|
||||
}
|
||||
String generatedBeanName = (parentName != null ? parentName : "") + instance.getClass().getName();
|
||||
String id = generatedBeanName;
|
||||
int counter = -1;
|
||||
while (counter == -1 || this.beanFactory.containsBean(id)) {
|
||||
counter++;
|
||||
id = generatedBeanName + BeanFactoryUtils.GENERATED_BEAN_NAME_SEPARATOR + counter;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Builder pattern implementation for the options to register {@link IntegrationFlow}
|
||||
* in the application context.
|
||||
*/
|
||||
public final class StandardIntegrationFlowRegistrationBuilder implements IntegrationFlowRegistrationBuilder {
|
||||
|
||||
private final Map<Object, String> additionalBeans = new HashMap<>();
|
||||
|
||||
private final IntegrationFlowRegistration integrationFlowRegistration;
|
||||
|
||||
private boolean autoStartup = true;
|
||||
|
||||
StandardIntegrationFlowRegistrationBuilder(IntegrationFlow integrationFlow) {
|
||||
this.integrationFlowRegistration = new StandardIntegrationFlowRegistration(integrationFlow);
|
||||
this.integrationFlowRegistration.setBeanFactory(StandardIntegrationFlowContext.this.beanFactory);
|
||||
this.integrationFlowRegistration.setIntegrationFlowContext(StandardIntegrationFlowContext.this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify an {@code id} for the {@link IntegrationFlow} to register.
|
||||
* Must be unique per context.
|
||||
* The registration with this {@code id} must be destroyed before reusing for
|
||||
* a new {@link IntegrationFlow} instance.
|
||||
* @param id the id for the {@link IntegrationFlow} to register
|
||||
* @return the current builder instance
|
||||
*/
|
||||
@Override
|
||||
public StandardIntegrationFlowRegistrationBuilder id(String id) {
|
||||
this.integrationFlowRegistration.setId(id);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@code boolean} flag to indication if an {@link IntegrationFlow} must be started
|
||||
* automatically after registration. Defaults to {@code true}.
|
||||
* @param autoStartup start or not the {@link IntegrationFlow} automatically after registration.
|
||||
* @return the current builder instance
|
||||
*/
|
||||
@Override
|
||||
public StandardIntegrationFlowRegistrationBuilder autoStartup(boolean autoStartup) {
|
||||
this.autoStartup = autoStartup;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an object which will be registered as an {@link IntegrationFlow} dependant bean in the
|
||||
* application context. Usually it is some support component, which needs an application context.
|
||||
* For example dynamically created connection factories or header mappers for AMQP, JMS, TCP etc.
|
||||
* @param bean an additional arbitrary bean to register into the application context.
|
||||
* @return the current builder instance
|
||||
*/
|
||||
@Override
|
||||
public StandardIntegrationFlowRegistrationBuilder addBean(Object bean) {
|
||||
return addBean(null, bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an object which will be registered as an {@link IntegrationFlow} dependant bean in the
|
||||
* application context. Usually it is some support component, which needs an application context.
|
||||
* For example dynamically created connection factories or header mappers for AMQP, JMS, TCP etc.
|
||||
* @param name the name for the bean to register.
|
||||
* @param bean an additional arbitrary bean to register into the application context.
|
||||
* @return the current builder instance
|
||||
*/
|
||||
@Override
|
||||
public StandardIntegrationFlowRegistrationBuilder addBean(String name, Object bean) {
|
||||
this.additionalBeans.put(bean, name);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an {@link IntegrationFlow} and all the dependant and support components
|
||||
* in the application context and return an associated {@link IntegrationFlowRegistration}
|
||||
* control object.
|
||||
* @return the {@link IntegrationFlowRegistration} instance.
|
||||
*/
|
||||
@Override
|
||||
public IntegrationFlowRegistration register() {
|
||||
StandardIntegrationFlowContext.this.register(this);
|
||||
return this.integrationFlowRegistration;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
* Copyright 2018 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.
|
||||
@@ -16,26 +16,29 @@
|
||||
|
||||
package org.springframework.integration.dsl.context;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.integration.core.MessagingTemplate;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.StandardIntegrationFlow;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext.IntegrationFlowRegistration;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
|
||||
/**
|
||||
* Instances of this classes are returned as a result of
|
||||
* {@link IntegrationFlowContext#registration(IntegrationFlow)} invocation
|
||||
* {@link StandardIntegrationFlowContext#registration(IntegrationFlow)} invocation
|
||||
* and provide an API for some useful {@link IntegrationFlow} options and its lifecycle.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.0
|
||||
* @since 5.1
|
||||
*
|
||||
* @see IntegrationFlowContext
|
||||
*/
|
||||
public class IntegrationFlowRegistration {
|
||||
class StandardIntegrationFlowRegistration implements IntegrationFlowRegistration {
|
||||
|
||||
private IntegrationFlow integrationFlow;
|
||||
|
||||
@@ -49,34 +52,41 @@ public class IntegrationFlowRegistration {
|
||||
|
||||
private ConfigurableListableBeanFactory beanFactory;
|
||||
|
||||
IntegrationFlowRegistration(IntegrationFlow integrationFlow) {
|
||||
StandardIntegrationFlowRegistration(IntegrationFlow integrationFlow) {
|
||||
this.integrationFlow = integrationFlow;
|
||||
}
|
||||
|
||||
void setBeanFactory(ConfigurableListableBeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory; // NOSONAR (synchronization)
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
|
||||
}
|
||||
|
||||
void setIntegrationFlowContext(IntegrationFlowContext integrationFlowContext) {
|
||||
@Override
|
||||
public void setIntegrationFlowContext(IntegrationFlowContext integrationFlowContext) {
|
||||
this.integrationFlowContext = integrationFlowContext;
|
||||
}
|
||||
|
||||
void setId(String id) {
|
||||
@Override
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
void setIntegrationFlow(IntegrationFlow integrationFlow) {
|
||||
@Override
|
||||
public void setIntegrationFlow(IntegrationFlow integrationFlow) {
|
||||
this.integrationFlow = integrationFlow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IntegrationFlow getIntegrationFlow() {
|
||||
return this.integrationFlow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageChannel getInputChannel() {
|
||||
if (this.inputChannel == null) {
|
||||
if (this.integrationFlow instanceof StandardIntegrationFlow) {
|
||||
@@ -110,6 +120,7 @@ public class IntegrationFlowRegistration {
|
||||
* {@link IllegalStateException} is thrown.
|
||||
* @return the {@link MessagingTemplate} instance
|
||||
*/
|
||||
@Override
|
||||
public MessagingTemplate getMessagingTemplate() {
|
||||
if (this.messagingTemplate == null) {
|
||||
this.messagingTemplate = new MessagingTemplate(getInputChannel()) {
|
||||
@@ -131,6 +142,7 @@ public class IntegrationFlowRegistration {
|
||||
return this.messagingTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
if (this.integrationFlow instanceof Lifecycle) {
|
||||
((Lifecycle) this.integrationFlow).start();
|
||||
@@ -143,6 +155,7 @@ public class IntegrationFlowRegistration {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (this.integrationFlow instanceof Lifecycle) {
|
||||
((Lifecycle) this.integrationFlow).stop();
|
||||
@@ -153,6 +166,7 @@ public class IntegrationFlowRegistration {
|
||||
* Destroy the {@link IntegrationFlow} bean (as well as all its dependant beans)
|
||||
* and clean up all the local cache for it.
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.integrationFlowContext.remove(this.id);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -28,7 +28,7 @@ import org.springframework.messaging.MessageChannel;
|
||||
* @author Artem Bilan
|
||||
* @since 5.0
|
||||
*
|
||||
* @see org.springframework.integration.config.dsl.IntegrationFlowBeanPostProcessor
|
||||
* @see org.springframework.integration.dsl.IntegrationFlowBeanPostProcessor
|
||||
*/
|
||||
public class FixedSubscriberChannelPrototype implements MessageChannel {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @see org.springframework.integration.config.dsl.IntegrationFlowBeanPostProcessor
|
||||
* @see org.springframework.integration.dsl.IntegrationFlowBeanPostProcessor
|
||||
*/
|
||||
public class MessageChannelReference implements MessageChannel {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.event;
|
||||
package org.springframework.integration.events;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
* ApplicationEvents generated by the Spring Integration framework.
|
||||
*/
|
||||
package org.springframework.integration.event;
|
||||
package org.springframework.integration.events;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -25,15 +25,17 @@ import org.springframework.messaging.MessageHandler;
|
||||
* Represents a composite message handler.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
public class CompositeMessageHandlerNode extends MessageHandlerNode {
|
||||
|
||||
private final List<InnerHandler> handlers = new ArrayList<InnerHandler>();
|
||||
private final List<InnerHandler> handlers = new ArrayList<>();
|
||||
|
||||
public CompositeMessageHandlerNode(int nodeId, String name, MessageHandler handler, String input, String output,
|
||||
List<InnerHandler> handlers) {
|
||||
|
||||
super(nodeId, name, handler, input, output);
|
||||
this.handlers.addAll(handlers);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.messaging.MessageHandler;
|
||||
* Represents an endpoint that has a discard channel.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -31,6 +32,7 @@ public class DiscardingMessageHandlerNode extends MessageHandlerNode {
|
||||
|
||||
public DiscardingMessageHandlerNode(int nodeId, String name, MessageHandler handler, String input, String output,
|
||||
String discards) {
|
||||
|
||||
super(nodeId, name, handler, input, output);
|
||||
this.discards = discards;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
/**
|
||||
* Base class for all endpoints.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.integration.handler.CompositeMessageHandler;
|
||||
* (pollable endpoint).
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -34,6 +35,7 @@ public class ErrorCapableCompositeMessageHandlerNode extends CompositeMessageHan
|
||||
|
||||
public ErrorCapableCompositeMessageHandlerNode(int nodeId, String name, CompositeMessageHandler handler, String input,
|
||||
String output, String errors, List<InnerHandler> handlers) {
|
||||
|
||||
super(nodeId, name, handler, input, output, handlers);
|
||||
this.errors = errors;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.springframework.messaging.MessageHandler;
|
||||
* (pollable endpoint).
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -32,6 +33,7 @@ public class ErrorCapableDiscardingMessageHandlerNode extends DiscardingMessageH
|
||||
|
||||
public ErrorCapableDiscardingMessageHandlerNode(int nodeId, String name, MessageHandler handler, String input,
|
||||
String output, String discards, String errors) {
|
||||
|
||||
super(nodeId, name, handler, input, output, discards);
|
||||
this.errors = errors;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
/**
|
||||
* Represents nodes that can natively handle errors.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -29,6 +30,7 @@ public class ErrorCapableEndpointNode extends EndpointNode implements ErrorCapab
|
||||
|
||||
protected ErrorCapableEndpointNode(int nodeId, String name, Object nodeObject, String output, String errors,
|
||||
Stats stats) {
|
||||
|
||||
super(nodeId, name, nodeObject, output, stats);
|
||||
this.errors = errors;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
|
||||
@@ -31,6 +31,7 @@ public class ErrorCapableMessageHandlerNode extends MessageHandlerNode implement
|
||||
|
||||
public ErrorCapableMessageHandlerNode(int nodeId, String name, MessageHandler handler, String input,
|
||||
String output, String errors) {
|
||||
|
||||
super(nodeId, name, handler, input, output);
|
||||
this.errors = errors;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
/**
|
||||
* Nodes implementing this interface are capable of emitting errors.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.messaging.MessageHandler;
|
||||
* (pollable endpoint).
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -34,6 +35,7 @@ public class ErrorCapableRoutingNode extends RoutingMessageHandlerNode implement
|
||||
|
||||
public ErrorCapableRoutingNode(int nodeId, String name, MessageHandler handler, String input, String output,
|
||||
String errors, Collection<String> routes) {
|
||||
|
||||
super(nodeId, name, handler, input, output, routes);
|
||||
this.errors = errors;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
@@ -25,6 +25,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author Andy Clement
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
@@ -51,6 +51,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -122,8 +123,8 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
descriptor.put("name", name);
|
||||
}
|
||||
this.nodeFactory.reset();
|
||||
Collection<IntegrationNode> nodes = new ArrayList<IntegrationNode>();
|
||||
Collection<LinkNode> links = new ArrayList<LinkNode>();
|
||||
Collection<IntegrationNode> nodes = new ArrayList<>();
|
||||
Collection<LinkNode> links = new ArrayList<>();
|
||||
Map<String, MessageChannelNode> channelNodes = channels(nodes);
|
||||
pollingAdapters(nodes, links, channelNodes);
|
||||
gateways(nodes, links, channelNodes);
|
||||
@@ -136,7 +137,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
private Map<String, MessageChannelNode> channels(Collection<IntegrationNode> nodes) {
|
||||
Map<String, MessageChannel> channels = this.applicationContext
|
||||
.getBeansOfType(MessageChannel.class);
|
||||
Map<String, MessageChannelNode> channelNodes = new HashMap<String, MessageChannelNode>();
|
||||
Map<String, MessageChannelNode> channelNodes = new HashMap<>();
|
||||
for (Entry<String, MessageChannel> entry : channels.entrySet()) {
|
||||
MessageChannel channel = entry.getValue();
|
||||
MessageChannelNode channelNode = this.nodeFactory.channelNode(entry.getKey(), channel);
|
||||
@@ -149,6 +150,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private void pollingAdapters(Collection<IntegrationNode> nodes, Collection<LinkNode> links,
|
||||
Map<String, MessageChannelNode> channelNodes) {
|
||||
|
||||
Map<String, SourcePollingChannelAdapter> spcas = this.applicationContext
|
||||
.getBeansOfType(SourcePollingChannelAdapter.class);
|
||||
for (Entry<String, SourcePollingChannelAdapter> entry : spcas.entrySet()) {
|
||||
@@ -161,6 +163,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private void gateways(Collection<IntegrationNode> nodes, Collection<LinkNode> links,
|
||||
Map<String, MessageChannelNode> channelNodes) {
|
||||
|
||||
Map<String, MessagingGatewaySupport> gateways = this.applicationContext
|
||||
.getBeansOfType(MessagingGatewaySupport.class);
|
||||
for (Entry<String, MessagingGatewaySupport> entry : gateways.entrySet()) {
|
||||
@@ -194,6 +197,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private void producers(Collection<IntegrationNode> nodes, Collection<LinkNode> links,
|
||||
Map<String, MessageChannelNode> channelNodes) {
|
||||
|
||||
Map<String, MessageProducerSupport> producers = this.applicationContext
|
||||
.getBeansOfType(MessageProducerSupport.class);
|
||||
for (Entry<String, MessageProducerSupport> entry : producers.entrySet()) {
|
||||
@@ -206,6 +210,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private void consumers(Collection<IntegrationNode> nodes, Collection<LinkNode> links,
|
||||
Map<String, MessageChannelNode> channelNodes) {
|
||||
|
||||
Map<String, IntegrationConsumer> consumers = this.applicationContext.getBeansOfType(IntegrationConsumer.class);
|
||||
for (Entry<String, IntegrationConsumer> entry : consumers.entrySet()) {
|
||||
IntegrationConsumer consumer = entry.getValue();
|
||||
@@ -223,6 +228,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private void producerLink(Collection<LinkNode> links, Map<String, MessageChannelNode> channelNodes,
|
||||
EndpointNode endpointNode) {
|
||||
|
||||
MessageChannelNode channelNode;
|
||||
if (endpointNode.getOutput() != null) {
|
||||
channelNode = channelNodes.get(endpointNode.getOutput());
|
||||
@@ -355,9 +361,9 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private MessageHandlerNode compositeHandler(String name, IntegrationConsumer consumer,
|
||||
CompositeMessageHandler handler, String output, String errors, boolean polled) {
|
||||
|
||||
List<MessageHandler> handlers = handler.getHandlers();
|
||||
List<CompositeMessageHandlerNode.InnerHandler> innerHandlers =
|
||||
new ArrayList<CompositeMessageHandlerNode.InnerHandler>();
|
||||
List<CompositeMessageHandlerNode.InnerHandler> innerHandlers = new ArrayList<>();
|
||||
for (MessageHandler innerHandler : handlers) {
|
||||
if (innerHandler instanceof NamedComponent) {
|
||||
NamedComponent named = (NamedComponent) innerHandler;
|
||||
@@ -375,6 +381,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private MessageHandlerNode discardingHandler(String name, IntegrationConsumer consumer,
|
||||
DiscardingMessageHandler handler, String output, String errors, boolean polled) {
|
||||
|
||||
String discards = handler.getDiscardChannel() != null ? handler.getDiscardChannel().toString() : null;
|
||||
String inputChannel = consumer.getInputChannel() != null ? consumer.getInputChannel().toString() : null;
|
||||
return polled
|
||||
@@ -386,6 +393,7 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
|
||||
private MessageHandlerNode routingHandler(String name, IntegrationConsumer consumer, MessageHandler handler,
|
||||
MappingMessageRouterManagement router, String output, String errors, boolean polled) {
|
||||
|
||||
Collection<String> routes = router.getChannelMappings().values();
|
||||
Collection<String> dynamicChannelNames = router.getDynamicChannelNames();
|
||||
if (dynamicChannelNames.size() > 0) {
|
||||
@@ -403,8 +411,9 @@ public class IntegrationGraphServer implements ApplicationContextAware, Applicat
|
||||
private MessageHandlerNode recipientListRoutingHandler(String name, IntegrationConsumer consumer,
|
||||
MessageHandler handler, RecipientListRouterManagement router, String output, String errors,
|
||||
boolean polled) {
|
||||
|
||||
Collection<?> recipients = router.getRecipients();
|
||||
List<String> routes = new ArrayList<String>(recipients.size());
|
||||
List<String> routes = new ArrayList<>(recipients.size());
|
||||
for (Object recipient : recipients) {
|
||||
routes.add(((Recipient) recipient).getChannel().toString());
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
/**
|
||||
* Represents a link between nodes.
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.integration.support.management.MessageChannelMetrics;
|
||||
import org.springframework.integration.support.management.Statistics;
|
||||
@@ -24,6 +24,7 @@ import org.springframework.messaging.MessageChannel;
|
||||
* Represents a message channel.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.integration.gateway.MessagingGatewaySupport;
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.integration.gateway.MessagingGatewaySupport;
|
||||
* Represents an inbound gateway.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.integration.support.management.MessageHandlerMetrics;
|
||||
import org.springframework.integration.support.management.Statistics;
|
||||
@@ -24,6 +24,7 @@ import org.springframework.messaging.MessageHandler;
|
||||
* Represents a message handler.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -97,6 +98,7 @@ public class MessageHandlerNode extends EndpointNode {
|
||||
public boolean isCountsEnabled() {
|
||||
return this.handler.isCountsEnabled();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
* Represents an inbound message producer.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.support.management.MessageSourceMetrics;
|
||||
@@ -23,6 +23,7 @@ import org.springframework.integration.support.management.MessageSourceMetrics;
|
||||
* Represents a message source.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.support.management.graph;
|
||||
package org.springframework.integration.graph;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.springframework.messaging.MessageHandler;
|
||||
* Represents an endpoint that can route to multiple channels.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
@@ -33,6 +34,7 @@ public class RoutingMessageHandlerNode extends MessageHandlerNode {
|
||||
|
||||
public RoutingMessageHandlerNode(int nodeId, String name, MessageHandler handler, String input, String output,
|
||||
Collection<String> routes) {
|
||||
|
||||
super(nodeId, name, handler, input, output);
|
||||
this.routes = routes;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Provides classes related to the runtime object graph.
|
||||
*/
|
||||
package org.springframework.integration.graph;
|
||||
@@ -1,4 +0,0 @@
|
||||
/**
|
||||
* Provides classes related to the runtime object graph.
|
||||
*/
|
||||
package org.springframework.integration.support.management.graph;
|
||||
@@ -2,4 +2,4 @@ org.springframework.integration.config.IntegrationConfigurationInitializer=\
|
||||
org.springframework.integration.config.GlobalChannelInterceptorInitializer,\
|
||||
org.springframework.integration.config.IntegrationConverterInitializer,\
|
||||
org.springframework.integration.config.IdempotentReceiverAutoProxyCreatorInitializer,\
|
||||
org.springframework.integration.config.dsl.DslIntegrationConfigurationInitializer
|
||||
org.springframework.integration.dsl.context.DslIntegrationConfigurationInitializer
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.handler.MessageTriggerAction;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
@@ -61,9 +61,9 @@ import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.context.IntegrationContextUtils;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.dsl.Pollers;
|
||||
import org.springframework.integration.dsl.Transformers;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
|
||||
import org.springframework.integration.handler.GenericHandler;
|
||||
import org.springframework.integration.handler.advice.ErrorMessageSendingRecoverer;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -48,7 +48,7 @@ import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlowAdapter;
|
||||
import org.springframework.integration.dsl.IntegrationFlowDefinition;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.handler.LoggingHandler;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
@@ -54,11 +54,11 @@ import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlowAdapter;
|
||||
import org.springframework.integration.dsl.IntegrationFlowDefinition;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageProducerSpec;
|
||||
import org.springframework.integration.dsl.StandardIntegrationFlow;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
|
||||
import org.springframework.integration.support.SmartLifecycleRoleController;
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -44,7 +44,7 @@ import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.config.EnableMessageHistory;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.expression.FunctionExpression;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.Message;
|
||||
|
||||
@@ -49,8 +49,8 @@ import org.springframework.integration.codec.Codec;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.dsl.Transformers;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
|
||||
import org.springframework.integration.handler.advice.IdempotentReceiverInterceptor;
|
||||
import org.springframework.integration.selector.MetadataStoreSelector;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2018 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.
|
||||
@@ -36,7 +36,7 @@ import org.springframework.integration.annotation.ServiceActivator;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
* Copyright 2015-2018 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.
|
||||
@@ -36,6 +36,7 @@ import org.springframework.integration.channel.AbstractMessageChannel;
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.config.EnableIntegrationManagement;
|
||||
import org.springframework.integration.config.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.endpoint.AbstractMessageSource;
|
||||
import org.springframework.integration.handler.AbstractMessageHandler;
|
||||
import org.springframework.integration.router.RecipientListRouter;
|
||||
@@ -44,6 +45,7 @@ import org.springframework.messaging.MessageChannel;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.2
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -48,6 +48,8 @@ import org.springframework.integration.core.MessageProducer;
|
||||
import org.springframework.integration.endpoint.EventDrivenConsumer;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.integration.endpoint.PollingConsumer;
|
||||
import org.springframework.integration.graph.Graph;
|
||||
import org.springframework.integration.graph.IntegrationGraphServer;
|
||||
import org.springframework.integration.router.ExpressionEvaluatingRouter;
|
||||
import org.springframework.integration.router.HeaderValueRouter;
|
||||
import org.springframework.integration.router.RecipientListRouter;
|
||||
@@ -69,6 +71,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -40,7 +40,7 @@ import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.event.core.MessagingEvent;
|
||||
import org.springframework.integration.event.inbound.ApplicationEventListeningMessageProducer;
|
||||
import org.springframework.integration.event.outbound.ApplicationEventPublishingMessageHandler;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2018 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.
|
||||
@@ -16,10 +16,11 @@
|
||||
|
||||
package org.springframework.integration.file.event;
|
||||
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 3.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -64,9 +64,9 @@ import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlowDefinition;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.dsl.Pollers;
|
||||
import org.springframework.integration.dsl.StandardIntegrationFlow;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.expression.FunctionExpression;
|
||||
import org.springframework.integration.file.DefaultDirectoryScanner;
|
||||
import org.springframework.integration.file.DefaultFileNameGenerator;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
* Copyright 2014-2018 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.
|
||||
@@ -52,7 +52,7 @@ import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.Pollers;
|
||||
import org.springframework.integration.dsl.StandardIntegrationFlow;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.file.FileHeaders;
|
||||
import org.springframework.integration.file.remote.RemoteFileTemplate;
|
||||
import org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -36,8 +36,8 @@ import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.integration.context.IntegrationContextUtils;
|
||||
import org.springframework.integration.graph.IntegrationGraphServer;
|
||||
import org.springframework.integration.http.management.IntegrationGraphController;
|
||||
import org.springframework.integration.support.management.graph.IntegrationGraphServer;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.integration.http.management;
|
||||
|
||||
import org.springframework.integration.graph.Graph;
|
||||
import org.springframework.integration.graph.IntegrationGraphServer;
|
||||
import org.springframework.integration.http.config.HttpContextUtils;
|
||||
import org.springframework.integration.support.management.graph.Graph;
|
||||
import org.springframework.integration.support.management.graph.IntegrationGraphServer;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2018 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.
|
||||
@@ -16,10 +16,11 @@
|
||||
|
||||
package org.springframework.integration.ip.event;
|
||||
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 3.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.Transformers;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.ip.tcp.TcpReceivingChannelAdapter;
|
||||
import org.springframework.integration.ip.tcp.TcpSendingMessageHandler;
|
||||
import org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory;
|
||||
@@ -60,6 +60,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,7 +21,7 @@ import javax.jms.Destination;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.integration.dsl.channel.MessageChannelSpec;
|
||||
import org.springframework.integration.dsl.MessageChannelSpec;
|
||||
import org.springframework.integration.jms.AbstractJmsChannel;
|
||||
import org.springframework.integration.jms.config.JmsChannelFactoryBean;
|
||||
import org.springframework.jms.support.converter.MessageConverter;
|
||||
@@ -33,6 +33,7 @@ import org.springframework.jms.support.destination.DestinationResolver;
|
||||
* @param <S> the target {@link JmsPollableMessageChannelSpec} implementation type.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 5.0
|
||||
*/
|
||||
public class JmsPollableMessageChannelSpec<S extends JmsPollableMessageChannelSpec<S>>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -57,8 +57,8 @@ import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlowDefinition;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.dsl.Pollers;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.endpoint.MethodInvokingMessageSource;
|
||||
import org.springframework.integration.scheduling.PollerMetadata;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2018 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.
|
||||
@@ -42,9 +42,8 @@ import org.springframework.context.expression.StandardBeanExpressionResolver;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.integration.config.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.monitor.IntegrationMBeanExporter;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
import org.springframework.jmx.support.RegistrationPolicy;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -56,6 +55,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
@Configuration
|
||||
@@ -103,7 +103,7 @@ public class IntegrationMBeanExportConfiguration implements ImportAware, Environ
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public IntegrationMBeanExporter mbeanExporter() {
|
||||
IntegrationMBeanExporter exporter = new IntegrationMBeanExporter();
|
||||
exporter.setRegistrationPolicy(this.attributes.<RegistrationPolicy>getEnum("registration"));
|
||||
exporter.setRegistrationPolicy(this.attributes.getEnum("registration"));
|
||||
setupDomain(exporter);
|
||||
setupServer(exporter);
|
||||
setupComponentNamePatterns(exporter);
|
||||
@@ -152,7 +152,7 @@ public class IntegrationMBeanExportConfiguration implements ImportAware, Environ
|
||||
}
|
||||
|
||||
private void setupComponentNamePatterns(IntegrationMBeanExporter exporter) {
|
||||
List<String> patterns = new ArrayList<String>();
|
||||
List<String> patterns = new ArrayList<>();
|
||||
String[] managedComponents = this.attributes.getStringArray("managedComponents");
|
||||
for (String managedComponent : managedComponents) {
|
||||
String pattern = this.environment.resolvePlaceholders(managedComponent);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -44,6 +44,7 @@ import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.EmbeddedValueResolverAware;
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.context.IntegrationContextUtils;
|
||||
import org.springframework.integration.context.OrderlyShutdownCapable;
|
||||
import org.springframework.integration.core.MessageProducer;
|
||||
@@ -52,7 +53,6 @@ import org.springframework.integration.gateway.MessagingGatewaySupport;
|
||||
import org.springframework.integration.handler.AbstractMessageProducingHandler;
|
||||
import org.springframework.integration.history.MessageHistoryConfigurer;
|
||||
import org.springframework.integration.support.context.NamedComponent;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.support.management.LifecycleMessageHandlerMetrics;
|
||||
import org.springframework.integration.support.management.LifecycleMessageSourceManagement;
|
||||
import org.springframework.integration.support.management.LifecycleMessageSourceMetrics;
|
||||
@@ -123,31 +123,32 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
private final Map<Object, AtomicLong> anonymousHandlerCounters = new HashMap<Object, AtomicLong>();
|
||||
private final Map<Object, AtomicLong> anonymousHandlerCounters = new HashMap<>();
|
||||
|
||||
private final Map<Object, AtomicLong> anonymousSourceCounters = new HashMap<Object, AtomicLong>();
|
||||
private final Map<Object, AtomicLong> anonymousSourceCounters = new HashMap<>();
|
||||
|
||||
private final Set<MessageHandlerMetrics> handlers = new HashSet<MessageHandlerMetrics>();
|
||||
private final Set<MessageHandlerMetrics> handlers = new HashSet<>();
|
||||
|
||||
private final Set<MessageSourceMetrics> sources = new HashSet<MessageSourceMetrics>();
|
||||
private final Set<MessageSourceMetrics> sources = new HashSet<>();
|
||||
|
||||
private final Set<Lifecycle> inboundLifecycleMessageProducers = new HashSet<Lifecycle>();
|
||||
private final Set<Lifecycle> inboundLifecycleMessageProducers = new HashSet<>();
|
||||
|
||||
private final Set<MessageChannelMetrics> channels = new HashSet<MessageChannelMetrics>();
|
||||
private final Set<MessageChannelMetrics> channels = new HashSet<>();
|
||||
|
||||
private final Map<String, MessageChannelMetrics> allChannelsByName = new HashMap<String, MessageChannelMetrics>();
|
||||
private final Map<String, MessageChannelMetrics> allChannelsByName = new HashMap<>();
|
||||
|
||||
private final Map<String, MessageHandlerMetrics> allHandlersByName = new HashMap<String, MessageHandlerMetrics>();
|
||||
private final Map<String, MessageHandlerMetrics> allHandlersByName = new HashMap<>();
|
||||
|
||||
private final Map<String, MessageSourceMetrics> allSourcesByName = new HashMap<String, MessageSourceMetrics>();
|
||||
private final Map<String, MessageSourceMetrics> allSourcesByName = new HashMap<>();
|
||||
|
||||
private final Map<String, String> beansByEndpointName = new HashMap<String, String>();
|
||||
private final Map<String, String> beansByEndpointName = new HashMap<>();
|
||||
|
||||
private String domain = DEFAULT_DOMAIN;
|
||||
|
||||
private final Properties objectNameStaticProperties = new Properties();
|
||||
|
||||
private final MetadataNamingStrategy defaultNamingStrategy = new IntegrationMetadataNamingStrategy(this.attributeSource);
|
||||
private final MetadataNamingStrategy defaultNamingStrategy =
|
||||
new IntegrationMetadataNamingStrategy(this.attributeSource);
|
||||
|
||||
private String[] componentNamePatterns = { "*" };
|
||||
|
||||
@@ -300,7 +301,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati
|
||||
|
||||
private MessageHandler handlerInAnonymousWrapper(final Object bean) {
|
||||
if (bean != null && bean.getClass().isAnonymousClass()) {
|
||||
final AtomicReference<MessageHandler> wrapped = new AtomicReference<MessageHandler>();
|
||||
final AtomicReference<MessageHandler> wrapped = new AtomicReference<>();
|
||||
ReflectionUtils.doWithFields(bean.getClass(), field -> {
|
||||
field.setAccessible(true);
|
||||
Object handler = field.get(bean);
|
||||
@@ -320,7 +321,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati
|
||||
* and risk it being a proxy (which it almost certainly is by now).
|
||||
*
|
||||
* @param bean the bean instance to register
|
||||
* @param beanKey the bean name or human readable version if autogenerated
|
||||
* @param beanKey the bean name or human readable version if auto-generated
|
||||
* @return the JMX object name of the MBean that was registered
|
||||
*/
|
||||
private ObjectName registerBeanInstance(Object bean, String beanKey) {
|
||||
@@ -678,7 +679,7 @@ public class IntegrationMBeanExporter extends MBeanExporter implements Applicati
|
||||
|
||||
private void registerEndpoints() {
|
||||
String[] names = this.applicationContext.getBeanNamesForType(AbstractEndpoint.class);
|
||||
Set<String> endpointNames = new HashSet<String>();
|
||||
Set<String> endpointNames = new HashSet<>();
|
||||
for (String name : names) {
|
||||
if (!this.beansByEndpointName.values().contains(name)) {
|
||||
AbstractEndpoint endpoint = this.applicationContext.getBean(name, AbstractEndpoint.class);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -31,6 +31,7 @@ import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.integration.config.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.monitor.IntegrationMBeanExporter;
|
||||
import org.springframework.integration.support.management.AbstractMessageChannelMetrics;
|
||||
import org.springframework.integration.support.management.AbstractMessageHandlerMetrics;
|
||||
@@ -39,7 +40,6 @@ import org.springframework.integration.support.management.DefaultMessageHandlerM
|
||||
import org.springframework.integration.support.management.ExponentialMovingAverage;
|
||||
import org.springframework.integration.support.management.ExponentialMovingAverageRate;
|
||||
import org.springframework.integration.support.management.ExponentialMovingAverageRatio;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.support.management.MessageChannelMetrics;
|
||||
import org.springframework.integration.support.management.MessageHandlerMetrics;
|
||||
import org.springframework.integration.support.management.MetricsFactory;
|
||||
@@ -53,6 +53,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gunnar Hillert
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@@ -64,7 +65,7 @@ public class MBeanExporterParserTests {
|
||||
private ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void testMBeanExporterExists() throws InterruptedException {
|
||||
public void testMBeanExporterExists() {
|
||||
IntegrationMBeanExporter exporter = this.context.getBean(IntegrationMBeanExporter.class);
|
||||
MBeanServer server = this.context.getBean("mbs", MBeanServer.class);
|
||||
Properties properties = TestUtils.getPropertyValue(exporter, "objectNameStaticProperties", Properties.class);
|
||||
|
||||
@@ -43,10 +43,10 @@ import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.config.EnableIntegrationManagement;
|
||||
import org.springframework.integration.config.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.jmx.config.EnableIntegrationMBeanExport;
|
||||
import org.springframework.integration.monitor.IntegrationMBeanExporter;
|
||||
import org.springframework.integration.support.management.DefaultMetricsFactory;
|
||||
import org.springframework.integration.support.management.IntegrationManagementConfigurer;
|
||||
import org.springframework.integration.support.management.MetricsFactory;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.jmx.support.MBeanServerFactoryBean;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2016 the original author or authors.
|
||||
* Copyright 2013-2018 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.
|
||||
@@ -16,10 +16,11 @@
|
||||
|
||||
package org.springframework.integration.mail.event;
|
||||
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 3.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2018 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.
|
||||
@@ -50,7 +50,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.mail.ImapIdleChannelAdapter;
|
||||
import org.springframework.integration.mail.MailHeaders;
|
||||
import org.springframework.integration.mail.support.DefaultMailHeaderMapper;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -43,7 +43,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.channel.MessageChannels;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.handler.ReplyRequiredException;
|
||||
import org.springframework.integration.mongodb.rules.MongoDbAvailable;
|
||||
import org.springframework.integration.mongodb.rules.MongoDbAvailableTests;
|
||||
@@ -59,6 +59,7 @@ import com.mongodb.client.MongoCollection;
|
||||
|
||||
/**
|
||||
* @author Xavier Padró
|
||||
*
|
||||
* @since 5.0
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2016 the original author or authors.
|
||||
* Copyright 2014-2018 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.
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.integration.mqtt.event;
|
||||
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
|
||||
/**
|
||||
* Base class for Mqtt Events.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
* Copyright 2013-2018 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.
|
||||
@@ -16,10 +16,11 @@
|
||||
|
||||
package org.springframework.integration.redis.event;
|
||||
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 3.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2017 the original author or authors.
|
||||
* Copyright 2013-2018 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.
|
||||
@@ -57,7 +57,7 @@ import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
import org.springframework.integration.redis.event.RedisExceptionEvent;
|
||||
import org.springframework.integration.redis.rules.RedisAvailable;
|
||||
import org.springframework.integration.redis.rules.RedisAvailableTests;
|
||||
@@ -77,6 +77,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
* @author Rainer Frey
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@@ -99,11 +100,11 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
@Test
|
||||
@RedisAvailable
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testInt3014Default() throws Exception {
|
||||
public void testInt3014Default() {
|
||||
|
||||
String queueName = "si.test.redisQueueInboundChannelAdapterTests";
|
||||
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(this.connectionFactory);
|
||||
redisTemplate.setEnableDefaultSerializer(false);
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
@@ -142,11 +143,11 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
@Test
|
||||
@RedisAvailable
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testInt3014ExpectMessageTrue() throws Exception {
|
||||
public void testInt3014ExpectMessageTrue() {
|
||||
|
||||
final String queueName = "si.test.redisQueueInboundChannelAdapterTests2";
|
||||
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(this.connectionFactory);
|
||||
redisTemplate.setEnableDefaultSerializer(false);
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
@@ -193,7 +194,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
|
||||
@Test
|
||||
@RedisAvailable
|
||||
public void testInt3017IntegrationInbound() throws Exception {
|
||||
public void testInt3017IntegrationInbound() {
|
||||
|
||||
String payload = new Date().toString();
|
||||
|
||||
@@ -211,7 +212,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
|
||||
@Test
|
||||
@RedisAvailable
|
||||
public void testInt3017IntegrationSymmetrical() throws Exception {
|
||||
public void testInt3017IntegrationSymmetrical() {
|
||||
UUID payload = UUID.randomUUID();
|
||||
Message<UUID> message = MessageBuilder.withPayload(payload)
|
||||
.setHeader("redis_queue", "si.test.Int3017IntegrationSymmetrical")
|
||||
@@ -230,7 +231,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
public void testInt3442ProperlyStop() throws Exception {
|
||||
final String queueName = "si.test.testInt3442ProperlyStopTest";
|
||||
|
||||
final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||
final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(this.connectionFactory);
|
||||
redisTemplate.setEnableDefaultSerializer(false);
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
@@ -283,7 +284,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
String queueName = "test.si.Int3196Recovery";
|
||||
QueueChannel channel = new QueueChannel();
|
||||
|
||||
final List<ApplicationEvent> exceptionEvents = new ArrayList<ApplicationEvent>();
|
||||
final List<ApplicationEvent> exceptionEvents = new ArrayList<>();
|
||||
|
||||
final CountDownLatch exceptionsLatch = new CountDownLatch(2);
|
||||
|
||||
@@ -309,7 +310,7 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
assertThat(exceptionEvent, Matchers.instanceOf(RedisExceptionEvent.class));
|
||||
assertSame(endpoint, exceptionEvent.getSource());
|
||||
assertThat(((IntegrationEvent) exceptionEvent).getCause().getClass(),
|
||||
Matchers.isIn(Arrays.<Class<? extends Throwable>>asList(RedisSystemException.class, RedisConnectionFailureException.class)));
|
||||
Matchers.isIn(Arrays.asList(RedisSystemException.class, RedisConnectionFailureException.class)));
|
||||
}
|
||||
|
||||
((InitializingBean) this.connectionFactory).afterPropertiesSet();
|
||||
@@ -335,11 +336,11 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
@Test
|
||||
@RedisAvailable
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testInt3932ReadFromLeft() throws Exception {
|
||||
public void testInt3932ReadFromLeft() {
|
||||
|
||||
String queueName = "si.test.redisQueueInboundChannelAdapterTests3932";
|
||||
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setConnectionFactory(this.connectionFactory);
|
||||
redisTemplate.setEnableDefaultSerializer(false);
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
* Copyright 2014-2018 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.
|
||||
@@ -43,7 +43,7 @@ import org.springframework.integration.dsl.IntegrationFlows;
|
||||
import org.springframework.integration.dsl.Pollers;
|
||||
import org.springframework.integration.dsl.StandardIntegrationFlow;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.file.FileHeaders;
|
||||
import org.springframework.integration.file.remote.RemoteFileTemplate;
|
||||
import org.springframework.integration.file.remote.gateway.AbstractRemoteFileOutboundGateway;
|
||||
@@ -61,6 +61,7 @@ import com.jcraft.jsch.ChannelSftp;
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 the original author or authors.
|
||||
* Copyright 2015-2018 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.
|
||||
@@ -17,12 +17,13 @@
|
||||
package org.springframework.integration.stomp.event;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
|
||||
/**
|
||||
* Base class for all {@link ApplicationEvent}s generated by the STOMP Adapters.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
*
|
||||
* @since 4.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@@ -35,4 +36,5 @@ public abstract class StompIntegrationEvent extends IntegrationEvent {
|
||||
public StompIntegrationEvent(Object source, Throwable cause) {
|
||||
super(source, cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -16,12 +16,13 @@
|
||||
|
||||
package org.springframework.integration.stream;
|
||||
|
||||
import org.springframework.integration.event.IntegrationEvent;
|
||||
import org.springframework.integration.events.IntegrationEvent;
|
||||
|
||||
/**
|
||||
* Application event published when EOF is detected on a stream.
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2017 the original author or authors.
|
||||
* Copyright 2017-2018 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.
|
||||
@@ -44,7 +44,7 @@ import org.springframework.integration.dsl.PollerSpec;
|
||||
import org.springframework.integration.dsl.Pollers;
|
||||
import org.springframework.integration.dsl.StandardIntegrationFlow;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext.IntegrationFlowRegistration;
|
||||
import org.springframework.integration.scheduling.PollerMetadata;
|
||||
import org.springframework.integration.test.context.MockIntegrationContext;
|
||||
import org.springframework.integration.test.context.SpringIntegrationTest;
|
||||
|
||||
312
src/reference/asciidoc/changes-4.3-5.0.adoc
Normal file
312
src/reference/asciidoc/changes-4.3-5.0.adoc
Normal file
@@ -0,0 +1,312 @@
|
||||
[[migration-4.3-5.0]]
|
||||
=== Changes between 4.3 and 5.0
|
||||
|
||||
[[x5.0-new-components]]
|
||||
=== New Components
|
||||
|
||||
==== Java DSL
|
||||
|
||||
The separate https://github.com/spring-projects/spring-integration-java-dsl[Spring Integration Java DSL] project has now been merged into the core Spring Integration project.
|
||||
The `IntegrationComponentSpec` implementations for channel adapters and gateways are distributed to their specific modules.
|
||||
See <<java-dsl>> for more information about Java DSL support.
|
||||
Also see the https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-4.3-to-5.0-Migration-Guide#java-dsl[4.3 to 5.0 Migration Guide] for the required steps to move to Spring Integration 5.0.
|
||||
|
||||
==== Testing Support
|
||||
|
||||
A new Spring Integration Test Framework has been created to assist with testing Spring Integration applications.
|
||||
Now, with the `@SpringIntegrationTest` annotation on test class and `MockIntegration` factory you can make your JUnit tests for integration flows somewhat easier.
|
||||
|
||||
See <<testing>> for more information.
|
||||
|
||||
==== MongoDB Outbound Gateway
|
||||
|
||||
The new `MongoDbOutboundGateway` allows you to make queries to the database on demand by sending a message to its request channel.
|
||||
|
||||
See <<mongodb-outbound-gateway>> for more information.
|
||||
|
||||
==== WebFlux Gateways and Channel Adapters
|
||||
|
||||
The new WebFlux support module has been introduced for Spring WebFlux Framework gateways and channel adapters.
|
||||
|
||||
See <<webflux>> for more information.
|
||||
|
||||
==== Content Type Conversion
|
||||
|
||||
Now that we use the new `InvocableHandlerMethod` -based infrastructure for service method invocations, we can perform `contentType` conversion from payload to target method argument.
|
||||
|
||||
See <<content-type-conversion>> for more information.
|
||||
|
||||
==== ErrorMessagePublisher and ErrorMessageStrategy
|
||||
|
||||
The `ErrorMessagePublisher` and the `ErrorMessageStrategy` are provided for creating `ErrorMessage` instances.
|
||||
|
||||
See <<namespace-errorhandler>> for more information.
|
||||
|
||||
==== JDBC Metadata Store
|
||||
|
||||
A JDBC implementation of `MetadataStore` implementation is now provided.
|
||||
This is useful when it is necessary to ensure transactional boundaries for metadata.
|
||||
|
||||
See <<jdbc-metadata-store>> for more information.
|
||||
|
||||
[[x5.0-general]]
|
||||
=== General Changes
|
||||
|
||||
Spring Integration is now fully based on Spring Framework `5.0` and Project Reactor `3.1`.
|
||||
Previous Project Reactor versions are no longer supported.
|
||||
|
||||
==== Core Changes
|
||||
|
||||
The `@Poller` annotation now has the `errorChannel` attribute for easier configuration of the underlying `MessagePublishingErrorHandler`.
|
||||
|
||||
See <<annotations>> for more information.
|
||||
|
||||
All the request-reply endpoints (based on `AbstractReplyProducingMessageHandler`) can now start transaction and, therefore, make the whole downstream flow transactional.
|
||||
|
||||
See <<tx-handle-message-advice>> for more information.
|
||||
|
||||
The `SmartLifecycleRoleController` now provides methods to obtain status of endpoints in roles.
|
||||
|
||||
See <<endpoint-roles>> for more information.
|
||||
|
||||
POJO methods are now invoked using an `InvocableHandlerMethod` by default, but can be configured to use SpEL as before.
|
||||
|
||||
See <<pojo-invocation>> for more information.
|
||||
|
||||
When targeting POJO methods as message handlers, one of the service methods can now be marked with the `@Default` annotation to provide a fallback mechanism for non-matched conditions.
|
||||
|
||||
See <<service-activator-namespace>> for more information.
|
||||
|
||||
A simple `PassThroughTransactionSynchronizationFactory` is provided to always store a polled message in the current transaction context.
|
||||
That message is used as a `failedMessage` property of the `MessagingException` which wraps a raw exception thrown during transaction completion.
|
||||
|
||||
See <<transaction-synchronization>> for more information.
|
||||
|
||||
The aggregator expression-based `ReleaseStrategy` now evaluates the expression against the `MessageGroup` instead of just the collection of `Message<?>`.
|
||||
|
||||
See <<aggregator-spel>> for more information.
|
||||
|
||||
The `ObjectToMapTransformer` can now be supplied with a customised `JsonObjectMapper`.
|
||||
|
||||
See <<aggregator-spel>> for more information.
|
||||
|
||||
The `@GlobalChannelInterceptor` annotation and `<int:channel-interceptor>` now support negative patterns (via `!` prepending) for component names matching.
|
||||
|
||||
See <<global-channel-configuration-interceptors>> for more information.
|
||||
|
||||
A new `OnFailedToAcquireMutexEvent` is emitted now via `DefaultLeaderEventPublisher` by the `LockRegistryLeaderInitiator`, when candidate is failed to acquire the lock.
|
||||
|
||||
See <<leadership-event-handling>> for more information.
|
||||
|
||||
==== Gateway Changes
|
||||
|
||||
The gateway now correctly sets the `errorChannel` header when the gateway method has a `void` return type and an error channel is provided.
|
||||
Previously, the header was not populated.
|
||||
This had the effect that synchronous downstream flows (running on the calling thread) would send the exception to the configured channel but an exception on an async downstream flow would be sent to the default `errorChannel` instead.
|
||||
|
||||
The `RequestReplyExchanger` interface now has a `throws MessagingException` clause to meet all the proposed messages exchange contract.
|
||||
|
||||
The request and reply timeouts can now be specified as SpEL expressions.
|
||||
|
||||
See <<gateway>> for more information.
|
||||
|
||||
==== Aggregator Performance Changes
|
||||
|
||||
Aggregators now use a `SimpleSequenceSizeReleaseStrategy` by default, which is more efficient, especially with large groups.
|
||||
Empty groups are now scheduled for removal after `empty-group-min-timeout`.
|
||||
|
||||
See <<aggregator>> for more information.
|
||||
|
||||
==== Splitter Changes
|
||||
|
||||
The Splitter component now can handle and split Java `Stream` and Reactive Streams `Publisher` objects.
|
||||
If the output channel is a `ReactiveStreamsSubscribableChannel`, the `AbstractMessageSplitter` builds a `Flux` for subsequent iteration instead of a regular `Iterator` independent of object being split.
|
||||
In addition, `AbstractMessageSplitter` provides `protected obtainSizeIfPossible()` methods to allow the determination of the size of the `Iterable` and `Iterator` objects if that is possible.
|
||||
|
||||
See <<splitter>> for more information.
|
||||
|
||||
==== JMS Changes
|
||||
|
||||
Previously, Spring Integration JMS XML configuration used a default bean name `connectionFactory` for the JMS Connection Factory, allowing the property to be omitted from component definitions.
|
||||
It has now been renamed to `jmsConnectionFactory`, which is the bean name used by Spring Boot to auto-configure the JMS Connection Factory bean.
|
||||
|
||||
If your application is relying on the previous behavior, rename your `connectionFactory` bean to `jmsConnectionFactory`, or specifically configure your components to use your bean using its current name.
|
||||
|
||||
See <<jms>> for more information.
|
||||
|
||||
==== Mail Changes
|
||||
|
||||
Some inconsistencies with rendering IMAP mail content have been resolved.
|
||||
|
||||
See <<imap-format-important, the note in the Mail-Receiving Channel Adapter Section>> for more information.
|
||||
|
||||
==== Feed Changes
|
||||
|
||||
Instead of the `com.rometools.fetcher.FeedFetcher`, which is deprecated in ROME, a new `Resource` property has been introduced to the `FeedEntryMessageSource`.
|
||||
|
||||
See <<feed>> for more information.
|
||||
|
||||
|
||||
==== File Changes
|
||||
|
||||
The new `FileHeaders.RELATIVE_PATH` Message header has been introduced to represent relative path in the `FileReadingMessageSource`.
|
||||
|
||||
The tail adapter now supports `idleEventInterval` to emit events when there is no data in the file during that period.
|
||||
|
||||
The flush predicates for the `FileWritingMessageHandler` now have an additional parameter.
|
||||
|
||||
The file outbound channel adapter and gateway (`FileWritingMessageHandler`) now support the `REPLACE_IF_MODIFIED` `FileExistsMode`.
|
||||
|
||||
They also now support setting file permissions on the newly written file.
|
||||
|
||||
A new `FileSystemMarkerFilePresentFileListFilter` is now available; see <<file-incomplete>> for more information.
|
||||
|
||||
The `FileSplitter` now provides a `firstLineAsHeader` option to carry the first line of content as a header in the messages emitted for the remaining lines.
|
||||
|
||||
See <<files>> for more information.
|
||||
|
||||
==== (S)FTP Changes
|
||||
|
||||
The Inbound Channel Adapters now have a property `max-fetch-size` which is used to limit the number of files fetched during a poll when there are no files currently in the local directory.
|
||||
They also are configured with a `FileSystemPersistentAcceptOnceFileListFilter` in the `local-filter` by default.
|
||||
|
||||
You can also provide a custom `DirectoryScanner` implementation to Inbound Channel Adapters via the newly introduced `scanner` attribute.
|
||||
|
||||
The regex and pattern filters can now be configured to always pass directories.
|
||||
This can be useful when using recursion in the outbound gateways.
|
||||
|
||||
All the Inbound Channel Adapters (streaming and synchronization-based) now use an appropriate `AbstractPersistentAcceptOnceFileListFilter` implementation by default to prevent remote files duplicate downloads.
|
||||
|
||||
The FTP and SFTP outbound gateways now support the `REPLACE_IF_MODIFIED` `FileExistsMode` when fetching remote files.
|
||||
|
||||
The (S)FTP streaming inbound channel adapters now add remote file information in a message header.
|
||||
|
||||
The FTP and SFTP outbound channel adapters, as well as `PUT` command of the outbound gateways, now support `InputStream` as `payload`, too.
|
||||
|
||||
The inbound channel adapters now can build file tree locally using a newly introduced `RecursiveDirectoryScanner`.
|
||||
See `scanner` option for injection.
|
||||
Also these adapters can now be switched to the `WatchService` instead.
|
||||
|
||||
The `NLST` command has been added to the `AbstractRemoteFileOutboundGateway` to perform only list files names remote command.
|
||||
|
||||
The `FtpOutboundGateway` can now be supplied with `workingDirExpression` to change the FTP client working directory for the current request message.
|
||||
|
||||
The `RemoteFileTemplate` is supplied now with the `invoke(OperationsCallback<F, T> action)` to perform several `RemoteFileOperations` calls in the scope of the same, thread-bounded, `Session`.
|
||||
|
||||
New filters for detecting incomplete remote files are now provided.
|
||||
|
||||
The `FtpOutboundGateway` and `SftpOutboundGateway` now support an option to remove the remote file after a successful transfer using the `GET` or `MGET` commands.
|
||||
|
||||
See <<ftp>> and <<sftp>> for more information.
|
||||
|
||||
==== Integration Properties
|
||||
|
||||
Since _version 4.3.2_ a new `spring.integration.readOnly.headers` global property has been added to customize the list of headers which should not be copied to a newly created `Message` by the `MessageBuilder`.
|
||||
|
||||
See <<global-properties>> for more information.
|
||||
|
||||
==== Stream Changes
|
||||
|
||||
There is a new option on the `CharacterStreamReadingMessageSource` to allow it to be used to "pipe" stdin and publish an application event when the pipe is closed.
|
||||
|
||||
See <<stream-reading>> for more information.
|
||||
|
||||
==== Barrier Changes
|
||||
|
||||
The `BarrierMessageHandler` now supports a discard channel to which late-arriving trigger messages are sent.
|
||||
|
||||
See <<barrier>> for more information.
|
||||
|
||||
==== AMQP Changes
|
||||
|
||||
The AMQP outbound endpoints now support setting a delay expression for when using the RabbitMQ Delayed Message Exchange plugin.
|
||||
|
||||
The inbound endpoints now support the Spring AMQP `DirectMessageListenerContainer`.
|
||||
|
||||
Pollable AMQP-backed channels now block the poller thread for the poller's configured `receiveTimeout` (default 1 second).
|
||||
|
||||
Headers, such as `contentType` that are added to message properties by the message converter are now used in the final message; previously, it depended on the converter type as to which headers/message properties appeared in the final message.
|
||||
To override headers set by the converter, set the `headersMappedLast` property to `true`.
|
||||
|
||||
See <<amqp>> for more information.
|
||||
|
||||
==== HTTP Changes
|
||||
|
||||
The `DefaultHttpHeaderMapper.userDefinedHeaderPrefix` property is now an empty string by default instead of `X-`.
|
||||
|
||||
See <<http-header-mapping>> for more information.
|
||||
|
||||
==== MQTT Changes
|
||||
|
||||
Inbound messages are now mapped with headers `RECEIVED_TOPIC`, `RECEIVED_QOS` and `RECEIVED_RETAINED` to avoid inadvertent propagation to outbound messages when an application is relaying messages.
|
||||
|
||||
The outbound channel adapter now supports expressions for the topic, qos and retained properties; the defaults remain the same.
|
||||
|
||||
See <<mqtt>> for more information.
|
||||
|
||||
==== STOMP Changes
|
||||
|
||||
The STOMP module has been changed to use `ReactorNettyTcpStompClient`, based on the Project Reactor `3.1` and `reactor-netty` extension.
|
||||
The `Reactor2TcpStompSessionManager` has been renamed to the `ReactorNettyTcpStompSessionManager` according to the `ReactorNettyTcpStompClient` foundation.
|
||||
|
||||
See <<stomp>> for more information.
|
||||
|
||||
==== Web Services Changes
|
||||
|
||||
- The `WebServiceOutboundGateway` s can now be supplied with an externally configured `WebServiceTemplate` instances.
|
||||
|
||||
- The `DefaultSoapHeaderMapper` can now map a `javax.xml.transform.Source` user-defined header to a SOAP header element.
|
||||
|
||||
- Simple WebService Inbound and Outbound gateways can now deal with the complete `WebServiceMessage` as a `payload`, allowing the manipulation of MTOM attachments.
|
||||
|
||||
See <<ws>> for more information.
|
||||
|
||||
==== Redis Changes
|
||||
|
||||
The `RedisStoreWritingMessageHandler` is supplied now with additional String-based setters for SpEL expressions - for convenience with Java configuration.
|
||||
The `zsetIncrementExpression` can now be configured on the `RedisStoreWritingMessageHandler`, as well.
|
||||
In addition this property has been changed from `true` to `false` since `INCR` option on `ZADD` Redis command is optional.
|
||||
|
||||
The `RedisInboundChannelAdapter` can now be supplied with an `Executor` for executing Redis listener invokers.
|
||||
In addition the received messages now contains a `RedisHeaders.MESSAGE_SOURCE` header to indicate the source of the message - topic or pattern.
|
||||
|
||||
See <<redis>> for more information.
|
||||
|
||||
==== TCP Changes
|
||||
|
||||
A new `ThreadAffinityClientConnectionFactory` is provided that binds TCP connections to threads.
|
||||
|
||||
You can now configure the TCP connection factories to support `PushbackInputStream` s, allowing deserializers to "unread" (push back) bytes after "reading ahead".
|
||||
|
||||
A `ByteArrayElasticRawDeserializer` has been added without `maxMessageSize` control and buffer incoming data as needed.
|
||||
|
||||
See <<ip>> for more information.
|
||||
|
||||
==== Gemfire Changes
|
||||
|
||||
The `GemfireMetadataStore` now implements `ListenableMetadataStore`, allowing users to listen to cache events by providing `MetadataStoreListener` instances to the store.
|
||||
|
||||
See <<gemfire>> for more information.
|
||||
|
||||
==== Jdbc Changes
|
||||
|
||||
The `JdbcMessageChannelStore` now provides setter for the `ChannelMessageStorePreparedStatementSetter` allowing users to customize a message insertion in the store.
|
||||
|
||||
The `ExpressionEvaluatingSqlParameterSourceFactory` now provides setter for the sqlParameterTypes allowing users to customize sql types of the parameters.
|
||||
|
||||
See <<jdbc>> for more information.
|
||||
|
||||
|
||||
==== Metrics Changes
|
||||
|
||||
http://micrometer.io/[Micrometer] application monitoring is now supported (since _version 5.0.2_).
|
||||
See <<micrometer-integration>> for more information.
|
||||
|
||||
IMPORTANT: Changes were made to the Micrometer `Meters` in _version 5.0.3_ to make them more suitable for use in dimensional systems.
|
||||
Further changes were made in 5.0.4; if using Micrometer, a minimum of version 5.0.4 is recommended.
|
||||
|
||||
|
||||
==== @EndpointId Annotations
|
||||
|
||||
Introduced in _version 5.0.4_, this annotation provides control over bean naming when using Java configuration.
|
||||
See <<endpoint-bean-names>> for more information.
|
||||
@@ -2,6 +2,8 @@
|
||||
== Change History
|
||||
|
||||
// BE SURE TO PRECEDE ALL include:: with a blank line - see https://github.com/asciidoctor/asciidoctor/issues/1297
|
||||
include::./changes-4.3-5.0.adoc[]
|
||||
|
||||
include::./changes-4.2-4.3.adoc[]
|
||||
|
||||
include::./changes-4.1-4.2.adoc[]
|
||||
|
||||
@@ -1,317 +1,17 @@
|
||||
[[whats-new]]
|
||||
== What's new in Spring Integration 5.0?
|
||||
|
||||
== What's new in Spring Integration 5.1?
|
||||
|
||||
This chapter provides an overview of the new features and improvements that have been introduced with Spring
|
||||
Integration 5.0.
|
||||
If you are interested in more details, please see the Issue Tracker tickets that were resolved as part of the 5.0
|
||||
development process.
|
||||
Integration `5.1`.
|
||||
If you are interested in more details, please see the Issue Tracker tickets that were resolved as part of the 5.1 development process.
|
||||
|
||||
[[x5.0-new-components]]
|
||||
[[x5.1-new-components]]
|
||||
=== New Components
|
||||
|
||||
[[x5.1-general]]
|
||||
=== General Changes
|
||||
|
||||
==== Java DSL
|
||||
|
||||
The separate https://github.com/spring-projects/spring-integration-java-dsl[Spring Integration Java DSL] project has now been merged into the core Spring Integration project.
|
||||
The `IntegrationComponentSpec` implementations for channel adapters and gateways are distributed to their specific modules.
|
||||
See <<java-dsl>> for more information about Java DSL support.
|
||||
Also see the https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-4.3-to-5.0-Migration-Guide#java-dsl[4.3 to 5.0 Migration Guide] for the required steps to move to Spring Integration 5.0.
|
||||
|
||||
==== Testing Support
|
||||
|
||||
A new Spring Integration Test Framework has been created to assist with testing Spring Integration applications.
|
||||
Now, with the `@SpringIntegrationTest` annotation on test class and `MockIntegration` factory you can make your JUnit tests for integration flows somewhat easier.
|
||||
|
||||
See <<testing>> for more information.
|
||||
|
||||
==== MongoDB Outbound Gateway
|
||||
|
||||
The new `MongoDbOutboundGateway` allows you to make queries to the database on demand by sending a message to its request channel.
|
||||
|
||||
See <<mongodb-outbound-gateway>> for more information.
|
||||
|
||||
==== WebFlux Gateways and Channel Adapters
|
||||
|
||||
The new WebFlux support module has been introduced for Spring WebFlux Framework gateways and channel adapters.
|
||||
|
||||
See <<webflux>> for more information.
|
||||
|
||||
==== Content Type Conversion
|
||||
|
||||
Now that we use the new `InvocableHandlerMethod` -based infrastructure for service method invocations, we can perform `contentType` conversion from payload to target method argument.
|
||||
|
||||
See <<content-type-conversion>> for more information.
|
||||
|
||||
==== ErrorMessagePublisher and ErrorMessageStrategy
|
||||
|
||||
The `ErrorMessagePublisher` and the `ErrorMessageStrategy` are provided for creating `ErrorMessage` instances.
|
||||
|
||||
See <<namespace-errorhandler>> for more information.
|
||||
|
||||
==== JDBC Metadata Store
|
||||
|
||||
A JDBC implementation of `MetadataStore` implementation is now provided.
|
||||
This is useful when it is necessary to ensure transactional boundaries for metadata.
|
||||
|
||||
See <<jdbc-metadata-store>> for more information.
|
||||
|
||||
[[x5.0-general]]
|
||||
=== General Changes
|
||||
|
||||
Spring Integration is now fully based on Spring Framework `5.0` and Project Reactor `3.1`.
|
||||
Previous Project Reactor versions are no longer supported.
|
||||
|
||||
==== Core Changes
|
||||
|
||||
The `@Poller` annotation now has the `errorChannel` attribute for easier configuration of the underlying `MessagePublishingErrorHandler`.
|
||||
|
||||
See <<annotations>> for more information.
|
||||
|
||||
All the request-reply endpoints (based on `AbstractReplyProducingMessageHandler`) can now start transaction and, therefore, make the whole downstream flow transactional.
|
||||
|
||||
See <<tx-handle-message-advice>> for more information.
|
||||
|
||||
The `SmartLifecycleRoleController` now provides methods to obtain status of endpoints in roles.
|
||||
|
||||
See <<endpoint-roles>> for more information.
|
||||
|
||||
POJO methods are now invoked using an `InvocableHandlerMethod` by default, but can be configured to use SpEL as before.
|
||||
|
||||
See <<pojo-invocation>> for more information.
|
||||
|
||||
When targeting POJO methods as message handlers, one of the service methods can now be marked with the `@Default` annotation to provide a fallback mechanism for non-matched conditions.
|
||||
|
||||
See <<service-activator-namespace>> for more information.
|
||||
|
||||
A simple `PassThroughTransactionSynchronizationFactory` is provided to always store a polled message in the current transaction context.
|
||||
That message is used as a `failedMessage` property of the `MessagingException` which wraps a raw exception thrown during transaction completion.
|
||||
|
||||
See <<transaction-synchronization>> for more information.
|
||||
|
||||
The aggregator expression-based `ReleaseStrategy` now evaluates the expression against the `MessageGroup` instead of just the collection of `Message<?>`.
|
||||
|
||||
See <<aggregator-spel>> for more information.
|
||||
|
||||
The `ObjectToMapTransformer` can now be supplied with a customised `JsonObjectMapper`.
|
||||
|
||||
See <<aggregator-spel>> for more information.
|
||||
|
||||
The `@GlobalChannelInterceptor` annotation and `<int:channel-interceptor>` now support negative patterns (via `!` prepending) for component names matching.
|
||||
|
||||
See <<global-channel-configuration-interceptors>> for more information.
|
||||
|
||||
A new `OnFailedToAcquireMutexEvent` is emitted now via `DefaultLeaderEventPublisher` by the `LockRegistryLeaderInitiator`, when candidate is failed to acquire the lock.
|
||||
|
||||
See <<leadership-event-handling>> for more information.
|
||||
|
||||
==== Gateway Changes
|
||||
|
||||
The gateway now correctly sets the `errorChannel` header when the gateway method has a `void` return type and an error channel is provided.
|
||||
Previously, the header was not populated.
|
||||
This had the effect that synchronous downstream flows (running on the calling thread) would send the exception to the configured channel but an exception on an async downstream flow would be sent to the default `errorChannel` instead.
|
||||
|
||||
The `RequestReplyExchanger` interface now has a `throws MessagingException` clause to meet all the proposed messages exchange contract.
|
||||
|
||||
The request and reply timeouts can now be specified as SpEL expressions.
|
||||
|
||||
See <<gateway>> for more information.
|
||||
|
||||
==== Aggregator Performance Changes
|
||||
|
||||
Aggregators now use a `SimpleSequenceSizeReleaseStrategy` by default, which is more efficient, especially with large groups.
|
||||
Empty groups are now scheduled for removal after `empty-group-min-timeout`.
|
||||
|
||||
See <<aggregator>> for more information.
|
||||
|
||||
==== Splitter Changes
|
||||
|
||||
The Splitter component now can handle and split Java `Stream` and Reactive Streams `Publisher` objects.
|
||||
If the output channel is a `ReactiveStreamsSubscribableChannel`, the `AbstractMessageSplitter` builds a `Flux` for subsequent iteration instead of a regular `Iterator` independent of object being split.
|
||||
In addition, `AbstractMessageSplitter` provides `protected obtainSizeIfPossible()` methods to allow the determination of the size of the `Iterable` and `Iterator` objects if that is possible.
|
||||
|
||||
See <<splitter>> for more information.
|
||||
|
||||
==== JMS Changes
|
||||
|
||||
Previously, Spring Integration JMS XML configuration used a default bean name `connectionFactory` for the JMS Connection Factory, allowing the property to be omitted from component definitions.
|
||||
It has now been renamed to `jmsConnectionFactory`, which is the bean name used by Spring Boot to auto-configure the JMS Connection Factory bean.
|
||||
|
||||
If your application is relying on the previous behavior, rename your `connectionFactory` bean to `jmsConnectionFactory`, or specifically configure your components to use your bean using its current name.
|
||||
|
||||
See <<jms>> for more information.
|
||||
|
||||
==== Mail Changes
|
||||
|
||||
Some inconsistencies with rendering IMAP mail content have been resolved.
|
||||
|
||||
See <<imap-format-important, the note in the Mail-Receiving Channel Adapter Section>> for more information.
|
||||
|
||||
==== Feed Changes
|
||||
|
||||
Instead of the `com.rometools.fetcher.FeedFetcher`, which is deprecated in ROME, a new `Resource` property has been introduced to the `FeedEntryMessageSource`.
|
||||
|
||||
See <<feed>> for more information.
|
||||
|
||||
|
||||
==== File Changes
|
||||
|
||||
The new `FileHeaders.RELATIVE_PATH` Message header has been introduced to represent relative path in the `FileReadingMessageSource`.
|
||||
|
||||
The tail adapter now supports `idleEventInterval` to emit events when there is no data in the file during that period.
|
||||
|
||||
The flush predicates for the `FileWritingMessageHandler` now have an additional parameter.
|
||||
|
||||
The file outbound channel adapter and gateway (`FileWritingMessageHandler`) now support the `REPLACE_IF_MODIFIED` `FileExistsMode`.
|
||||
|
||||
They also now support setting file permissions on the newly written file.
|
||||
|
||||
A new `FileSystemMarkerFilePresentFileListFilter` is now available; see <<file-incomplete>> for more information.
|
||||
|
||||
The `FileSplitter` now provides a `firstLineAsHeader` option to carry the first line of content as a header in the messages emitted for the remaining lines.
|
||||
|
||||
See <<files>> for more information.
|
||||
|
||||
==== (S)FTP Changes
|
||||
|
||||
The Inbound Channel Adapters now have a property `max-fetch-size` which is used to limit the number of files fetched during a poll when there are no files currently in the local directory.
|
||||
They also are configured with a `FileSystemPersistentAcceptOnceFileListFilter` in the `local-filter` by default.
|
||||
|
||||
You can also provide a custom `DirectoryScanner` implementation to Inbound Channel Adapters via the newly introduced `scanner` attribute.
|
||||
|
||||
The regex and pattern filters can now be configured to always pass directories.
|
||||
This can be useful when using recursion in the outbound gateways.
|
||||
|
||||
All the Inbound Channel Adapters (streaming and synchronization-based) now use an appropriate `AbstractPersistentAcceptOnceFileListFilter` implementation by default to prevent remote files duplicate downloads.
|
||||
|
||||
The FTP and SFTP outbound gateways now support the `REPLACE_IF_MODIFIED` `FileExistsMode` when fetching remote files.
|
||||
|
||||
The (S)FTP streaming inbound channel adapters now add remote file information in a message header.
|
||||
|
||||
The FTP and SFTP outbound channel adapters, as well as `PUT` command of the outbound gateways, now support `InputStream` as `payload`, too.
|
||||
|
||||
The inbound channel adapters now can build file tree locally using a newly introduced `RecursiveDirectoryScanner`.
|
||||
See `scanner` option for injection.
|
||||
Also these adapters can now be switched to the `WatchService` instead.
|
||||
|
||||
The `NLST` command has been added to the `AbstractRemoteFileOutboundGateway` to perform only list files names remote command.
|
||||
|
||||
The `FtpOutboundGateway` can now be supplied with `workingDirExpression` to change the FTP client working directory for the current request message.
|
||||
|
||||
The `RemoteFileTemplate` is supplied now with the `invoke(OperationsCallback<F, T> action)` to perform several `RemoteFileOperations` calls in the scope of the same, thread-bounded, `Session`.
|
||||
|
||||
New filters for detecting incomplete remote files are now provided.
|
||||
|
||||
The `FtpOutboundGateway` and `SftpOutboundGateway` now support an option to remove the remote file after a successful transfer using the `GET` or `MGET` commands.
|
||||
|
||||
See <<ftp>> and <<sftp>> for more information.
|
||||
|
||||
==== Integration Properties
|
||||
|
||||
Since _version 4.3.2_ a new `spring.integration.readOnly.headers` global property has been added to customize the list of headers which should not be copied to a newly created `Message` by the `MessageBuilder`.
|
||||
|
||||
See <<global-properties>> for more information.
|
||||
|
||||
==== Stream Changes
|
||||
|
||||
There is a new option on the `CharacterStreamReadingMessageSource` to allow it to be used to "pipe" stdin and publish an application event when the pipe is closed.
|
||||
|
||||
See <<stream-reading>> for more information.
|
||||
|
||||
==== Barrier Changes
|
||||
|
||||
The `BarrierMessageHandler` now supports a discard channel to which late-arriving trigger messages are sent.
|
||||
|
||||
See <<barrier>> for more information.
|
||||
|
||||
==== AMQP Changes
|
||||
|
||||
The AMQP outbound endpoints now support setting a delay expression for when using the RabbitMQ Delayed Message Exchange plugin.
|
||||
|
||||
The inbound endpoints now support the Spring AMQP `DirectMessageListenerContainer`.
|
||||
|
||||
Pollable AMQP-backed channels now block the poller thread for the poller's configured `receiveTimeout` (default 1 second).
|
||||
|
||||
Headers, such as `contentType` that are added to message properties by the message converter are now used in the final message; previously, it depended on the converter type as to which headers/message properties appeared in the final message.
|
||||
To override headers set by the converter, set the `headersMappedLast` property to `true`.
|
||||
|
||||
See <<amqp>> for more information.
|
||||
|
||||
==== HTTP Changes
|
||||
|
||||
The `DefaultHttpHeaderMapper.userDefinedHeaderPrefix` property is now an empty string by default instead of `X-`.
|
||||
|
||||
See <<http-header-mapping>> for more information.
|
||||
|
||||
==== MQTT Changes
|
||||
|
||||
Inbound messages are now mapped with headers `RECEIVED_TOPIC`, `RECEIVED_QOS` and `RECEIVED_RETAINED` to avoid inadvertent propagation to outbound messages when an application is relaying messages.
|
||||
|
||||
The outbound channel adapter now supports expressions for the topic, qos and retained properties; the defaults remain the same.
|
||||
|
||||
See <<mqtt>> for more information.
|
||||
|
||||
==== STOMP Changes
|
||||
|
||||
The STOMP module has been changed to use `ReactorNettyTcpStompClient`, based on the Project Reactor `3.1` and `reactor-netty` extension.
|
||||
The `Reactor2TcpStompSessionManager` has been renamed to the `ReactorNettyTcpStompSessionManager` according to the `ReactorNettyTcpStompClient` foundation.
|
||||
|
||||
See <<stomp>> for more information.
|
||||
|
||||
==== Web Services Changes
|
||||
|
||||
- The `WebServiceOutboundGateway` s can now be supplied with an externally configured `WebServiceTemplate` instances.
|
||||
|
||||
- The `DefaultSoapHeaderMapper` can now map a `javax.xml.transform.Source` user-defined header to a SOAP header element.
|
||||
|
||||
- Simple WebService Inbound and Outbound gateways can now deal with the complete `WebServiceMessage` as a `payload`, allowing the manipulation of MTOM attachments.
|
||||
|
||||
See <<ws>> for more information.
|
||||
|
||||
==== Redis Changes
|
||||
|
||||
The `RedisStoreWritingMessageHandler` is supplied now with additional String-based setters for SpEL expressions - for convenience with Java configuration.
|
||||
The `zsetIncrementExpression` can now be configured on the `RedisStoreWritingMessageHandler`, as well.
|
||||
In addition this property has been changed from `true` to `false` since `INCR` option on `ZADD` Redis command is optional.
|
||||
|
||||
The `RedisInboundChannelAdapter` can now be supplied with an `Executor` for executing Redis listener invokers.
|
||||
In addition the received messages now contains a `RedisHeaders.MESSAGE_SOURCE` header to indicate the source of the message - topic or pattern.
|
||||
|
||||
See <<redis>> for more information.
|
||||
|
||||
==== TCP Changes
|
||||
|
||||
A new `ThreadAffinityClientConnectionFactory` is provided that binds TCP connections to threads.
|
||||
|
||||
You can now configure the TCP connection factories to support `PushbackInputStream` s, allowing deserializers to "unread" (push back) bytes after "reading ahead".
|
||||
|
||||
A `ByteArrayElasticRawDeserializer` has been added without `maxMessageSize` control and buffer incoming data as needed.
|
||||
|
||||
See <<ip>> for more information.
|
||||
|
||||
==== Gemfire Changes
|
||||
|
||||
The `GemfireMetadataStore` now implements `ListenableMetadataStore`, allowing users to listen to cache events by providing `MetadataStoreListener` instances to the store.
|
||||
|
||||
See <<gemfire>> for more information.
|
||||
|
||||
==== Jdbc Changes
|
||||
|
||||
The `JdbcMessageChannelStore` now provides setter for the `ChannelMessageStorePreparedStatementSetter` allowing users to customize a message insertion in the store.
|
||||
|
||||
The `ExpressionEvaluatingSqlParameterSourceFactory` now provides setter for the sqlParameterTypes allowing users to customize sql types of the parameters.
|
||||
|
||||
See <<jdbc>> for more information.
|
||||
|
||||
|
||||
==== Metrics Changes
|
||||
|
||||
http://micrometer.io/[Micrometer] application monitoring is now supported (since _version 5.0.2_).
|
||||
See <<micrometer-integration>> for more information.
|
||||
|
||||
IMPORTANT: Changes were made to the Micrometer `Meters` in _version 5.0.3_ to make them more suitable for use in dimensional systems.
|
||||
Further changes were made in 5.0.4; if using Micrometer, a minimum of version 5.0.4 is recommended.
|
||||
|
||||
|
||||
==== @EndpointId Annotations
|
||||
|
||||
Introduced in _version 5.0.4_, this annotation provides control over bean naming when using Java configuration.
|
||||
See <<endpoint-bean-names>> for more information.
|
||||
The `IntegrationFlowContext` is now an interface and `IntegrationFlowRegistration` is an inner interface of the `IntegrationFlowContext`.
|
||||
|
||||
Reference in New Issue
Block a user