Commit Graph

9866 Commits

Author SHA1 Message Date
Gary Russell
8ad802cdfe GH-3062: Fix Mail Tests Hang
Resolves https://github.com/spring-projects/spring-integration/issues/3062

Reliably stop the test mail servers before the test context is destroyed.
2019-09-24 16:55:32 -04:00
Artem Bilan
b12657c599 Document RSocket support
* Fix some typos in `webflux.adoc` and `dsl.adoc`
* Make `FunctionsTests.kt` more Kotlin friendly
* Improve RSocket components and tests for them,
especially rely on the default `RSocketStrategies` in the
target SF RSocket components
* Rework `ServerRSocketConnector.setClientRSocketKeyStrategy` to use the whole `MessageHeaders` for consultation.
It turns out that just destination is not enough since it can be used from different clients
* Make the key based on the provided `setupData` by default
* Include all the `MessageHeaders` into the `RSocketConnectedEvent`

* Improve Docs according review feedback and Docs in SF

Doc polishing
2019-09-24 14:55:04 -04:00
Artem Bilan
21335812a3 Remove IntegrationNode.Stats.deprecated const 2019-09-22 09:34:48 -04:00
Gary Russell
a550ebfaad Fix test after previous commit
- the deprecated field is now last instead of first
2019-09-21 11:34:47 -04:00
Gary Russell
7d949f7f8a Fix Sonar issues 2019-09-21 09:40:25 -04:00
Gary Russell
58c0b9885b Add failure counter to AbstractMessageSource
* Clear timers in AMH.destroy()
2019-09-20 10:53:18 -04:00
Artem Bilan
aa29bb15e3 Guard Micrometer stats for NPE: no Micrometer
If there is no Micrometer in classpath, the `timers` and `counters`
are not populated into Graph

* Check for `null` before calling `Supplier`
2019-09-20 09:45:04 -04:00
Artem Bilan
c4ec73f9a0 Fix Checkstyle violation 2019-09-20 09:30:22 -04:00
Gary Russell
87840bcfe4 GH-3056: Add Micrometer Metrics to Runtime Graph
Resolves https://github.com/spring-projects/spring-integration/issues/3056

* Retrieve meters each time the graph is rendered, not just when it is built.
2019-09-20 09:15:55 -04:00
Artem Bilan
528203e606 Upgrade dependencies
* Use a `dependencyManagement` for those projects which bring BOMs
* Fix `RSocketOutboundGateway` for the latest SF
2019-09-18 17:31:27 -04:00
Artem Bilan
50c6f3a30c GH-3054: Resolve deprecation for WebFlux module
Fixes https://github.com/spring-projects/spring-integration/issues/3054
2019-09-13 18:36:10 -04:00
Gary Russell
3e30625ac9 Fix FtpServerOutboundTests.allEvents test
Spurious events captured from other tests.
Only capture events for the test's session.
2019-09-13 16:59:06 -04:00
Gary Russell
185d370415 Back to Spring Snapshots and other upgrades 2019-09-13 16:42:02 -04:00
Artem Bilan
9272782a48 GH-3052: Fix custom converters for lambdas
Fixes https://github.com/spring-projects/spring-integration/issues/3052

Starting with version `5.1`, a `LambdaMessageProcessor` is based on the
`MessageConverter` instead of plain `ConversionService`.
(A `ConfigurableCompositeMessageConverter` is used from the application
context.)
However a type conversion based on the `@IntegrationConverter` is lost
in the `GenericMessageConverter`  because it doesn't use an
`integrationConversionService` from the application context

* Change `ConfigurableCompositeMessageConverter` to configure a
 `GenericMessageConverter`  with an  `integrationConversionService`
 if any
