Commit Graph

9086 Commits

Author SHA1 Message Date
Artem Bilan
cb0d43db6b Fix JDBC tests and some upgrades
https://build.spring.io/browse/INT-FATS5IC-430

Looks like there is a race condition when our polling rate around
data base is too fast and we have access to the DB files even during
application context close.

* Stop polling channel adapter in the tests explicitly after test methods
* Increase some tests performance decreasing timeouts to wait
* Upgrade to Reactor-3.1.5, AssertJ-3.9.1, Derby-10.14.1.0 and some
Gradle plugins

* Upgrade to `reactor-netty-0.7.5`
* Remove workaround from the `StompServerIntegrationTests`

* Upgrade to Spring Data Kay SR5

* Upgrade to Spring Security 5.0.3
* Increase timeouts and performance in the `StreamTransformerParserTests`
2018-02-28 11:57:21 -05:00
Andrew Tulloch
b55a5bdde4 INT-4420: Fix hamcrest-all dependency
JIRA: https://jira.spring.io/browse/INT-4420

Use `hamcrest-core` and `hamcrest-library` in place of `hamcrest-all` to match
behavior of other spring projects and avoid multiple JARs containing
the same classes.
2018-02-28 10:36:30 -05:00
Gary Russell
792b8fe6d1 INT-4416: Rework Micrometer Metrics
JIRA: https://jira.spring.io/browse/INT-4416

Metrics should be under a common name, discriminated with tags.
2018-02-27 16:52:28 -05:00
Artem Bilan
f26c3a9004 Polishing SocketSupportTests
https://build.spring.io/browse/INT-MASTER-952

The SSL error might be like `Connection reset by peer` as well.

Also move `client` and `server` `stop()` to the finally, since it looks
like in case of handshake error we leave dangling opened socket
2018-02-26 14:35:52 -05:00
Artem Bilan
60be69335f Polishing configuration.adoc 2018-02-26 14:15:19 -05:00
Artem Bilan
2c3ee7d68c MMIH: Convert from JSON only if SpELInvoker
If there is `json`-aware `contentType` header in the message to process
and payload type is `String` or `byte[]` and it isn't equal to the
expected exclusive method argument type (even generic from the `Message<>`),
the conversion should happen only if SpelInvoker is no method.

The regular `InvocableHandlerMethod` takes care about payload conversion
via configured `MessageConverter` in the `PayloadArgumentResolver`

* Fix `MessagingMethodInvokerHelper` to call JSON conversion only when
`this.handlerMethod.spelOnly`

NOTE: We can't do generics conversion right now because it is going
to be a breaking change around
`org.springframework.integration.support.json.JsonObjectMapper` property
in the `MessagingMethodInvokerHelper`.
We can do that only in `5.1` and rely there only on the functionality
from the Jackson Object mapper

* Convert from JSON only in the `invokeExpression()`
* Optimize message recreation only if target param type is `Message`.
Otherwise override just `payload` property of the `ParametersWrapper`
2018-02-24 13:40:16 -05:00
Gary Russell
60606dd6fe Polishing 2018-02-23 16:35:55 -05:00
Gary Russell
0e3034919d Protect TcpNetConnectionSupport calls
5.0 introduced the `TcpNetConnectionSupport` user hook to create connection objects.

If a user-supplied instance threw an exception, the server socket would remain open
but the server `accept()` thread is gone.

- wrap the connection initialization code in try/catch
- close the server socket if necessary on an exception
2018-02-23 16:35:55 -05:00
Artem Bilan
d5303ca4f3 INT-4413: Don't register flow under the same id
JIRA: https://jira.spring.io/browse/INT-4413

When we override entity in the `IntegrationFlowContext.registry`,
we may get dangling beans in the application context,
when the structure of a new `IntegrationFlow` is different.

* Fix `IntegrationFlowContext` to disallow to override the flow
registration under the same name
* Add JavaDocs to the `IntegrationFlowRegistrationBuilder` methods
* Add `toString()` to the `IntegrationFlowRegistration` and
`StandardIntegrationFlow` to make the logging of these components
friendlier
2018-02-23 15:07:31 -05:00
Artem Bilan
7d1680534f INT-4411: DSL: Fix sub-flows for dynamic routers
JIRA: https://jira.spring.io/browse/INT-4411

The `RouterSpec.RouterMappingProvider` relies on the
`ContextRefreshedEvent` which happens only during application start up.
When we register `IntegrationFlow` at runtime, this event doesn't
happen and therefore sub-flow mappings don't populated.

