Commit Graph

2181 Commits

Author SHA1 Message Date
Artem Bilan
90ac259da7 INT-4520 Make IntegrationGraphServer customizable (#2608)
* INT-4520 Make IntegrationGraphServer customizable

JIRA: https://jira.spring.io/browse/INT-4520

* * Polishing according PR comments
2018-10-24 15:02:52 -04:00
Gary Russell
eed5fe7a88 Extensible MicrometerMetricsCaptor and polishing
- change `loadCaptor` to return any existing captor
- make builders and facades protected to allow subclassing
- change `AbstractMeter.getMeter()` to use generics
- add test case demonstrating meter name changes
- docs

* Polishing - PR Comments, and rebase
2018-10-22 19:58:54 -04:00
Artem Bilan
1d1abf257d Polishing for PollingLifecycleTests 2018-10-19 16:02:50 -04:00
Gary Russell
7aa8489279 Fix race in PollingLifecycleTests 2018-10-19 15:42:31 -04:00
Gary Russell
23ebe56838 INT-4530: Remove Meters
JIRA: https://jira.spring.io/browse/INT-4530

- implement `DisposableBean` in all meter-aware components
- remove meters in `destroy()`
- manually destroy annotation components created by `registerSingleton()`
  - changing these beans to register as bean definitions caused some subtle
    initialization side-effects; given we are post-RC, I felt it was too late
    to make such a large change
  - also CPXAC is not a `GenericApplicationContext`
  - hence a bean is registered to destroy them manually

* Rebase; Polishing - PR Comments
2018-10-19 15:00:04 -04:00
Artem Bilan
e3ce37ca36 INT-4544: Allow runtime MBeans (un)registered (#2601)
* INT-4544: Allow runtime MBeans (un)registered

JIRA: https://jira.spring.io/browse/INT-4544

* Fix `SourcePollingChannelAdapterFactoryBean` to register an
`outputChannelName` into the `SourcePollingChannelAdapter` for late
binding, especially in case of dynamic `IntegrationFlow` registrations.
This must be back-ported to `5.0.x`
* Implement `DestructionAwareBeanPostProcessor` in the
`IntegrationMBeanExporter` for the runtime beans tracking, e.g. via
dynamic `IntegrationFlow` registrations
* Refactor `IntegrationMBeanExporter` for static and dynamic beans
registration and destruction
* Remove unused properties; introduce some new for tracking beans and
their relationship

* * Move `IntegrationMBeanExporter.registerProducer()` after
`postProcessAfterInitialization()`
* Refactor JMX test configurations to reuse MBeanServer as much as
possible and destroy the server whenever it is necessary

* * More JMX tests polishing

* * And more JMX tests polishing

* * `try...catch` in the `IntegrationMBeanExporter.postProcessAfterInitialization()`
to avoid breaking changes for the current GA phase
* Do not unregister those MBeans explicitly which weren't created at
runtime

* * Log ObjectNames in the `MBeanExporterIntegrationTests`

* * Fix `MessageMetricsAdviceTests` to rely on the application context
* Do not use a cst in the `StandardIntegrationFlowContext` for
`BeanFactory`, but an explicit `BeanDefinitionRegistry`
* Extract targets from proxies in the
`IntegrationMBeanExporter.postProcessAfterInitialization()`
* Remove logging in the `MBeanExporterIntegrationTests`

* * Fix `NotificationListeningMessageProducerTests` to reuse existing `MBeanServer`

* * Change JMX `domain` in the `DslMBeanTests` to `dsl` do not clash with
similar in the `foo` in the `MessageSourceTests`
* Use `MBeanServer` bean in the `Int2307Tests`
* Use JUnit 5ctor injection injection in the `MessageMetricsAdviceTests`

* * Fix JMX tests do not reuse existing `MBeanServer` and make them rely
on the server provided by the managed `MBeanServerFactoryBean` which
destroys a server on application context close
* Fix `StoredProcJmxManagedBeanTests-context.xml` to use `MBeanServer`
from the `<context:mbean-server>`
2018-10-19 09:51:25 -04:00
Artem Bilan
40ba72b84a INT-4545: Fix RPMHWrapper registration for `@SA
JIRA: https://jira.spring.io/browse/INT-4545

Improve the logic in the `AbstractMethodAnnotationPostProcessor` to
check for existing `MessageHandler` and be sure that we need to register
a `ReplyProducingMessageHandlerWrapper` bean

**Cherry-pick to 5.0.x**
2018-10-19 09:10:47 -04:00
Artem Bilan
0f5cfd4314 INT-4542: CorrMH: Use popSequenceDetails properly (#2591)
* INT-4542: CorrMH: Use popSequenceDetails properly

JIRA: https://jira.spring.io/browse/INT-4542

Perform a `MessageBuilder.popSequenceDetails()` for those
`MessageGroupProcessor` results which are not `Message`
or `Collection<Message>`

**Cherry-pick to 5.0.x**

* * Add `AbstractCorrelatingMessageHandler.popSequenceDetails` property

* * Rename property to just a `popSequence`

* * Fix JavaDocs on the `AbstractCorrelatingMessageHandler.setPopSequence()`
* Fix Docs typos and language
* finish the `RouterTests.testNestedScatterGather()`
2018-10-10 14:03:40 -04:00
Artem Bilan
ddcfa25fc4 INT-4543: JacksonJsonObjectMapper: fix toJsonNode (#2592)
* INT-4543: JacksonJsonObjectMapper: fix toJsonNode

JIRA: https://jira.spring.io/browse/INT-4543

When inbound payload is type of `String`, `byte[]`, `File`, `URL`,
`InputStream` or `Reader`, we have to use an `ObjectMapper.readTree()`
function.
For all other types the `valueToTree()` should be used as a fallback

**Cherry-pick to 5.0.x**

* * Fallback to the `valueToTree()` if not valid JSON

* * Fallback to `valueToTree()` only for `String` and `byte[]`
2018-10-10 12:20:13 -04:00
Artem Bilan
7176690e4d Improve functions support
* Add `functions-support.adoc` chapter
* Add more tests
* Improve `InboundChannelAdapterAnnotationPostProcessor` to support
Kotlin `Function0`
* Add `FunctionsTests.kt`
* Reformat Kotlin classes to use tabs
* Upgrade to Kotlin `1.2.71`

* Add `What's New` bullet

Doc Polishing
2018-10-09 12:29:34 -04:00
Gary Russell
e7bc060e55 INT-4541: Fix Reactive MessagingGateway Errors
JIRA: https://jira.spring.io/browse/INT-4541

Add test case to reproduce.

The gateway correctly sets up the `errorChannel` header so that a downstream
`MPEH` will send exceptions back to the gateway, but the `map()` function
did not check for an error message.

Check for an error message and throw the payload so that the `onErrorResume`
will route to the error channel.
2018-10-08 17:42:29 -04:00
Artem Bilan
9ae0eb2dbc INT-4540: Use MessageHeaders in GenericHandler (#2589)
* INT-4540: Use MessageHeaders in GenericHandler

JIRA: https://jira.spring.io/browse/INT-4540

For better end-user experience use a `MessageHeaders` in the
`GenericHandler` instead of plain `Map<String, Object>`

* * Fix `IntegrationFlowEventsTests`
2018-10-08 16:26:56 -04:00
Artem Bilan
716494c7fb INT-4538: Fix Splitter for ArrayNode.size()
JIRA: https://jira.spring.io/browse/INT-4538

* Add support for Jackson `TreeNode.size()` in the `AbstractMessageSplitter`
* Add overloaded `Transformers.toJson(ObjectToJsonTransformer.ResultType)`
* Modify test to verify Jackson `ArrayNode` use-case with the splitter
and aggregator

**Cherry-pick to 5.0.x**
2018-10-08 10:00:08 -04:00
Artem Bilan
c4d6cf2b50 INT-4539: Fix Java DSL for prototype beans
JIRA: https://jira.spring.io/browse/INT-4539

The `IntegrationFlowBeanPostProcessor` doesn't check for prototype beans
and just override them in the application context with the singletons

* Since we can't in the DSL understand if provided object is a prototype
or not, we try to check for its bean definition by possible bean name.
Use `NamedComponent` for possible bean name to check.
* Remove `final` from the `IntegrationComponentSpec.get()` since its
result is not visible for CGI proxies when it is declared as a `@Bean`
and subsequent `getObject()` produces a new internal object
* Verify prototype beans with new test in the `IntegrationFlowTests`

**Cherry-pick to 5.0.x**
2018-10-06 19:18:41 -04:00
Artem Bilan
2df71fba30 INT-4537: Fix RSConsumer for MockIntegrationCtx
JIRA: https://jira.spring.io/browse/INT-4537

Fixes spring-projects/spring-integration#2582

* Rename `ReactiveStreamsConsumer.messageHandler` property to the
`handler` for consistency with other `IntegrationConsumer` s
* Do not wrap `Subscriber` into the `MessageHandler` if that one is
already a `MessageHandler`
* Fix `MockIntegrationContext` for the logic around `ReactiveStreamsConsumer`
where it is not enough just replace a `handler`, but we also need to do
that with the `subscriber`.
Luckily the `MockMessageHandler` is also a Reactive `Subscriber`
* Clean up `MockIntegrationContext.beans` in the end of `resetBeans()`
* Improve `testing.adoc`

**Cherry-pick to 5.0.x**
2018-10-05 14:39:35 -04:00
Gary Russell
a05004ae38 INT-4536: Support Kafka Tombstones
JIRA: https://jira.spring.io/browse/INT-4536

Represent `@KafkaNull` as `null` when `@Payload(required = false)`.
2018-10-04 13:51:18 -04:00
Artem Bilan
8b4d1e66e5 Allow Functions as Service Activators (#2575)
* Allow Functions as Service Activators

* Fix `MessagingMethodInvokerHelper` to extract canonical method for the
`Function` and `Consumer` beans
* Demonstrate in test how `Function` and `Consumer` can be configured
with the Messaging annotations

* Don't mutate method argument
2018-10-02 11:37:34 -04:00
Artem Bilan
585258373e Add IntegrationFlowDefinition.nullChannel() (#2555)
* Add `IntegrationFlowDefinition.nullChannel()`

When a `NullChannel` is used in the middle of the flow, it may be not so
obvious why our flow is stopped after accidentally added the next
endpoint

* For convenient add a terminal `nullChannel()` operator into the
`IntegrationFlowDefinition`

* * Add WARN about `NullChannel` subscription from the endpoints
2018-09-17 11:31:26 -04:00
Artem Bilan
6c379d7199 Fix a logic in the IntFlowDef.toReactivePublisher (#2553)
* Fix a logic in the IntFlowDef.toReactivePublisher

* We may consider to start a `Publisher<Message<?>>` just from one
channel.
So, and an implicit `bridge()` to meet and internal `IntegrationFlow`
 logic
* The `MessageChannelReference` and `FixedSubscriberChannelPrototype`
can't be converted to the reactive `Publisher`.
So, an implicit `bridge()` in between them and target `FluxMessageChannel`

NOTE: This maybe considered for back-port, but the workaround is
simple: just add extra `bridge()` after the mentioned channels

* * Allow `log()` before `toReactivePublisher()` and the same time fix
the problem with not resetted `implicitChannel` flag in the
`IntegrationFlowDefinition`
2018-09-17 10:50:29 -04:00
Artem Bilan
54094da76b INT-4523: Add DSL convert(Class<> cls) operator (#2556)
* INT-4523: Add DSL `convert(Class<> cls)` operator

JIRA: https://jira.spring.io/browse/INT-4523

* Change the `LambdaMessageProcessor` to rely on the `MessageConverter`
populated by the `IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME`
This way all the Lambda-based handlers are going to work the same way
as POJO-based via `MessagingMethodInvokerHelper`
* Add `convert(Class<P> payloadType)` EIP-operator to perform similar
to POJO-based method invocation argument conversion

* * Fix `LambdaMessageProcessorTests` to inject a
`ConfigurableCompositeMessageConverter` from the mocked `BeanFactory`
* Make a `mappingJackson2MessageConverter.setStrictContentTypeMatch(true)`
* Also obtain an `ObjectMapper` from the `Jackson2JsonObjectMapper`
which is configured with the scanned possible Jackson modules.
in the `ConfigurableCompositeMessageConverter` do not try to convert
all the potential content without an appropriate JSON content-type
header
2018-09-17 10:40:56 -04:00
Artem Bilan
27353ed393 Add Reactive mode for AbstractPollingEndpoint (#2429)
* Add Reactive mode for AbstractPollingEndpoint

* When `SourcePollingChannelAdapter.outputChannel` is a
`ReactiveStreamsSubscribableChannel`, use `Flux.generate()` for polling
* Refactor `AbstractPollingEndpoint` to remove redundant `Poller` class
in favor of lambda
* Extract `pollForMessage()` method to handle TX states instead of
`Poller` class previously

* * Rebase and fix conflicts

* Polishing for GatewayProxyFactoryBeanTests
2018-09-14 10:05:00 -04:00
Artem Bilan
02c8e0ade2 Ignore sporadic test failure: time-sensitive
https://build.spring.io/browse/INT-MASTER-1182/
2018-09-13 14:40:47 -04:00
Manuel Jordan Elera
cdf2ced153 GH-2559: Fix InboundChannelAdapter's javadoc
Resolves https://github.com/spring-projects/spring-integration/issues/2559

* Fixed minor typo that does not let generate the expected javadoc
for a attribute/method

**Cherry-pick to 5.0.x**
2018-09-06 14:07:45 -04:00
Artem Bilan
9e33395b9c Fix PollableChannels for Micrometer
* Add Micrometer metrics capture for the
`PollableAmqpChannel` and `PollableJmsChannel`
* Polishing and optimization for the `AbstractPollableChannel.receive()`

**Cherry-pick to 5.0.x**
2018-08-31 11:14:21 -04:00
Artem Bilan
e4fe39b20b Remove hide() from FluxMessageChannel
The Reactor Core has a fix for the https://github.com/reactor/reactor-core/issues/1290
so, we can simply remove a `hide()` call for the `publish()` in `Flux`
2018-08-30 12:46:14 -04:00
Gary Russell
075d237c04 INT-4527: Delayer Retries and Error Handling
JIRA: https://jira.spring.io/browse/INT-4527
Fixes https://github.com/spring-projects/spring-integration/issues/2543

- Add error handling within the scope of a transaction
- Add `retryDelay` and `maxAttempts`
- Include the delivery attempt header in the `ErrorMessage`
- Add `transactionalRelease()` methods to the DSL

Check context in `ContextRefreshedEvent`.

Complete test case; don't schedule for re-release after a successful send after a failure.

Use `identityHashCode` for deliveries map key - error flow might change the message `hashCode`.

Debug logging

Polishing; remove parameter from the `DelayerEndpointSpec.transactionalRelease()`

* Polishing some code style
2018-08-28 15:45:04 -04:00
Artem Bilan
68bccdc155 Increase receive timeouts in IntegrationFlowTests 2018-08-28 09:35:54 -04:00
Gary Russell
e6489abb52 INT-4526: Fix Channel Interceptor NonNullApi Call
JIRA: https://jira.spring.io/browse/INT-4526

- `Message<?>` cannot be null in `postReceive()`.

Polishing - PR Comments

* Polishing code style
* Fix `PollableJmsChannel`
* Increase receive timeout in the `PollableJmsChannel`
2018-08-27 17:07:14 -04:00
Gary Russell
df6674c2ec Fix DynamicPeriodicTrigger
- inconsistent use of internal `TimeUnit`
- `setPeriod()` applied the unit, but `getPeriod()` did not

This test failed...

```java
@Test
public void testTriggerConsistency() {
	final DynamicPeriodicTrigger trigger = new DynamicPeriodicTrigger(10, TimeUnit.SECONDS);
	trigger.setPeriod(trigger.getPeriod());
	assertThat(trigger.getPeriod(), equalTo(10_000));
}
```

Change the trigger to use `Duration` and deprecate the other methods.
2018-08-27 14:26:37 -04:00
Artem Bilan
aa371f59ff Ignore AggregatorTests.testAggPerfDefaultPartial
https://build.spring.io/browse/INT-MASTER-1165/

The test checks how much time have we spent for the process.
It's too hard to be precise in all the environment, especially on slow
CI servers

* Make some code style polishing in the `AggregatorTests`
2018-08-27 12:43:23 -04:00
Artem Bilan
d70df11975 PollerAdviceTests: synchronized list actions
https://build.spring.io/browse/INT-MASTERSPRING40-441

Even if we `stop()` a `SourcePollingChannelAdapter` that doesn't mean
that task-in-progress can't deliver its result to the source consumer.

* Wrap a list `add()` and iterator operations to avoid a
`ConcurrentModificationException`
2018-08-27 12:20:26 -04:00
Gary Russell
f4d5d84512 Fix DSL Flux Javadocs 2018-08-24 10:06:02 -04:00
Artem Bilan
9be9e63621 Upgrade to Spring AMQP 2.1 M2
* Add `@SuppressWarnings("serial")` for the `RequestMessageHolder`
* Use non-caching JMS CF for the Inbound endpoints in the `JmsTests`
* Make `AsyncGatewayTests extends ActiveMQMultiContextTests` to keep
embedded broker opened in between test methods
2018-08-20 17:35:48 -04:00
Artem Bilan
f9fe709881 Add Java DSL .fluxTransform(Function) operator (#2541)
* Add Java DSL `.fluxTransform(Function)` operator

For better interoperability with Reactor `Flux` from the
end-user perspective introduce an operator which could
call a target `Function` with integration data wrapped to the `Flux`
and expect a `Publisher<?>` result to continue the flow.
This way end-user just needs to implement a `Function` (or method)
to accept the `Flux` as an input and return some `Publisher`
after the sequence of reactive operators.

Such a new operator also allows a smooth integration with the
Spring Cloud Function, where it is just enough to lookup the function
in the catalog and inject it into this operator

* * Move `fluxTransform()` body to `Transformers` for cleaner context
distribution
2018-08-20 13:30:19 -04:00
Artem Bilan
8f639ad0d6 Move LeaderInitiators to later phase
There is a race condition when Zookeeper `LeaderInitiator` may start
earlier than `CuratorFramework` it depends on.
This is because both of them are configured for the same default `phase` (`0`)

* Make `LeaderInitiator` and `LockRegistryLeaderInitiator` to be started
in the `Integer.MAX_VALUE - 1000` phase by default - as late as possible
* Make `CuratorFrameworkFactoryBean` to start in the `Integer.MIN_VALUE + 1000`
phase - as early as possible
* Alight lifecycle properties from the `LeaderInitiatorFactoryBean` with
defaults in the `LeaderInitiator`
* Simplify a `LeaderListenerParser` to rely on the `LeaderInitiatorFactoryBean`

**Cherry-pick to 5.0.x**
2018-08-20 11:29:19 -04:00
Artem Bilan
5e47a6a9c4 INT-4517: Refactor beans in IntegrationRegistrar (#2537)
* INT-4517: Refactor beans in IntegrationRegistrar

JIRA: https://jira.spring.io/browse/INT-4517

The `IntegrationRegistrar` populates beans into the application context
too early and when the `allowBeanDefinitionsOverride` is disabled we
end up with the `BeanDefinitionOverrideException` just because end-user
beans are applied later.

* Move most of the bean definitions which can be overridden in the target
application from the `IntegrationRegistrar` into the
`DefaultConfiguringBeanFactoryPostProcessor`
* Revise their registration logic to be sure that some of them are
registered only once in the parent context nad others are registered
in the child context as well
* Refactor a `DslIntegrationConfigurationInitializer` do not register
an `IntegrationFlowDefinition.ReplyProducerCleaner` in the child context
one more time: it doesn't bring any local store within the current
child context
* Introduce a `NoBeansOverrideAnnotationConfigContextLoader` in tests
to ensure that in some test-cases we disallow an
`allowBeanDefinitionsOverride` as it is now in Spring Boot since it is
enabled by default in the Spring Framework

* Revernt DslIntegrationConfigurationInitializer changes

Regsiter all the required infrastructure beans in all the application
contexts to avoid class loader issue for `static` store access
2018-08-15 14:18:10 -04:00
Artem Bilan
60db7bc159 INT-4518: Channel late-binding in Messaging Anns
JIRA: https://jira.spring.io/browse/INT-4518

* Fix `BridgeFromAnnotationPostProcessor` do not resolve `outputChannel`
for the target `BridgeHandler`
* Rework logic in the `AbstractMethodAnnotationPostProcessor` to do not
resolve a `MessageHandler` bean from the `@Bean` method when we can
just check a method return type.
* Check `BeanDefinition` instead of real bean when we consult for
conditions

**Cherry-pick to 5.0.x**
2018-08-13 18:12:24 -04:00
Artem Bilan
e2b398ae10 Adapt to the latest Reactor 2018-08-13 11:32:00 -04:00
Artem Bilan
26229c9862 INT-4480: Use component type for ids in the flow (#2536)
* INT-4480: Use component type for ids in the flow

JIRA: https://jira.spring.io/browse/INT-4480

For better readability of bean names, e.g. from the metrics collectors,
generate them from the component type instead of their fully qualified
class names

* * Fix bean name for injection in the WebFluxDslTests
2018-08-09 15:01:41 -04:00
Artem Bilan
055e9a40db INT-4457: Add logAndReply() terminal operator
JIRA: https://jira.spring.io/browse/INT-4457

When an `IntegrationFlow` is reply-based (we expect a reply in the
beginning) and `log()` (or `wireTap()`) is used in the end, we are
forced to add an empty `bridge()` in the end to ensure a `replyChannel`
header routing

* Fix `IntegrationFlowDefinition` to add `enrichHeaders()` in the end
to populate a `nullChannel` as a `replyChannel` header if that is missed
in the request message headers.
This way we cover both use-cases when we expect reply from the flow and
when it is used as a one-way scenario
* Improve a `HeaderEnricher` do not create a new `Message` if there are
no new headers to add/remove
* Remove a note from the `dsl.adoc` about now redundant `bridge()` after
`log()`
* Resolve TODO in the `.handle()` paragraph

* Restore anonymous class in the MessageHistoryIntegrationTests:
Mockito can't mock/spy lambdas because they are `final` classes

* Introduce `IntegrationFlowDefinition.logAndReply()` operator

* Fix logging message

Doc Polishing
2018-08-07 11:35:31 -04:00
Gary Russell
34ac66df1c Ignore the Aggregator Performance test
Occasionally causes OOM on the CI server.
2018-08-01 17:43:25 -04:00
Gary Russell
23a3462d8b Add @NonNullApi where appropriate
Packages with `@Nullable` annotations need to have `@NonNulApi` at the package level.

There may be classes in these packages that have nullable arguments/returns that are
not currently marked as `@Nullable`. These will be fixed over time.

Also suppress JSR305 warnings when compiling tests.

* Polishing - PR Comments
2018-08-01 16:53:42 -04:00
Artem Bilan
55a43d37c8 Fix memory leak in MHistorConfig & MBeanExpHelper (#2531)
* Fix memory leak in MHistorConfig & MBeanExpHelper

The `MessageHistoryConfigurer` is a `BeanPostProcessor` which keeps a
store of the `TrackableComponent`.
Something similar we have with the `MBeanExporterHelper` and its local
stores populated by the `postProcessBeforeInitialization()`

* Implement `DestructionAwareBeanPostProcessor` in the
`MessageHistoryConfigurer` and `MBeanExporterHelper` to remove destroyed
beans from their caches

**Cherry-pick to 5.0.x**

* * Fix concurrency and checkstyle
* Apply Java 8 style for collections iterations
2018-07-27 15:50:09 -04:00
Artem Bilan
adbbca13fb INT-4513: Clean IntManageConf from removed beans
JIRA: https://jira.spring.io/browse/INT-4513

The `IntegrationManagementConfigurer` keeps metrics beans in its local
stores.
When we add beans at runtime, they are not removed from those caches
after their removal

* Implement `DestructionAwareBeanPostProcessor` in the `IntegrationManagementConfigurer`
and clean up caches according provided bean type and its name
* Improve `ManualFlowTests` and `FtpTests` to be sure that
`IntegrationManagementConfigurer` caches are cleared after destroying
 `IntegrationFlowRegistration`

**Cherry-pick to 5.0.x**
2018-07-27 13:32:08 -04:00
Gary Russell
bd0fd50313 INT-4514: Integration Graph, include dynamic flows
JIRA: https://jira.spring.io/browse/INT-4514

`getBeansOfType()` with eager init does not currently return late registered singletons.
We should not be eagerly initializing here anyway.

**cherry-pick to 5.0.x**
2018-07-27 12:45:09 -04:00
Artem Bilan
c44cd2b99b Upgrade to Reactor 3.2 M3, Fix FluxMessageChannel 2018-07-27 09:35:31 -04:00
Artem Bilan
8c03d72e2d INT-4510: Test no memory leak in FluxMessageCh
JIRA: https://jira.spring.io/browse/INT-4510

Related to https://github.com/reactor/reactor-core/issues/1290

The `Flux.publish()` and subsequent `connect()` doesn't fuse a subscriber
for the hooks flow is interrupted (complete, or error, or disconnect).
In this case the `FluxMessageChannel.publishers` store is not cleared
from the finished publishers

* Add test-case to check the `FluxMessageChannel.publishers` store after
finishing the stream
* Add `hide()` operator with TODO to remove when an appropriate Reactor
version is ready

**Cherry-pick to 5.0.x**
2018-07-27 09:31:51 -04:00
Artem Bilan
8b13b2861d Revert to errorStrategyContinue in FluxMessageChe
https://build.spring.io/browse/INT-MASTER-1134

According the latest released reactor-core-3.2.0.M2, there is no yet
a `.onErrorContinue()` operator.
We need to stick with the `.errorStrategyContinue()` for time being
2018-07-27 09:10:34 -04:00
Artem Bilan
da977941f8 INT-4509: Fix memory leak for static beans stores
JIRA: https://jira.spring.io/browse/INT-4509

To avoid a re-usage of the `AbstractReplyProducingMessageHandler`,
the `IntegrationFlowDefinition` and `AbstractStandardMessageHandlerFactoryBean`
have a `static Set<>` to store already used producers and check it for
newly provided.
These stores are not cleaned when beans are destroyed leading to memory
leaks

* Implements a `DisposableBean` for the `AbstractStandardMessageHandlerFactoryBean`
to remove its `replyHandler` from the `referencedReplyProducers` on
`destroy()`
* Introduce a `IntegrationFlowDefinition.ReplyProducerCleaner` - an
`DestructionAwareBeanPostProcessor` to clean up removing `MessageProducer`
from the `IntegrationFlowDefinition.REFERENCED_REPLY_PRODUCERS`

**Cherry-pick to 5.0.x**
2018-07-26 14:15:58 -04:00
Artem Bilan
1ee0639be4 Increase wait timeout in the AbsCorMHandlerTests
https://build.spring.io/browse/INT-MASTERSPRING40-414/
2018-07-26 09:47:20 -04:00