Commit Graph

9623 Commits

Author SHA1 Message Date
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
Artem Bilan
aca79f842d Fix deprecation from SF-5.0.3
* Upgrade to Spring Data Key SR3, Reactor-3.1.3, Reactor Netty-0.7.3
2018-01-24 11:13:01 -05:00
Gary Russell
534bb6cd37 Bump SF to 5.0.3 2018-01-24 09:55:15 -05:00
Artem Bilan
9f6457fc31 INT-4383: Add test for EnricherSpec.errorChannel
JIRA: https://jira.spring.io/browse/INT-4383
2018-01-23 12:42:38 -05:00
Alexis Hafner
061dcb1b87 INT-4383 Expose errorChannel in EnricherSpec
JIRA: https://jira.spring.io/browse/INT-4383
2018-01-23 12:31:27 -05:00
Abhijit Sarkar
56ffed0801 GH-2340: Fix WebFluxMessageHandlerSpec
Fixes https://github.com/spring-projects/spring-integration/issues/2340

* Make `WebFluxMessageHandlerSpec` to support method chain
* Add `WebFluxDslTests.testWebFluxFlowWithReplyPayloadToFlux()`
2018-01-23 10:10:40 -05:00
Artem Bilan
01b0e1c79a INT-4366: Fix MulticastSendingMH race condition
JIRA: https://jira.spring.io/browse/INT-4366

The `MulticastSendingMessageHandler.getSocket()` doesn't guard around
`this.multicastSocket` property causing `NPE` and other inconsistency
in the multi-threaded environment

* Make the whole `MulticastSendingMessageHandler.getSocket()` as
`synchronized` like it is with the super method
* Reuse `closeSocketIfNeeded()` in the
`UnicastSendingMessageHandler.handleMessageInternal()`
* Fix type in the `UnicastSendingMessageHandler` logging message
* Fix `UdpChannelAdapterTests` for missed `BeanFactory` for the SpEL
and also `MulticastSendingMessageHandler.stop()` in one missed places

**Cherry-pick to 4.3.x**
2018-01-22 17:19:32 -05:00
Artem Bilan
170292acf3 Shutdown executors in TCP/IP tests 2018-01-22 16:17:20 -05:00
Artem Bilan
2736de99de Fix JdbcLockRegistry tests
https://build.spring.io/browse/INT-MASTER-901

The `JdbcLockRegistryDifferentClientTests.testOnlyOneLock()` relies
on the `ArrayList.isEmpty()` state to proceed with the logic.
But since the `ArrayList.size` property is not `volatile`, there is no
guarantee for the proper state in the multi-threaded environment like
we have in this test-case.

* Replace `ArrayList` in the test with the `LinkedBlockingQueue` which
already rely on the `AtomicInteger` for the `size` property
* Fix `JdbcLockRegistry` tests to shutdown used `ExecutorService` s
to ensure set free threads after test suite execution.

**Cherry-pick to 4.3.x**
2018-01-22 12:52:49 -05:00
Gary Russell
55d92edd4e INT-4382: Fix deadlock in FileWritingMH
JIRA: https://jira.spring.io/browse/INT-4382

There is a deadlock in the FMWH due to lock ordering.

Writes try to lock the handler monitor while holding the file lock.
The `Flusher` tries to lock the file lock while holding th handler monitor.

- Change the `Flusher`, `stop` and `flushIfNeeded` methods to not call close
  on the file state while holding the handler monitor.

__cherry pick to 4.3.x__ (fix <> for Java 6)

Polishing - PR Comments

* Optimize `flushIfNeeded(FlushPredicate)` to delegate only to the
`flushIfNeeded(MessageFlushPredicate, Message<?>)`
2018-01-22 11:45:40 -05:00
Gary Russell
5695d43ca0 Fix PDF Overflows 2018-01-20 13:21:56 -05:00
Gary Russell
2d6984b3cb Revert "INT-4366: Fix MulticastSendingMH
This reverts commit c3b64dc1ac.
2018-01-19 17:19:27 -05:00
Artem Bilan
c3b64dc1ac INT-4366: Fix MulticastSendingMessageHandler (#2329)
* INT-4366: Fix MulticastSendingMessageHandler

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

Fix race condition in the `MulticastSendingMessageHandler` around
`multicastSocket` and super `socket` properties.

* Synchronize around `this` and check for the `multicastSocket == null`.
This let the `MulticastSendingMessageHandler` to fully configure and
prepare the socket for use.
* Remove `socket.setInterface(whichNic)` since it is populated by the
`InetSocketAddress` ctor before

**Cherry-pick to 4.3.x**

* Fix thread leaks in TCP/IP tests
2018-01-19 12:34:57 -05:00
Gary Russell
8aa91d1db0 Shutdown test executors in -core
- don't use `ExecutorService` as `@Bean` - spring can't stop them
- also add log adjuster for ftp test that sometimes fails
2018-01-19 10:21:55 -05:00