* Fix `RouterSpec.RouterMappingProvider` to parse sub-flow mappings in
the `onInit()`
* Reorder components registration for the router in the
`IntegrationFlowDefinition` to let lately sub-flows to start earlier,
then lifecycles in the main flow
2018-02-21 17:09:25 -05:00
Gary Russell
f6084939cc Add Pausable
See https://github.com/spring-projects/spring-integration-kafka/issues/198
2018-02-21 11:50:23 -05:00
Spring Buildmaster
6e925fb390 [artifactory-release] Next development version 2018-02-20 21:10:17 +00:00
Spring Buildmaster
67247db5d2 [artifactory-release] Release version 5.0.2.RELEASE 2018-02-20 21:10:08 +00:00
Artem Bilan
03e085ca7f Upgrade to Micrometer-1.0.0 GA 2018-02-20 15:17:26 -05:00
Artem Bilan
e46fc9b738 INT-4407: Add merge option to Log4j2LevelAdjuster
JIRA: https://jira.spring.io/browse/INT-4407

To make a `Log4j2LevelAdjuster` more builder friendly, add a `merge`
option to the overloaded `classes()` and `categories()` methods.
This way the existing (or previously configured) `categories` and
`classes` are merged with the provided values and default
`org.springframework.integration` category can be reuse.

Note: this behavior can be reconsidered as default one in the `5.1`
2018-02-20 15:05:46 -05:00
Kiel Boatman
4bb4a0187a GH-2364 fix intermittent failing test
Resolves https://github.com/spring-projects/spring-integration/issues/2364
2018-02-20 14:52:37 -05:00
Kiel Boatman
4397807a57 GH-2366 Fix failing test on Mac
Resolves https://github.com/spring-projects/spring-integration/issues/2366
2018-02-20 14:51:14 -05:00
Gary Russell
24809557fb INT-4408: PollerSpec Doc Polishing
JIRA: https://jira.spring.io/browse/INT-4408
2018-02-20 14:26:43 -05:00
Artem Bilan
7dc0f5db9f INT-4409: Do not override soapAction to if empty
JIRA: https://jira.spring.io/browse/INT-4409

The `SoapMessage` may come as a `payload` and be already with the
`soapAction` header.
Right now it is overridden independently of the value from the headers.

* Do not override `soapAction` in the `SoapMessage` if header doesn't
have value
2018-02-20 14:23:49 -05:00
Artem Bilan
00c983d97a INT-4410 CollArgResolver only for group processor
JIRA: https://jira.spring.io/browse/INT-4410

The `CollectionArgumentResolver` has been introduced especially for the
cases to work with `MessageGroupProcessor` (an aggregator)
when the payload is a `Collection<Message<?>>`.

This use-case doesn't apply for the general collection parameter use-case.

* Register `CollectionArgumentResolver` only when `listCapable` option.
For all other collection-based use-cases fallback to the standard
`PayloadArgumentResolver` with an appropriate configured `MessageConverter`

Note: this is for backward compatibility.
In the `5.1` we may reconsider to use `MessageConverter` in the
`CollectionArgumentResolver` as well, or just remove it altogether with
an appropriate logic in the `PayloadArgumentResolver`, since this
`CollectionArgumentResolver` solution isn't robust
2018-02-20 13:59:14 -05:00
Artem Bilan
f0a6cb7d41 Upgrade to Reactor-3.1.4, Reactor-Netty-0.7.4
* Fix `StompServerIntegrationTests` for disabling connection pool to
workaround the regression in the Reactor-Netty-0.7.4

Related to https://github.com/reactor/reactor-netty/pull/290
2018-02-20 11:01:41 -05:00
Gary Russell
10120cdf56 Upgrade to Spring Data Kay.SR4, Security 5.0.2
Remove deprecated method from security tests.
2018-02-20 08:44:33 -05:00
Gary Russell
f247faa46b Upgrade to Spring Framework 5.0.4 2018-02-19 13:57:11 -05:00
Gary Russell
6df25d3c3f More diagnostics for StompServerTests 2018-02-17 12:16:53 -05:00
Gary Russell
9123503ec9 Fix asciidoc syntax
A code block was incorrectly labeled as java.
2018-02-16 14:44:15 -05:00
Artem Bilan
800184270a INT-4402: Apply global interceptors at runtime
JIRA: https://jira.spring.io/browse/INT-4402

