Commit Graph

9145 Commits

Author SHA1 Message Date
Gary Russell
48e8b14475 INT-4463: Full access to MqttConnectOptions
JIRA: https://jira.spring.io/browse/INT-4463

Certain options, such as `maxInFlight` were not exposed.

Deprecate the setters on the factory and allow the user to inject a pre-configured
`MqttConnectOptions`, thus making all (and any new) properties available to be
configured.

# Conflicts:
#	spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/MqttAdapterTests.java
2018-05-07 12:45:44 -04:00
Artem Bilan
8a7cf6cc65 INT-4464 Check ZKMetadataStore.running before use
JIRA: https://jira.spring.io/browse/INT-4464

A `ZookeeperMetadataStore.get()` is based on the `this.cache` variable.
This one is initialized in the `start()`.

* Assert `isRunning()` in the `get()` before using.

**Cherry-pick to 5.0.x and 4.3.x**
2018-05-07 11:34:02 -04:00
Artem Bilan
9409d33296 Use Lettuce Redis client; Redis module fixes (#2435)
* Use Lettuce Redis client; Redis module fixes

The Lettuce client is based on the Netty and more stable, than Jedis
therefore we get a performance improvement for tests
(it saves us at about 30 seconds).
Also this client doesn't fail for me on Windows sporadically (very often)
 with the `ConnectionClosedException`

* After switching to the Netty-based client, we expose the interrupted
Thread issue in the `LockRegistryLeaderInitiator`.
If we interrupted (expected behavior), we try to unlock calling
`RedisLockRegistry`, but Netty client reject our request because the
thread is interrupted, therefore we never delete the lock when we yield
our leadership.
Fix the issue with shifting a `RedisTemplate.delete()` operation to the
`ExecutorService` when the current thread is interrupted
* Allow to configure such an `ExecutorService` and timeout to wait for
the `submit()` result
* Refactor `RedisAvailableRule` and all the Redis tests do not expose
the target `RedisConnectionFactory` implementation.
* Make all the test-cases based on the `connectionFactory` created by
the `RedisAvailableTests.setupConnectionFactory()`
* Tweak some unnecessary timeouts and sleeps for better tests task
throughput

* Add a `Log4j2LevelAdjuster` into the `RedisLockRegistryLeaderInitiatorTests`
2018-05-04 14:53:27 -04:00
Artem Bilan
87757e16b1 Add small sleep between adding message to group
https://build.spring.io/browse/INT-FATS5IC-497

Fixes `JdbcMessageStoreTests` sporadic failure where there is no
guarantee that message are going to be polled from the group the same
order they've been inserted

Cherry-pick to `5.0.x`

(cherry picked from commit 664d67f)
2018-05-04 13:06:55 -04:00
Gary Russell
2919b30950 INT-4461: Support byte[] in #jsonPath
JIRA: https://jira.spring.io/browse/INT-4461

Convert `byte[]` to `String` using `URF-8` by default.

Add optional evaluate methods to JsonPathUtils with a Charset to use when
converting `byte[]` to `String`.

This is not currently exposed using SpEL. It can be done, but probably not worth
the effort until somebody asks for it.

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

* Use `BAIS`

(cherry picked from commit e987387)
2018-05-04 12:10:50 -04:00
Gary Russell
e10150cc75 Upgrade SF to 5.0.6.B-S 2018-05-02 12:16:50 -04:00
Artem Bilan
091e94efea Fix import in JmsDslKotlinTests.kt
https://build.spring.io/browse/INT-SI50X-43

Expire message groups for the `JdbcMessageStoreTests`

https://build.spring.io/browse/INT-FATS5IC-494
2018-05-01 10:24:45 -04:00
Artem Bilan
d9fb0c6ac8 INT-4458: Do not expose recursive generics API (#2432)
* INT-4458: Do not expose recursive generics API

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

According Kotlin generics system restrictions we can't expose API
based on the recursive generics, like we have with Java DSL for JMS

* Replace explicit recursive generics on factory method with the wildcard (`?`).
This way both Kotlin and Java are able to instantiate target object and perform
the proper chain API auto-completion
* Fix `JmsInboundChannelAdapterSpec` to deal with provided `S` type for the
`configureListenerContainer()` - the way we can configure a `JmsDefaultListenerContainerSpec`
* Add `kotlin-spring` Gradle plugin to avoid extra `open` modificator on `@Bean` methods
* Add `JmsDslKotlinTests.kt`

**Cherry-pick to 5.0.x excluding Kotlin support**

* Fix `Amqp` DSL factory for recursive generics

* Polishing for Kotlin tests
2018-05-01 08:47:38 -04:00
Gary Russell
5a752a3e40 Revert asciidoctor plugin 2018-04-27 14:53:03 -04:00
Artem Bilan
61cec467c7 INT-4456: Explicit methods for Kotlin lambdas
JIRA: https://jira.spring.io/browse/INT-4456

Since Kotlin compiles lambdas different way than Java, they are not
synthetic classes at runtime anymore.
Therefore we fallback to the method invocation logic, but since Java 8
interfaces has `default` methods as well the `MessagingMethodInvokerHelper`
can't select the target method for invocation

* Use explicit `Function.apply()` for non-synthetic implementations
* Add `RouterDslTests` Kotlin-based test-case

**Cherry-pick to 5.0.x**

* Add more explicit methods for invokers
2018-04-27 14:48:14 -04:00
Artem Bilan
b0be46a761 Fix logic in the PollingTransactionTests
The `transactionWithCommitAndAdvices()` uses `SimpleRepeatAdvice`
which essentially performs `doPoll()` twice.
In this case we don't have enough messages in the `goodInputWithAdvice`
queue

* Add one more message to the `goodInputWithAdvice` queue during testing
* Increase all the timeouts
* Increase capacity in queues for the `transactionWithCommitAndAdvices()`

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

(cherry picked from commit 000f297)
2018-04-26 09:23:42 -04:00
Artem Bilan
a48d54bed9 INT-4351: Add DiscardAwareFileListFilter
JIRA: https://jira.spring.io/browse/INT-4351

The `WatchService` reacts to the events in the file system and keep
track ove the events until we poll them, e.g. via `listEligibleFiles()`
in the `WatchServiceDirectoryScanner`.
On the other hand the `SourcePollingChannelAdapter` calls the mentioned
`listEligibleFiles()` according its polling period.
At this moment the `FileListFilter` is applied to the polled files.
It may happen that `LastModifiedFileListFilter` can't accept too young
files yet and they are lost for the future consideration.

* To allow, for example, to retain young files by the
`LastModifiedFileListFilter` judgment for the future cycles add
`DiscardAwareFileListFilter` with the `DiscardCallback` support.
The `WatchServiceDirectoryScanner` now registers such a callback into
the filter and stores discarded files into the `filesToPoll` queue
for the future poll cycle.

**Cherry-pick to 5.0**

Fix compilation warnings

* Replace `DiscardCallback` with the plain `Consumer`
* Ensure uniqueness in the `WatchServiceDirectoryScanner` internal
queue via a `Set` implementation, since discard callback may be called
several times for the same file from the `CompositeFileListFilter`
according to its nature
* Add JavaDocs and Docs

Change `@since` to `5.0.5`
2018-04-24 14:28:20 -04:00
Gary Russell
10805e5b8a INT-4455: Fix NPE in Exception router
JIRA: https://jira.spring.io/browse/INT-4455

When using java config, `setChannelMapping` NPEs due to no AC.

**cherry-pick to 4.3.x, and to master, removing AC check**

* Polishing - PR comment
2018-04-24 12:21:55 -04:00
Artem Bilan
98223b0507 Fix JdbcMessageStoreTests to use H2, not Derby
Looks like Derby is much slower than H2, plus it doesn't look so stable
having so much sporadic failures.

Looks like moving to H2 here saves for us `500 ms` test working time

**Cherry-pick to 5.0.x**

(cherry picked from commit 6dfe96d)
2018-04-23 12:55:31 -04:00
Artem Bilan
aca3212e9d Fix JdbcMessageStoreChannelTests race condition
The message in the `QueueChannel` appears for consuming a bit earlier
than TX is committed

* Introduce `afterCommitLatch` into the test verify the state
when TX is really committed and data is removed from DB

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

(cherry picked from commit e4e4ee0)
2018-04-20 09:41:38 -04:00
Artem Bilan
87a8008c3f Fix some sporadic tests failures
https://build.spring.io/browse/INT-MASTER-1004/

(cherry picked from commit 1f6f70b)
2018-04-19 17:37:37 -04:00
Artem Bilan
f764b528cd Downgrade to Derby-10.13.1.1
Looks like we have started to fail much often
since upgrade to the `Derby-10.14.1.0`:
cb0d43db6b

That is also related to this https://jira.spring.io/browse/INT-4445

* Remove all the `drop` mentioning for Derby scripts -
it just doesn't support `IF EXISTS`.
More over we don't need to worry about drops since each test now starts
its own fresh embedded DB

**Cherry-pick to 5.0.x**
2018-04-19 15:03:23 -04:00
Artem Bilan
c5795fb8c8 Fix import for PatternMatchUtils
https://build.spring.io/browse/INT-SI50X-32/
2018-04-19 13:31:04 -04:00
Artem Bilan
62c15a6a97 INT-4446 Improve EmbeddedJsonHeadersMessageMapper (#2422)
* INT-4446 Improve EmbeddedJsonHeadersMessageMapper

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

* Do not recreate message if not necessarily
* Do not let to generate `id` and `timestamp` if they are not mapped
* Use `smartMatch` to allow to configure negative patterns
* Introduce `PatternMatchUtils.smartMatchIgnoreCase()` for convenience

**Cherry-pick to 5.0.x**

* * Polishing `EmbeddedJsonHeadersMessageMapper`
2018-04-19 13:23:22 -04:00
Artem Bilan
38ec9a16a6 INT-4447: LockRegLeaderInit: Catch unlock errors
JIRA: https://jira.spring.io/browse/INT-4447

When we get an exception during `this.lock.unlock()`, we don't revoke
leadership.
In case of external resource (e.g. JDBC) this may cause a race condition
when the second candidate is selected as leader when connection comes back

* Catch `this.lock.unlock()` exceptions and log them under DEBUG.
This way we proceed to the `handleRevoked()` logic

**Cherry-pick to 5.0.x and 4.3.x**
2018-04-18 17:08:21 -04:00
Artem Bilan
dc095322a2 INT-4448, INT-4449: Fix Gateway for no-arg method (#2420)
* INT-4448, INT-4449: Fix Gateway for no-arg method

JIRA: https://jira.spring.io/browse/INT-4448
JIRA: https://jira.spring.io/browse/INT-4449

When we are not interested in the `payload` to send, we use a gateway
method without any args, but in this case for send operation (or
send-and-receive) we should specify a default `payloadExpression`

The `MessagingGatewayRegistrar` fails with `NPE` if we don't have a
any global headers and have `defaultPayloadExpression`

Also in this case the `GatewayProxyFactoryBean` fails to send
and fallbacks to receive with the meaning "no args, not payloadExpression"

* Fix `MessagingGatewayRegistrar` to check `hasDefaultHeaders` before
processing them
* Fix `GatewayProxyFactoryBean` to consult `this.globalMethodMetadata`
if there is no `payloadExpression` for the method specific metadata

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

* Remove `oracle-java8-installer` since it looks like the resource
is not available anymore:

```
Location: http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz?AuthParam=1523990114_ee8c82cbe67bc87d192cb79d3b902d2f [following]
--2018-04-17 18:33:14--  http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz?AuthParam=1523990114_ee8c82cbe67bc87d192cb79d3b902d2f
Connecting to download.oracle.com (download.oracle.com)|23.53.120.105|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-04-17 18:35:15 ERROR 404: Not Found.
```
2018-04-18 13:49:58 -04:00
Artem Bilan
7d8fd16e0c INT-4445: Fix JDBC tests for Derby
JIRA: https://jira.spring.io/browse/INT-4445

Looks like `/dataSource` temporary directory is busy in between different
tests.
The thought is like a high-frequently polling endpoint keeps DB resource
from removing.

* Explicitly `stop()` endpoint in the `JdbcMessageStoreChannelTests`
* Optimize
`JdbcMessageStoreChannelTests.testSendAndActivateTransactionalSend()`
to rely on the short `1` millisecond TX timeout.
This safes for us 10 seconds of the tests executions.
* Configure all the embedded DB beans for the `ignore-failures="ALL"`
as a fallback option if polling endpoint is not a cause of the concurrent
resource access.

**Cherry-pick to 5.0.x**
2018-04-09 14:42:41 -04:00
Spring Buildmaster
9c62d9d049 [artifactory-release] Next development version 2018-04-04 19:19:36 +00:00
Spring Buildmaster
83212c8f7c [artifactory-release] Release version 5.0.4.RELEASE 2018-04-04 19:19:29 +00:00
Artem Bilan
921a337aa6 Upgrade to SS-5.0.4, Dep Management Plugin 1.0.5 2018-04-04 14:48:31 -04:00
Artem Bilan
862baae774 Comment out libs-staging-local repo 2018-04-04 12:28:14 -04:00
Artem Bilan
a40fd6afa6 Upgrade to some latest Spring dependencies 2018-04-04 11:46:21 -04:00
Artem Bilan
141166c992 Upgrade to Reactor-3.1.5 and Reactor-Netty-0.7.6 2018-04-03 12:01:59 -04:00
Artem Bilan
29b60c2932 INT-4438: No lifecycle twice in the same role
JIRA: https://jira.spring.io/browse/INT-4438

The `SmartLifecycleRoleController` is based on the `MultiValueMap`
which used internally a `List` for the values.
With such an architecture we can add the same value several times.
On the other hand we are iterating over `Lifecycle`s in the role and
build a `Map` for their running status.
In this case when `NamesComponent`s return the same name the Java
`Collectors.toMap()` fails with a duplicate key error.

In any cases it would be better do not allow to add the same lifecylce
several time to the role or different with the same name.

* Add search logic to the `addLifecycleToRole()` to fail fast with the
`IllegalArgumentException` because a lifecycle with the same name is
already present in the role

**Cherry-pick to 5.0.x**

* Remove redundant `this.initialized = false` from the
`AbstractPollingEndpoint.doStop()`

Add `allEndpointsRunning()` verification to the `EndpointRoleParserTests`

Polishing
2018-04-02 17:33:59 -04:00
Artem Bilan
9ce329f1c6 Increase timeout for PollingConsumerEndpointTests
https://build.spring.io/browse/INT-SI50X-20

Looks like 5 seconds is not enough to wait for the test completion,
especially on CI server

* Refactor `PollingConsumerEndpointTests` to use `OnlyOnceTrigger`
from the test-support module instead of local `Trigger` implementation
* Increase timeout for latch in the `OnlyOnceTrigger` to 10 seconds

**Cherry-pick to 5.0.x**

(cherry picked from commit a65d05c)
2018-04-02 14:48:29 -04:00
Artem Bilan
de9aeac8bf Fix NPE in the TcpNetServerConnectionFactory
https://build.spring.io/browse/INTSAMPLES-NIGHTLY-2413

When we fail with the
`java.net.BindException: Address already in use (Bind failed)` in the
`TcpNetServerConnectionFactory.run()`, the `serverSocket` property
remains `null` and we get `NPE` in the `catch` block trying to `close()`
the socket.

* Call `stop()` instead which has all the required protections.

**Cherry-pick to 5.0.x and 4.3.x**
2018-04-02 13:37:26 -04:00
Artem Bilan
04a61f1dd5 Fix Transformers usage in Docs
**Cherry-pick to 5.0.x**

(cherry picked from commit 8afdcb4)
2018-03-27 12:23:54 -04:00
Gary Russell
2277675c40 INT-4443: Use SimpleEC for uriVariablesExpression
JIRA: https://jira.spring.io/browse/INT-4443

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

Polishing; use data binding accessor in test evaluation contexts.

Add `.withInstanceMethods()`

See https://jira.spring.io/browse/SPR-16588?focusedCommentId=158041&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-158041

* Polishing according PR comments

# Conflicts:
#	build.gradle
#	src/reference/asciidoc/changes-4.3-5.0.adoc
2018-03-26 16:56:46 -04:00
Artem Bilan
f49b0ac40c Upgrade to H2 1.4.197
https://build.spring.io/browse/INT-FATS5IC-457

The H2 `1.4.197` has fixed some issues
(in particular https://github.com/h2database/h2database/issues/178)
and introduced some breaking changes for us, although they are
reasonably good.

* Fix `JdbcOutboundGatewayParserTests` to use correct identifiers
for returned generated keys instead of previously used `SCOPE_IDENTITY()`

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

(cherry picked from commit 7b86ca7)
2018-03-26 12:25:31 -04:00
Artem Bilan
d6ae8be690 Reorder beans in JdbcPollingChAParserTests cofigs
https://build.spring.io/browse/INT-AT42SIO-820/

The test configs use `fixed-rate="100"`.
This way when Inbound Channel Adapter is declared earlier in the
config than `<jdbc:embedded-database>`, there is a chance that we start
to poll DB before it is really initialized.

* Reorder config so embedded DB is initialized before an
Inbound Channel Adapter

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

(cherry picked from commit da6f47c)
2018-03-26 11:08:35 -04:00
Nathan Kurtyka
2b6cafdba4 INT-4440: Support serialized UUID in headers
JIRA: https://jira.spring.io/browse/INT-4440

The previous fix eliminated an extra `generateId()` call, but at the
same introduced regression do not populate `id` and `timestamp` from
the serialized state, e.g. after JSON transferring over the network

* Introduce a couple utility methods in the `MutableMessageHeaders`
to extract and parse `id` and `timestamp` from the provided headers

**Cherry-pick to 5.0.x**

(cherry picked from commit ae2aa8b)
2018-03-23 10:02:11 -04:00
Gary Russell
a5c16fa0ac Fix AMQP MessageSource Tests
https://build.spring.io/browse/INT-MASTER-983/

Race between the poller and template to get the requeued message.

Also add trace logging to the acknowledgment.

**cherry-pick to 5.0.x**

# Conflicts:
#	spring-integration-amqp/src/test/java/org/springframework/integration/amqp/inbound/AmqpMessageSourceIntegrationTests.java
2018-03-22 18:19:10 -04:00
Gary Russell
cc63104f11 INT-4439: Micrometer Docs Polishing
JIRA: https://jira.spring.io/browse/INT-4439
2018-03-22 15:28:45 -04:00
Gary Russell
cb3c7a0036 INT-4441: Fix ACMH Concurrency Problem
JIRA: https://jira.spring.io/browse/INT-4441

Possible concurrent updates to `AbstractCorrelatingMessageHandler.groupIds` and
`expireGroupScheduledFutures`.

(cherry picked from commit f9d5198)
2018-03-22 15:27:10 -04:00
Artem Bilan
f9da4382c2 INT-4434: Allow to use sub-flows from beans
JIRA: https://jira.spring.io/browse/INT-4434

There were a restriction introduced since Java DSL `1.2` do not use
`IntegrationFlow` beans for sub-flow definitions, e.g. in routers.
It is considered as regression by community because it worked before
in version `1.1`

* Introduce `IntegrationFlow.getInputChannel()` to be able to bridge
from the main flow to the flow which is treated as sub-flow.
In most cases we talk about an independent bean for the `IntegrationFlow`
which can be used as a stand along one and as a sub-flow in other flow

**Cherry-pick to 5.0.x**

Add JavaDocs to the `EndpointSpec.obtainInputChannelFromFlow()`
2018-03-22 14:38:36 -04:00
Artem Bilan
2d3924a7e6 INT-4433: Optimize @Publisher metadata
JIRA: https://jira.spring.io/browse/INT-4433

The current `MessagePublishingInterceptor` behavior is to parse expressions
on each method invocation what is not so efficient at runtime

* Introduce `default` `Expression`-based method to the `PublisherMetadataSource`
contract and call existing String-based methods for backward compatibility.
* Deprecate String-based `PublisherMetadataSource` methods in favor of newly
introduced `Expression`-based
* Implement new `getExpressionForPayload()` and `getExpressionsForHeaders()`
in all the `PublisherMetadataSource` implementations
* Cache parsed `Expression` s during initialization in the `PublisherMetadataSource`
implementations or do that on demand in the `MethodAnnotationPublisherMetadataSource`
by provided method basis
* Introduce `MethodAnnotationPublisherMetadataSource#metadataCacheLimit` and populate
its value from the `@EnablePublisher` or `<int:annotation-configuration>`
* Implement `entrySet()` and `values()` in the `ExpressionEvalMap`

**Cherry-pick to 5.0.x**

* Add `@SuppressWarnings("varargs")` to avoid compilation warning

* Remove LRU cache logic - it's fine to cache all the info about methods
in the classpath
2018-03-21 16:35:46 -04:00
Artem Bilan
f19f23f37b LockRegistryLeaderInitiator: Add DEBUG for errors
For better traceability for errors during lock acquiring add DEBUG
logging message in the `catch` block before returning back to the main
loop for the next acquiring attempt

**Cherry-pick to 5.0.x and 4.3.x**
2018-03-21 12:12:02 -04:00
Artem Bilan
a244164aa7 Fix unused imports
https://build.spring.io/browse/INT-MASTER-978/

**Cherry-pick to 5.0.x**

(cherry picked from commit 4f616e9)
2018-03-21 11:49:57 -04:00
Yicheng Feng
4e42aa7285 INT-4432: Mock Handler: fix output channel
JIRA: https://jira.spring.io/browse/INT-4432

The `MockIntegrationContext.substituteMessageHandlerFor()` method
cannot get the correct output channel of target message handler
since the `outputChannel` property is not initialized.

* Use `getOutputChannel()` method instead of directly accessing
the `outputChannel` property. The `getOutputChannel()` method
guarantees the correct value is retrieved.

* Polishing Copyrights and author name
* Simplify `MockMessageHandlerTests.testHandlerSubstitutionWithOutputChannel()`
and its configuration

**Cherry-pick to 5.0.x**

(cherry picked from commit ed00f62)
2018-03-21 11:33:03 -04:00
Artem Bilan
64a37381e0 INT-4437: Scatter-Gather: reinstate replyChannel
JIRA: https://jira.spring.io/browse/INT-4437

The `ScatterGatherHandler` overrides a `replyChannel` header for the
scatter message to its internal queue and doesn't reinstate the original
`replyChannel` header when producer a gather result message

* Rebuild gather result message with population a proper `replyChannel`
header from the request message and removing a `gatherResultChannel`
header

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

Polishing
2018-03-20 16:50:34 -04:00
Ruslan Stelmachenko
ed563b9f3f INT-4430: FileSplitter close reader on exception
JIRA: https://jira.spring.io/browse/INT-4430

When Iterator-based `FileSplitter` splits the file, and an exception
throws in downstream flow (in the same thread), the exception propagates
to the caller leaving underlying file reader opened.

This commit changes `AbstractMessageSplitter` the way, that,
when any exception happens, if Iterator implements `java.io.Closeable`,
its `close()` method will be called before propagating exception.

Also `FileSplitter`'s underlying iterator implements `Closeable` now.

* Make `CloseableIterator` to follow `Closeable` contract.

Now `CloseableIterator.close()` declares `IOException` and can be used
as base interface for `FunctionIterator`.

* Adjust tests.

Adjust tests to reflect the fact that we call `close()` on the reader
one more time in the end of iterator.

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

(cherry picked from commit 7f25cba)
2018-03-16 10:28:39 -04:00
Jon Schneider
9836ec5627 Upgrade to Micrometer 1.0.2
Release notes: https://github.com/micrometer-metrics/micrometer/releases/tag/v1.0.2

(cherry picked from commit f77fd78)
2018-03-15 10:38:53 -04:00
Artem Bilan
fa47b0fa20 INT-4428: MethodParam usage: fix race condition
JIRA: https://jira.spring.io/browse/INT-4428

Using `increaseNestingLevel()` and `decreaseNestingLevel()` is not
thread-safe and may cause a race conditions

* Use `MethodParameter.nested()` instead which creates and cache a new
`MethodParameter` for the nested generic type

**Cherry-pick to 5.0.x**
2018-03-14 09:22:54 -04:00
Artem Bilan
194480d76f GH-2388: Fix HeaderEnricherSpec for adviceChain
Fixes spring-projects/spring-integration#2388

During `HeaderEnricherSpec` refactoring the `adviceChain` population
has been missed, alongside with many other `AbstractReplyProducingMessageHandler`
options from the `ConsumerEndpointSpec`

* Refactor `HeaderEnricherSpec` to build `HeaderEnricher` and an
appropriate `MessageTransformingHandler` from the ctor to be able
to pick up an `adviceChain` automatically in the `ConsumerEndpointSpec.get()`

**Cherry-pick to 5.0.x**
2018-03-13 12:26:09 -04:00
Gary Russell
6718d8d433 INT-4423: Make Micrometer dependency optional
JIRA: https://jira.spring.io/browse/INT-4423

Add a facade on top of micrometer so the dependency can
be optional.t

Next iteration - PR comments

Checkstyle

More polishing; static classes etc.

checkstyle

Further polishing; docs; auto-register `MicrometerMetricsCaptor`.

Polishing - move captor load to a static method on the captor.

* Fix Checkstyle violation
* Some code style polishing
2018-03-09 15:24:29 -05:00