Commit Graph

9223 Commits

Author SHA1 Message Date
Spring Buildmaster
2a241ea945 [artifactory-release] Next development version 2018-07-27 20:26:01 +00:00
Spring Buildmaster
c986123140 [artifactory-release] Release version 5.0.7.RELEASE 2018-07-27 20:25:54 +00:00
Artem Bilan
3896acb08d 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:55 -04:00
Artem Bilan
169eb7498d Fix imports in tests for moved classes
https://build.spring.io/browse/INT-SI50X-122
2018-07-27 13:44:42 -04:00
Artem Bilan
1014258c73 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:33:15 -04:00
Gary Russell
c50a135f23 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**

# Conflicts:
#	spring-integration-core/src/main/java/org/springframework/integration/support/management/graph/IntegrationGraphServer.java
2018-07-27 13:01:35 -04:00
Artem Bilan
b47c0de629 INT-4512: Add more JMS options for DSL builders
JIRA: https://jira.spring.io/browse/INT-4512

* Add `JmsListenerContainerSpec.subscriptionShared()` option

**Cherry-pick to 5.0.x**
2018-07-27 10:34:56 -04:00
Artem Bilan
7e8991a45e 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:40:54 -04:00
Artem Bilan
3f66e1eb62 Upgrade to Security 5.0.7 and Data Kay SR9 2018-07-27 08:52:30 -04:00
Artem Bilan
663984a016 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:19:12 -04:00
Gary Russell
d4cf440115 Upgrade Spring Framework to 5.0.8 2018-07-26 10:43:03 -04:00
Artem Bilan
2709bc142a Upgrade to the latest Kotlin
* Fix more recursive generics on factory methods
See https://jira.spring.io/browse/INT-4458

**Cherry-pick to 5.0.x**
2018-07-26 09:18:20 -04:00
Artem Bilan
5cbc622f4b Upgrade to Spring WS 3.0.2
**Cherry-pick to 5.0.x**

# Conflicts:
#	build.gradle
2018-07-25 16:43:45 -04:00
Gary Russell
4ddf423fbd Upgrade to Gradle 4.9; fix RotatingServersTests
Stop the flow before examining the stream to avoid `ConcurrentModificationException`.

**cherry-pick to 5.0.x**

# Conflicts:
#	gradle/wrapper/gradle-wrapper.jar
#	gradle/wrapper/gradle-wrapper.properties
2018-07-25 14:06:31 -04:00
Gary Russell
c216f972a8 INT-4506: Splitter: close stream and Closeables
JIRA: https://jira.spring.io/browse/INT-4506

Capture the actual splitter result in the `FunctionIterator and close it if necessary.

**cherry-pick to 5.0.x**

Add Closeable to proxy in test; remove AutoCloseable check.

Closeable extends AutoCloseable.

Fix javadocs; test for AutoCloseable instead of Closeable

Polishing - PR comments; tighten up API.

A `CloseableIterator` is now an `AutoCloseable` with an overridden
`close()`` (no exception) to avoid lint problem.

* Polishing omissions, code style and `@author`

**Cherry-pick to 5.0.x**

(cherry picked from commit bebde26)
2018-07-25 13:19:48 -04:00
Gary Russell
8101c1b8a8 INT-4505: Fix package tangle
JIRA: https://jira.spring.io/browse/INT-4505
2018-07-24 17:01:51 -04:00
Oleksii Komlyk
26bc248379 INT-4503: Fix assertion in HttpMessageHandlerSpec
JIRA: https://jira.spring.io/browse/INT-4503

Custom `ErrorHandler` can't be used if an external `RestTemplate`
is provided

* Replace `isClientSet()`` with ``!isClientSet()`` for `isTrue`
 assertion in `errorHandler` method
* Replace assertion of `restTemplate` `isNull` with assertion
`!isClientSet()` `isTrue` in the `requestFactory()` method
* Add test coverage for the `errorHandler` into the `HttpDslTests`

**Cherry-pick to 5.0.x**

(cherry picked from commit 865e216)
2018-07-24 16:15:51 -04:00
Gary Russell
0635c257fe Upgrade Micrometer to 1.0.6 2018-07-24 12:40:15 -04:00
Gary Russell
898404ed66 Fix race condition in test 2018-07-19 10:25:28 -04:00
Artem Bilan
a99f446489 INT-4501: Don't call getBean from BPP.setBFactory
JIRA: https://jira.spring.io/browse/INT-4501

The call to the `IntegrationFlowBeanPostProcessor#setBeanFactory`
happens during BPP creation.
The introduced call to `beanFactory#getBean` triggers a lot of bean
creations.
For those beans not all `BPP`s are applied.