Make `GlobalChannelInterceptorProcessor` as a `BeanPostProcessor`,
so it can apply global `ChannelInterceptor`s to any initialized channel
beans, even those created at runtime, like in case of dynamic flows with
Java DSL

**Cherry-pick to 4.3.x**

* Add `postProcessDynamicBeans` global property with `false` by default
* Rely on the `postProcessDynamicBeans` property in the
`GlobalChannelInterceptorProcessor.postProcessAfterInitialization()`
*  Add `postProcessDynamicBeans=true` to the
`GlobalChannelInterceptorTests-context.xml` to be sure in the test-case
that option works
* Document the option and effect from the global channel interceptors
2018-02-16 11:33:19 -05:00
Gary Russell
a77def1cdf INT-4403: Micrometer and Dynamic Components
JIRA: https://jira.spring.io/browse/INT-4402

Previously, Micrometer instrumentation was only applied to components during
ApplicationContext initialization.

`IntegrationManagementConfigurer` is now a `BeanPostProcessor` as well as a
`SmartInitializingSingleton`, but only acts as a BPP after the context is
initialized. This enables Micrometer instrumentation to beans added later,
either via a new `BeanDefinition` or `bf.initializeBean`.

NOTE: destroying and re-creating a bean will use the same `Meters`.
2018-02-15 10:30:21 -05:00
Artem Bilan
11240be555 GH-2358: Register IntGraphController for WebFlux
Fixes https://github.com/spring-projects/spring-integration/issues/2358

The WebFlux on the server side can deal with MVC `@Controllers` as well
without any Servlet environment.