* Fix `MessagingMethodInvokerHelper` to populate a `BeanFactory` into
its internal `ConfigurableCompositeMessageConverter`
* Ensure in the `LambdaMessageProcessorTests` that
`@IntegrationConverter` is applied for ``LambdaMessageProcessor` as well

**Cherry-pick to 5.1.x**
2019-09-13 18:37:33 +01:00
Artem Bilan
1e93d51697 (S)FTP tests: Add missed @DirtiesContext
Related to: https://build.spring.io/browse/INT-MASTERSPRING40-826/

If we don't close application context on the embedded (S)FTP server,
we my still have some session opened in other tests, which would cause
some unexpected behavior like extra `SessionClosedEvent` in the
test for FTP events
2019-09-11 13:36:56 -04:00
Artem Bilan
87f5409677 Fix more Sonar smells for GatewayProxyFactoryBean 2019-09-09 08:54:20 -04:00
Artem Bilan
6da8112f6e Polishing What's New
* Move FTP `chmod` support into the (S)FTP changes: it is not a new
component
2019-09-08 12:49:07 -04:00
Artem Bilan
f68cf28de7 Fix new Sonar smells for GatewayProxyFactoryBean 2019-09-07 10:58:21 -04:00
Spring Buildmaster
a041546e67 [artifactory-release] Next development version 2019-09-06 18:28:24 +00:00
Spring Buildmaster
9e82481f34 [artifactory-release] Release version 5.2.0.RC1 2019-09-06 18:28:18 +00:00
Artem Bilan
29bebdba97 GH-3047: Add GatewayProxySpec for Java DSL
Fixes https://github.com/spring-projects/spring-integration/issues/3047

* Improve `GatewayProxyFactoryBean` to determine the return type of the
method call from the interface generic types, when the `serviceInterface`
is a `java.util.function.Function`
* Propagate `MethodArgsHolder` as a `rootObject` for SpEL evaluations
* Deprecate `#gatewayMethod` and `#args` evaluation context variables
in favor of `MethodArgsHolder` as root object.
They will be removed in the future release and a single
`EvaluationContext` will be used for all the gateway expressions
* Introduce an
`IntegrationFlows.from(Class<?> serviceInterface, Consumer<GatewayProxySpec> endpointConfigurer)`
to allow to configure any valid gateway proxy options similar to what
we have with the `<gateway>` and `@MessagingGateway`.
This way we are very close to consistency between different approaches

* * Remove `default` prefix from `GatewayProxySpec` options
* Document the change
2019-09-06 13:46:16 -04:00
Artem Bilan
c668a046e1 Upgrade dependencies to the stable Milestones
* Prepare for release
2019-09-06 09:49:55 -04:00
Artem Bilan
b9478ace95 Upgrade dependencies; fix some typos in docs 2019-09-05 15:30:57 -04:00
Artem Bilan
9a43726ca7 Fix new Sonar smell 2019-09-05 10:22:32 -04:00
Artem Bilan
e2d891a32d Fix new Sonar smells 2019-09-04 11:40:23 -04:00
Artem Bilan
a95c76e4d7 RSocket requests: Add per message metadata support
* Use convenient `Consumer` API to avoid external iteration for
`setupMetadata` in the `ClientRSocketConnector`
* Add `routeVars` and `metadata` support into the `RSocketOutboundGateway`
* Cover new options in the XML and Java DSL configurations
2019-09-03 15:56:39 -04:00
Artem Bilan
444c1f9913 RSocket: Add support for RoutingMetadata
Related to https://github.com/spring-projects/spring-framework/issues/23137

The metadata in Spring Messaging for RSockets now supports any
arbitrary objects for setup payload, including composition.

* Switch the `ClientRSocketConnector` to fully delegate to the
`RSocketRequester.Builder` inheriting possible metadata encoding/decoding
in the target `RSocketRequester` implementation
* Turn off a default `dataMimeType` from the `MimeTypeUtils.TEXT_PLAIN`
to the `null` by default relying on the encoder/decoder logic in the
target RSocket wrappers
* Expose more delegating options in the `ClientRSocketConnector`, like
`setupRouteVars`,  `setupMetadata`
2019-09-03 14:22:36 -04:00
Artem Bilan
fd7e7dbaf3 Fix Sonar smells in JpaExecutor 2019-08-31 18:18:20 -04:00
Artem Bilan
3dc0fb5980 GH-3041: Deprecate RedisUtils.isUnlinkAvailable()
Fixes https://github.com/spring-projects/spring-integration/issues/3041