* Obtain a `flowContext` bean in lazy-load manner

**Cherry-pick to 5.0.x**
2018-07-16 19:40:55 -04:00
Artem Bilan
34c454bb85 Remove max-rows from Stored Proc-in-ch-ad Docs
https://stackoverflow.com/questions/51361379/spring-integration-jdbc-what-is-the-replacement-for-the-missing-attribute-max

**Cherry-pick to 5.0.x and 4.3.x**

# Conflicts:
#	src/reference/asciidoc/jdbc.adoc
2018-07-16 11:33:48 -04:00
Steve Singer
7c9697b1e5 INT-4500: Fix DefAmqpHeaderMapper correlationId
JIRA https://jira.spring.io/browse/INT-4500

The `correlationId` condition was against a `contentType` by mistake

* Code style polishing, add `@author`

(cherry picked from commit 0dcbde0)
2018-07-12 20:47:44 -04:00
Artem Bilan
4b1d179956 Fix IntComponentSpec for ctx hooks
Since `IntegrationComponentSpec` is a `FactoryBean`, we need to care
about `Aware` and `init` & `destroy` hooks our selves or delegate
them through the `FactoryBean` wrapper

* Implement `InitializingBean` and `DisposableBean` on the
`IntegrationComponentSpec`
* Call the `Aware` hooks from the `IntegrationFlowBeanPostProcessor`

**Cherry-pick to 5.0.x**
2018-07-12 16:18:26 -04:00
Artem Bilan
2126e9b9b5 INT-4499: Add JdbcMetadataStore.setLockHint()
JIRA https://jira.spring.io/browse/INT-4499
Fixes https://github.com/spring-projects/spring-integration/issues/2483

To allow to reconfigure a `SELECT ... FOR UPDATE` for particular RDBMS
vendor, we need an option to specify possible hint for the target data base.

**Cherry-pick to 5.0.x**
2018-07-11 17:55:48 -04:00
Artem Bilan
bf1b600965 INT-4490: DefaultLockRepo: no uppercase format
JIRA https://jira.spring.io/browse/INT-4490

The `DefaultLockRepository.prefix` can be configured with the schema name.
And this one can be case-sensitive.

* Change format hint from the `%S` to `%s` to avoid upper-casing.

**Cherry-pick to 5.0.x and 4.3.x**
2018-07-11 17:40:55 -04:00
Gary Russell
6b8a005c92 Fix ThreadAffinityClientConnectionFactory
`isSingleUse()` should return `false` by default - the whole point is
to bind a connection to a thread. The TACCF should have its own flag
not return the delegate's.

Also, the `TcpReceivingChannelAdapter` calls `closeConnection(connectionId)`.
This should be a no-op for the TACCF since the proper way to close a connection
is to call `releaseConnection()` on the thread to which the connection is bound.

**cherry-pick to 5.0.x**

(cherry picked from commit 753255c)
2018-07-09 14:37:59 -04:00
Gary Russell
535c753db1 INT-4498: SFTP: Close privateKey resource
JIRA: https://jira.spring.io/browse/INT-4498

Use `FileCopyUtils` instead of `StreamUtils`.

**cherry-pick to 5.0.x, 4.3.x**

(cherry picked from commit 8eac5b4)
2018-07-09 13:49:39 -04:00
Artem Bilan
9fa1c7db38 INT-4498: StreamUtils -> FileCopyUtils
JIRA: https://jira.spring.io/browse/INT-4498

* Use `FileCopyUtils` instead of `StreamUtils` in test-cases when we deal
with `InputStream` s and files resources.
* Fix reflection-based tests with AOP to use an `ArrayList` access
instead of `LinkedList` since an optimization in SF:
6d6aa72e8f