* Enable `IntegrationGraphController` when we not only in the
Servlet environment, but also in the WebFlux
* Upgrade to SF-5.0.4 and fix WebFlux tests to meet the latest requirements
  (https://jira.spring.io/browse/SPR-16337)
* Move `WEB_FLUX_PRESENT` to the `HttpContextUtils`;
deprecate it in the `WebFluxContextUtils`
* Mention WebFlux ability for the `IntegrationGraphController` in the
`graph.adoc`
2018-02-14 11:08:57 -05:00
Gary Russell
a4130c9e59 INT-4401: Document working with shaded jars
JIRA: https://jira.spring.io/browse/INT-4401

How to fix up the `spring.factories` etc.

* Polishing
2018-02-13 16:19:15 -05:00
Gary Russell
eaa19c8ddb Fix Amqp DSL Javadocs 2018-02-13 15:45:59 -05:00
Kiel Boatman
78b80ef79f GH-2354 Injection Executor to LockLeaderInitiator
Fixes https://github.com/spring-projects/spring-integration/issues/2354

INT-2354 missed file in previous commit

INT-2354 fix failing test

INT-2354 changes following feedback

INT-2354 feedback changes

INT-2354 feedback changes

* Simple code style polishing
2018-02-13 14:14:56 -05:00
Artem Bilan
d361eefa0c Add missed options and JavaDocs to AMQP Java DSL 2018-02-12 11:43:36 -05:00
Artem Bilan
09aeaac4da INT-4396: Add retrying lock in case of exception
JIRA: https://jira.spring.io/browse/INT-4396

When target distributed `Lock` implementation throws an exception, e.g.
in case of no connection to the service, the `LockRegistryLeaderInitiator`
exists the loop and can come back to the elections only after restart

* Catch all the exception on `this.lock.tryLock()` and resubmit
`LeaderSelector` for a new locking cycle if
`LockRegistryLeaderInitiator.isRunning()` and `InterruptedException`

* Remove diagnostics from the `JdbcLockRegistryLeaderInitiatorTests`
since this fix confirms that we just didn't have a reconnect logic before
when this test failed sporadically

**Cherry-pick to 4.3.x**
2018-02-09 16:09:22 -05:00
Gary Russell
e53e8941a1 Add ObjectStringMapBuilder
Convenient builder for DSL `getComponentsToRegister()`.
2018-02-07 10:55:46 -05:00
Gary Russell
f4fbfa116a INT-4395: More micrometer meters
JIRA: https://jira.spring.io/browse/INT-4395

- pollable channel counts
- component counts (gauges)

Polishing - PR comments

Fix switch in test

* Simple code style polishing and fix JavaDocs
2018-02-05 16:36:18 -05:00
Artem Bilan
5f509ac02e INT-4394: Fix compatibility with Jackson JSON
JIRA: https://jira.spring.io/browse/INT-4394

Looks like Jackson has became much smarter and now it stores
the target type for the object, not returned interface.

We can't use Jackson annotations on the Framework classes and
we can't restrict the `messagingAwareMapper()` `ObjectMapper` just
to use fields for all the object passed through it.

As a compromise solution we shouldn't use
`Collections.unmodifiableList()` in the getter.
The copy of the internal collection is pretty enough to protect
our object from mutation.

**Cherry-pick to 4.3.x (excluding `build.gradle` change)**
2018-02-05 11:51:07 -05:00
Gary Russell
51397ec141 Make updateNotPropagatedHeaders protected final 2018-02-03 13:08:54 -05:00
Gary Russell
54754743a5 INT-4384: Micrometer Support
JIRA: https://jira.spring.io/browse/INT-4384

Add support for micrometer metrics collection.

Initial commit.

* Rebase; upgrade to Micrometer rc.8

* Polishing - PR Comments

* Final Polishing
2018-02-02 15:30:48 -05:00
Gary Russell
3bd4930813 Fix UDP Tangles
- Class tangle in new event
- Package tangle udp <-> util

* Fix JacksonJsonUtils class tangle

* Fix HTTP class tangle
2018-02-01 15:12:53 -05:00
Tim Ysewyn
90a751e69d GH-2346: Fix Java DSL TCP Factory
Fixes https://github.com/spring-projects/spring-integration/issues/2346

* Fixed issue where the Java DSL will always create NIO connection factories
 regardless of which type you specified.

* Deprecated the 2 static booleans
2018-02-01 15:12:00 -05:00
Artem Bilan
3530e76422 INT-4030: Do not cache consumers in the JMS tests
JIRA: https://jira.spring.io/browse/INT-4030

**Cherry-pick to 4.3.x**
2018-01-31 12:18:14 -05:00
Gary Russell
30fac62c2c INT-4388: Add UdpServerListeningEvent
JIRA: https://jira.spring.io/browse/INT-4388

Publish an event when the UDP server socket is established.

* Polishing - remove unreachable assertions
2018-01-30 13:34:53 -05:00
Artem Bilan
23687e438c Clean Redis keys before testing
https://build.spring.io/browse/INT-FATS5IC-400

When we run several concurrent builds (e.g. CI) and use the same shared
Redis server we may end up with the case when one process reads data
populated by another because we use the same key (groupId in our case)

* Fix `RedisMessageGroupStoreTests` to use `UUID.randomUUID()`
for the `groupId`

**Cherry-pick to 4.3.x**
2018-01-30 10:33:56 -05:00
Spring Buildmaster
9167345e53 [artifactory-release] Next development version 2018-01-29 16:49:58 +00:00
Spring Buildmaster
0f0bc707bb [artifactory-release] Release version 5.0.1.RELEASE 2018-01-29 16:49:52 +00:00
Artem Bilan
92ae12b5ad Upgrade to S-A-2.0.2, S-S-5.0.1, S-Retry-1.2.2 2018-01-29 11:02:44 -05:00
Artem Bilan
3fa777db5e Expose scan-each-poll for File Inbound Ch Adapter
The `scan-each-poll` XML attribute is missing for the
`<int-file:inbound-channel-adapter>`
2018-01-26 13:12:13 -05:00
Artem Bilan
2fbb6fbaf4 Fix JdbcLockRegDiffClientTests race condition
https://build.spring.io/browse/INT-MJATS41-1242

When different `DefaultLockRepository` instances use the same client id,
there is a possibility that they will update the same row in the table.
This way we have a chance that not only one obtains a lock and try to
add a value to the collection.

* Remove the test-case for the same client id as non-stable and even
dangerous by the the distributed lock purpose
* Use `tryLock(Long.MAX_VALUE)` to really ensure the wait behavior
during the concurrent loop
* Use `20` for thread pool to align with the tasks amount

**Cherry-picked to 4.3.x**
2018-01-24 17:26:33 -05:00
Artem Bilan
c48a2392d2 Use JavaScript instead of Ruby
https://build.spring.io/browse/INT-SI43X-230

Looks like Ruby engine takes some time to start and
`Jsr223InboundChannelAdapterTests` is slow as 3 seconds locally as well

* Change the script to JavaScript and now we have 200 millis

**Cherry-pick to 4.3.x**
2018-01-24 15:07:26 -05:00
Gary Russell
870cd77d52 Fix Hang in JMS Test
- add a timeout for template.receive()
- don't cache consumers
2018-01-24 14:09:03 -05:00