Some Redis clients/servers don't allow to perform an `INFO` command,
therefore we are not able to determine if we can perform `UNLINK` or
not.

* Deprecate `RedisUtils.isUnlinkAvailable()` as not reliable source of
through; use trial with fallback algorithm in the target logic around
`UNLINK` command calls.

**Cherry-pick to 5.1.x**
2019-08-30 13:02:59 -04:00
Artem Bilan
554f2233f5 Fix some Sonar smells and typos in JavaDocs 2019-08-30 10:54:15 -04:00
Artem Bilan
5b43b6c7dd GH-2890: Document a bridge for subflow starts
Fixes https://github.com/spring-projects/spring-integration/issues/2890

Explain in a docs why and how a `bridge` appears in the flow when we
declare a subflow for mapping

* Upgrade to Kotlin `1.3.50`

* Upgrade to Kotlin `1.3.50`
* Polishing Doc according PR comments

Doc polishing
2019-08-29 14:52:30 -04:00
Artem Bilan
075086775d GH-3038: Delegate more RemoteFileTempalte options
Fixes https://github.com/spring-projects/spring-integration/issues/3038

* Add more delegating setters into the `AbstractRemoteFileOutboundGateway`
for its `RemoteFileTemplate` property
* Restrict externally provided `RemoteFileTemplate` from modifications
in the `AbstractRemoteFileOutboundGateway`: those options must be
configured on that external `RemoteFileTemplate`
* Expose new options in the Java DSL specs
2019-08-29 11:20:52 -04:00
Artem Bilan
1b892fc7a4 Fix Sonar smells in the FtpSession 2019-08-29 10:19:45 -04:00
Artem Bilan
ca8377da9b GH-3017: Expose cancel-idle-interval XML attribute
Fixes https://github.com/spring-projects/spring-integration/issues/3017

* Expose also a `ImapIdleChannelAdapterSpec.cancelIdleInterval()` option
* Deprecate useless `ImapMailInboundChannelAdapterSpec.cancelIdleInterval()`