**Cherry-pick to 5.0.x and 4.3.x**

(cherry picked from commit a1f016a)
2018-07-09 13:42:21 -04:00
Artem Bilan
2fbb44322c Fix import in the FtpStreamingMessageSourceTests
https://build.spring.io/browse/INT-SI50X-98/
2018-06-29 21:45:07 -04:00
Artem Bilan
7ea4192b84 Close file resource after (S)FTP streaming tests
Windows is too scrupulous for non closed file resources.
Our `RemoteFileTestSupport` recreates a test directory with files
for each test.
When we don't close some file handler, we are not able to delete the
directory and we fail with subsequent tests.

* Close `InputStream` for each polled file in new tests in the
`SftpStreamingMessageSourceTests`

* Close `CLOSEABLE_RESOURCE` in new tests in the
`FtpStreamingMessageSourceTests`
* Rework `FtpStreamingMessageSourceTests.testAllContents()` do not
poll all the files on each polling cycle - this causes a race condition
when we don't close `CLOSEABLE_RESOURCE` yet in the `StreamTransformer`,
but try to proceed with recreation a test directory structure

**Cherry-pick to 5.0.x**

(cherry picked from commit 6ecd948)
2018-06-29 21:29:24 -04:00
Gary Russell
26cd6456e9 INT-4495: (S)FTP: fix max-fetch with directories
JIRA: https://jira.spring.io/browse/INT-4495

Previously, `maxFetch` was applied before directories were removed from
the fetch list.

Remove the directories before filtering and applying `maxFetch`.

* Polishing - PR Comments

* More polishing

* More polishing.

* Check for empty array.

* Remove test main method.

INT-4495: Fix SFTP tests
2018-06-29 17:01:25 -04:00
Artem Bilan
c1dd6187e3 RotatingSTests: Don't delete files between polls
On Windows `File.delete()` causes to file to be modified first of all.
with the high polling interval (`fixedDelay(1)`) there is a chance
to pick the same file from the local directory again, since the
`AbstractPersistentAcceptOnceFileListFilter` is based on the `lastModified`

* Do not delete files manually at all - just rely on the `clean()`
with the `@Before`

**Cherry-pick to 5.0.x**

# Conflicts:
#	spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/RotatingServersTests.java
2018-06-27 16:34:23 -04:00
Artem Bilan
bb174d44ab Fix RotatingServersTestsfor proper import
https://build.spring.io/browse/INT-SI50X-94/
2018-06-27 15:29:12 -04:00
Gary Russell
9f937f54cd INT-4491: (S)FTP inbound rotate dirs/servers
JIRA: https://jira.spring.io/browse/INT-4491

Add Rotating Server/Directory Polling Advice.

**cherry-pick to 5.0.x**

* Polishing - PR Comments.

* Polishing

* Polishing; revert `KeyDirectory`; WARN about `TaskExecutor` and `MessageSoureMutator`(s).

* More polishing - PR comments

* Apply stashed changes.

* Fix WARN log - the `SyncTaskExecutor` is wrapped.

# Conflicts:
#	spring-integration-core/src/main/java/org/springframework/integration/endpoint/SourcePollingChannelAdapter.java
#	src/reference/asciidoc/whats-new.adoc
2018-06-27 13:48:06 -04:00
Gary Russell
170cc37270 INT-3916: ZK: Fix missing doc update
JIRA: https://jira.spring.io/browse/INT-3916

Changed CTOR injection to setters.
2018-06-27 12:24:15 -04:00
Gary Russell
493b4aa091 INT-4493: ZK MStore binary compatiblity
JIRA: https://jira.spring.io/browse/INT-4493

Use reflection to enable binary compatibility with curator 4.x.

The return type of `ExistsBuilder.creatingParentContainersIfNeeded()` is now
a sub-interface of `ExistsBuilderMain`.

Tested with a boot app with curator 4.0.1.

* Polishing - add cause
2018-06-27 11:55:36 -04:00
Artem Bilan
67fdac89f3 INT-4489: MessageHistory: Allow runtime beans
JIRA: https://jira.spring.io/browse/INT-4489

