Commit Graph

9284 Commits

Author SHA1 Message Date
Artem Bilan
e2b398ae10 Adapt to the latest Reactor 2018-08-13 11:32:00 -04:00
Artem Bilan
a4ffddf226 Upgrade to latest B-S of all Spring dependencies 2018-08-10 12:55:10 -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
Artem Bilan
4a85849bcc INT-3364: Add batchUpdate into JdbcMessageHandler (#2534)
* INT-3364: Add batchUpdate into JdbcMessageHandler

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

* * Optimize items mapping with an internal `Message` implementation
* Polishing Docs and Javadocs
2018-08-02 17:41:25 -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
Gary Russell
03a3bbb65f More JDBC doc fixes 2018-07-30 15:29:26 -04:00
Spring Buildmaster
e2daca75c4 [artifactory-release] Next development version 2018-07-27 20:25:17 +00:00
Spring Buildmaster
f9f00fa61b [artifactory-release] Release version 5.1.0.M1 2018-07-27 20:25:11 +00: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
cdba9a741c 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:31:33 -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
0c65bb741b Upgrade to Security 5.1.M2 and Rector 3.2.0.M2
* Upgrade to Reactor-Netty-0.8.0.M1
2018-07-27 09:03:44 -04:00
Artem Bilan
3ab037f1eb Fix RedisUtils to detect UNLINK per RedisOps
This might be a fact that application doesn't use a single
`RedisOperations`.
Also the same JVM may be shared between several applications with
different connections to different Redis servers

* change plain `Boolean unlinkAvailable` property to the
`Map<RedisOperations<?, ?>, Boolean>` and `computeIfAbsent()` per
provided `RedisOperations`
2018-07-26 14:36:33 -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
Gary Russell
20789ac118 Upgrade Spring AMQP to 2.1.0.M1 2018-07-26 13:28:19 -04:00
Gary Russell
37d05de02d Upgrade Spring Framework, Data, to RC1 2018-07-26 10:40:25 -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
Artem Bilan
9d17e09f31 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:11:55 -04:00
Artem Bilan
4d20fe5e1e Upgrade to Spring WS 3.0.2
**Cherry-pick to 5.0.x**
2018-07-25 16:41:43 -04:00
Artem Bilan
88c7646ed9 INT-4507: Use UNLINK in RedisMessageStore if any
JIRA: https://jira.spring.io/browse/INT-4507

* Add `RedisUtils` with the `isUnlinkAvailable()` to check the Redis
server version to be sure that `UNLINK` is available or not
* Use `RedisUtils.isUnlinkAvailable()` in the `RedisMessageStore` and
`RedisLockRegistry` when a removal functionality is performed
* Add `AbstractKeyValueMessageStore.doRemoveAll(Collection<Object> ids)`
for optimization
* Implement `doRemoveAll()` in the `RedisMessageStore` and
`GemfireMessageStore`

**Cherry-pick to 5.0.x**
2018-07-25 16:30:03 -04:00
Gary Russell
d61cd790fe Upgrade to Gradle 4.9; fix RotatingServersTests
Stop the flow before examining the stream to avoid `ConcurrentModificationException`.

**cherry-pick to 5.0.x**
2018-07-25 14:01:38 -04:00
Gary Russell
bebde260db 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**
2018-07-25 13:16:48 -04:00
Artem Bilan
0d0605be78 INT-4381: MessageSources refactoring (#2517)
* INT-4381: MessageSources refactoring

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

* Make all the out-of-the-box `MessageSource` implementations based
on the `AbstractMessageSource`
* Fix `JdbcPollingChannelAdapterIntegrationTests` for sporadic failure
because of `fixed-rate` for the poller

* Fix HeaderEnricherTests race condition

The `errorChannel()` expect an error in the `testErrorChannel` after
`1000` ms, but at the same time the `poller` in configured for the
`3000` ms.

* Increase all the timeouts for replies
* Decrease a `fixed-delay` on the `poller`
* Some other code style polishing for the `HeaderEnricherTests`
2018-07-25 13:01:22 -04:00
Gary Russell
d6c8baf50f INT-4505: Fix package tangle
JIRA: https://jira.spring.io/browse/INT-4505
2018-07-24 16:30:10 -04:00
Oleksii Komlyk
865e2162e5 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**
2018-07-24 16:12:39 -04:00
Gary Russell
1a4de86b30 Fix appendix warnings and other minor fixes 2018-07-24 15:56:14 -04:00
Artem Bilan
44b7df94c1 Polishing for the FileWritingMessageHandler
* Fix typos in docs
* Add `om.google.code.findbugs:jsr305` to avoid warnings like
`Cannot find annotation`
2018-07-24 15:50:56 -04:00
Alen Turkovic
9ac0746f19 INT-4502: Add new file callback in FileWritingMH
JIRA: https://jira.spring.io/browse/INT-4502

Documentation
Using a BiConsumer instead of a custom interface

Doc fixes

Calling callback while locked

More requested fixes

Missing `FileWritingMessageHandler.this` on `fileExistsMode`
2018-07-24 15:50:05 -04:00
Artem Bilan
a7ffbde07f Fix WebSocketInChA according latest SF
* The `SimpleBrokerMessageHandler` has been fixed the way it consults
a `session` store for sending reply.
The session can be added to that store only when we send a `CONNECT`
command.
Fix `WebSocketInboundChannelAdapter` to send additional `CONNECT` message
in the `afterSessionStarted()` and when selected `SubProtocolHandler` is
a `StompSubProtocolHandler`
* Add extract check into the `StompIntegrationTests` for events: now
we also get a `SessionConnectedEvent` as well
* Fix typo in the `index-docinfo.xml`
2018-07-24 14:59:39 -04:00
Gary Russell
001b86b641 Upgrade Micrometer to 1.0.6 2018-07-24 12:39:04 -04:00
Jay Bryant
997183bee2 Removed the troublesome backticks
Removed the backticks that were making links not render. Fixed a few typoes, too.

Integrating feedback from Artem

Artem caught some errors that I had made (and that my editor, Atom, had made - grrr). I fixed them.

Thanks, Artem. :)

Removing duplicate content

I caught that duplicate content somehow got added to preface.adoc. I removed one set of it to make that content not be duplicated.

* Fix `jdbc.adoc` typos
2018-07-24 12:24:34 -04:00
Artem Bilan
5c1c82efd7 Fix zookeeper.adoc typos 2018-07-24 12:12:40 -04:00
Gary Russell
b23147b9ef Fix PDF overflows; missing block fences
- Fix most PDF overflows (2 remain)
- Add missing block fences to fix ToC/Headings
2018-07-24 12:10:56 -04:00
Artem Bilan
3ff9645167 Fix FluxMessageChannel for the latest Reactor 2018-07-24 12:08:06 -04:00
Artem Bilan
c6f459c130 INT-4453: Move Twitter module to Extensions
JIRA: https://jira.spring.io/browse/INT-4453

Fix typos and language in docs

Fix more typos and language in docs
2018-07-23 14:14:41 -04:00
Gary Russell
09d6b76748 More doc fixes
Fix Java syntax rendering leak.
2018-07-19 17:00:07 -04:00
Gary Russell
70db967d4f Doc ToC Fixes 2018-07-19 16:48:58 -04:00
Gary Russell
55f69206e3 Gateway void return type docs
* Polishing - PR Comments
2018-07-19 16:03:53 -04:00
Gary Russell
ec106984a2 Fix race condition in test 2018-07-19 10:27:12 -04:00
Artem Bilan
de9f8d7ccd 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:06 -04:00
Artem Bilan
aac4051d68 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**
2018-07-16 11:29:22 -04:00
Steve Singer
0dcbde0642 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`
2018-07-12 20:46:15 -04:00
Artem Bilan
e40e2a4238 Fix test entities for @PersistenceConstructor 2018-07-12 17:27:06 -04:00
Artem Bilan
481dec4fa8 Fix MongoDb MessageDocument for latest Spring Data 2018-07-12 17:04:40 -04:00