* Fix language in the Doc
2019-08-28 17:17:10 -04:00
Artem Bilan
6d0757a08a Improve ImapIdleChannelAdapter (#3045)
* Improve ImapIdleChannelAdapter

* We should not destroy a `TaskExecutor` in the `stop()`, especially
when we are going to restart eventually.
Move that logic into `destroy()`
* we should not destroy `MailReceiver` in the `stop()`; we don't
reinstate it in the `start()`.
Move the logic into `destroy()`
* Wrap `ReceivingTask` and `IdleTask` into `isRunning()` condition to
avoid task executions when we are in stopped state
* Remove `ImapMailReceiverTests.testExecShutdown()` since it is not
relevant any more and doesn't reflect `mail` module requirements

* * Add `ImapMailReceiver.cancelPing()` hook
* Also close folder for each `stop()`, as well as in the `destroy()`
2019-08-28 17:13:29 -04:00
Artem Bilan
4db71d751a GH-3035: Include INT_ prefix into PK constraints
Fixes https://github.com/spring-projects/spring-integration/issues/3035

To avoid names collision for primary key indexes on the target schemas
include an `INT_` prefix to names for the PKs in Spring Integration SQL
scripts.
Also fix the Docs for mentioned PKs
2019-08-28 16:07:12 -04:00
Artem Bilan
a756e6334d GH-3043: Add FileHeaders.REMOTE_HOST header (#3044)
* GH-3043: Add FileHeaders.REMOTE_HOST header

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

* Populate a `FileHeaders.REMOTE_HOST` from the
`AbstractRemoteFileStreamingMessageSource` and "get"-based commands
in the `AbstractRemoteFileOutboundGateway`
* Extract the value from the a `Session.getHost()` contract
* The `AbstractInboundFileSynchronizingMessageSource` cannot be
addressed with this because the real message is already based on the
locally stored file
* Adjust some affected tests according our code style requirements

* * Add remote file info support into `AbstractInboundFileSynchronizingMessageSource`
* Introduce a `MetadataStore` functionality into the `AbstractInboundFileSynchronizer`
to gather a remote file info an save it in the URI style against local file
* Retrieve such an info in the `AbstractInboundFileSynchronizingMessageSource`
during local file polling
* Introduce `protocol()` contract for the `AbstractInboundFileSynchronizer`
to build a proper URI in the metadata for external readers to distinguish
remote files properly
* Document the feature

* * Fix some typos in Docs

* * Rename property and header constant to the `HOST_PORT` pair
* Fix typos in Docs
* Add  `remote-file-metadata-store` and `metadata-store-prefix` into XSD
of (S)FTP Inbound Channel Adapters
* Add `remoteFileMetadataStore` and `metadataStorePrefix` options
into `RemoteFileInboundChannelAdapterSpec` for Java DSL
2019-08-28 08:58:13 -04:00
Artem Bilan
ff15d5265d Align RSocket module with the latest SF
* Upgrade to RSocket API `1.0.0-RC3-SNAPSHOT`
* Use the same `rSocketMessageHandler.responder()` callback
for client and server rsocket factories configuration
* Clean up `ClientRSocketConnector` and `ServerRSocketConnector`
JavaDocs not mentioning overriding any more
* Use `WellKnownMimeType.MESSAGE_RSOCKET_COMPOSITE_METADATA` constant
instead of built-in literal
* Fix `RSocketOutboundGatewayIntegrationTests` according the SF changes
2019-08-27 16:46:57 -04:00
Frank Fiorante
5073da8a1b Fix Typo in Flow Validation 2019-08-22 15:47:32 -04:00
Artem Bilan
d26ee1db4a Fix sporadic AMQP test failure
https://build.spring.io/browse/INT-MASTER-1694

Use `receive(timeout)` on the AMQP channel and with 10 seconds interval
for the proper wait period instead of artificial short `do...while`
2019-08-21 10:22:37 -04:00
Gary Russell
62d472f679 Fix Sonar issue 2019-08-21 09:05:51 -04:00
Artem Bilan
f600361237 GH-3010 Add idleBetweenTries for JdbcLockRegistry
Fixes https://github.com/spring-projects/spring-integration/issues/3010

Sometimes `100` milliseconds interval is too often to try to obtain a
lock with `UPDATE/INSERT` queries

**Cherry-pick to 5.1.x**
2019-08-20 17:15:25 -04:00
Mike Gorodilin
f0807fe704 Usage clarification of the group-timeout property
Added some clarification on the usage of  the group-timeout property based on discussion 
https://stackoverflow.com/questions/48230453/issue-with-spring-integration-aggregator-group-timeout-value

* Update aggregator.adoc

Fixed according to one sentence per line rule.
2019-08-20 10:07:18 -04:00
Artem Bilan
8d1d0eca28 Fix WebFluxDslTests for SF changes 2019-08-20 10:06:18 -04:00
Artem Bilan
b7e928b846 GH-3024 Move Error Handling Docs to the top level
Fixes https://github.com/spring-projects/spring-integration/issues/3024

To avoid confusing about `errorChannel` header behavior and make it more
clear how to handle errors in Spring Integration flows, it would be
better to present an `Error Handling` chapter on the top level.
So, now it is a first chapter of the `Appendices` section
2019-08-19 16:14:55 -04:00
Artem Bilan
a835a63aad Apply changes from 5.1 for StandardRotationPolicy
Related to https://github.com/spring-projects/spring-integration/issues/3027

* Remove `Assert.isTrue()` from the `onRotation()` to make the behavior
as void in case of non-standard `MessageSource` provided
* Add JavaDocs into `onRotation()` to describe the behavior and
possibility to override
2019-08-19 13:34:12 -04:00
Artem Bilan
503d001293 Fix AMQP CF publisher confirms type usage
Related to https://github.com/spring-projects/spring-amqp/issues/1067
2019-08-19 12:04:55 -04:00
Artem Bilan
35dd0c2c8a Remove unused imports in the Log4j2LevelAdjuster 2019-08-18 10:53:33 -04:00
Artem Bilan
b01982de41 Fix new Sonar smells 2019-08-18 10:49:24 -04:00
Gary Russell
69dd180d0c JUnit 5 Log Level Adjuster
* Fix copyright, javadoc.
2019-08-16 10:36:23 -04:00