Make `MessageHistoryConfigurer` as a `BeanPostProcessor` and apply
tracking logic to processed beans if it is already started.

**Cherry-pick to 5.0.x**
2018-06-22 13:55:58 -04:00
Gary Russell
7b0795e306 Another asciidoc fix 2018-06-19 14:59:04 -04:00
Gary Russell
754885bc54 Add hack for Atom asciidoc syntax highlighting bug 2018-06-19 14:56:05 -04:00
Spring Buildmaster
7a6a5a13e7 [artifactory-release] Next development version 2018-06-13 19:01:05 +00:00
Spring Buildmaster
9922b6e28e [artifactory-release] Release version 5.0.6.RELEASE 2018-06-13 19:00:58 +00:00
Gary Russell
62e46c96fc Remove use of deprecated ChannelInterceptorAdapter
Deprecated in favor of default methods on `ChannelInterceptor`.

* Fix race in RouterConcurrencyTest; no assertion on executor shutdown; increase time.

# Conflicts:
#	spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java
2018-06-13 13:30:07 -04:00
Artem Bilan
8e1dbdf4c6 Upgrade to SA-2.0.4
* Fix deprecation in the `AmqpChannelParserTests`
2018-06-13 13:27:13 -04:00
Artem Bilan
264caa992f GH-2478: RecursiveDScanner: Files.walk().close()
Fixes https://github.com/spring-projects/spring-integration/issues/2478

The `Files.walk()` stream must be closed in the end after usage

* Wrap `Files.walk()` to the `try-with-resources`

**Cherry-pick to 5.0.x**
2018-06-13 12:33:53 -04:00
Artem Bilan
058ae6f4c0 INT-4484: Fix SyndEntryPublishedDateComparator
JIRA: https://jira.spring.io/browse/INT-4484

Fix the `SyndEntryPublishedDateComparator` to move entries without a
date into the end of the sorted list

**Cherry-pick to 5.0.x and 4.3.x**
2018-06-13 12:26:19 -04:00
Gary Russell
3c5edba112 Update Spring Framework/Security versions 2018-06-13 09:28:38 -04:00
Gary Russell
27d4fd3cd8 Fix docs isClientModeConnected()
(cherry picked from commit a954290)
2018-06-12 12:36:38 -04:00
Artem Bilan
08ebc6684f INT-4485: Don't register bean twice for DSL Specs
JIRA: https://jira.spring.io/browse/INT-4485

The `IntegrationFlowBeanPostProcessor` performs extra bean registration
for the `IntegrationComponentSpec.get()` result.
Essentially it is going to be the same object in the end, but during
bean registration phase we end up with names conflict.

* Remove an explicit `registerComponent()` for the
`IntegrationComponentSpec.get()`
* Modify `CorrelationHandlerTests` for all possible usage for the
`MessageChannelSpec`, which is essentially a `FactoryBean`

**Cherry-pick to 5.0.x**
2018-06-12 10:19:23 -04:00
Artem Bilan
1ce656e4fe INT-4486: Properly implement stop(Runnable)
JIRA: https://jira.spring.io/browse/INT-4486

The `SmartLifecycle.stop(Runnable callback)` must always call the
`callback` in the end independently of the internal state

* Revise all the `SmartLifecycle` implementations for the proper
`callback` handling

**Cherry-pick to 5.0.x and 4.3.x**
2018-06-11 17:52:23 -04:00
Artem Bilan
125cc861d4 GH-2464: WebFlux: Get rid of Mono.block() (#2465)
* GH-2464: WebFlux: Get rid of Mono.block()

Fixes https://github.com/spring-projects/spring-integration/issues/2464

The `WebFluxInboundEndpoint` resolves a `Principal` via `Mono.block()`
operation.
This is prohibited situation in the non-blocking thread, like Reactor
Netty

* Defer `Mono<Principal>` resolution to the message header via
deferring the whole `Message` creating via `flatMap()` operation on the
main `doHandle()` `Mono`

**Cherry-pick to 5.0.x**

* * Fix Checkstyle for the Reactive Spring Security testing utils static imports
* Add `defaultIfEmpty()`, when `exchange.getPrincipal()` is an empty `Mono`
2018-06-11 16:34:43 -04:00