Commit Graph

9744 Commits

Author SHA1 Message Date
Gary Russell
175223d0e0 GH-2974: Fix race in TcpNetConnection.getPayload()
Fixes https://github.com/spring-projects/spring-integration/issues/2974

There is a race in that we could get a `SocketException` in `inputStream`.
Since this is between payloads, it needs to be thrown as a
`SoftEndOfStreamException`.

* * Add javadocs to SoftEndOfStreamException

* * SEOSE is now a RuntimeException (can't be an UncheckedIOException - no default CTOR
2019-06-26 11:15:34 -04:00
Artem Bilan
59cdc4ddae Add validation support into WebFlux Inbound (#2977)
* Add validation support into WebFlux Inbound

See https://stackoverflow.com/questions/56729517/spring-integration-webflux-validate-input-json-body

* Introduce a `WebFluxInboundEndpoint.validator` option to validate
a request payload after conversion HTTP request into a `Publisher`
* Expose a `WebFluxInboundEndpointSpec.validator()` option
* Introduce a `IntegrationWebExchangeBindException` to extend a
`WebExchangeBindException` for Spring Integration use-case.
such an exception is used in the `ResponseStatusExceptionHandler`
extensions, like one in Spring Boot for proper response rendering
* Test and document the solution

* * Remove unused imports from IntegrationWebExchangeBindException
2019-06-26 11:11:33 -04:00
Artem Bilan
97aaf95ccb Polishing RSocket module according SF changes
* Fix Checkstyle violations in the `MessageHistoryConfigurer`
2019-06-24 16:39:30 -04:00
Artem Bilan
e833a44a38 Fix new Sonar smells 2019-06-22 13:43:23 -04:00
Artem Bilan
bda5221720 Fix SmartLifecycle.stop(Runnable) usage (#2973)
* Fix `SmartLifecycle.stop(Runnable)` usage

We always have to call `callback` in the `SmartLifecycle.stop(Runnable)`
implementation independently of component state
* Fix `StandardIntegrationFlow.stop(Runnable)` for a logic when we
don't have any `this.lifecycles`
* Remove those `stop(Runnable)` which are fully equivalent of the
`default` on in the `SmartLifecycle`
* Some other simple polishing for the affected classes, e.g.
`isSingleton()` is `default` with `true` in the `InitializingBean`

**Cherry-pick to 5.1.x**

* * Fix checkstyle violation
2019-06-21 16:50:38 -04:00
Artem Bilan
a75f0808fd Fix HttpHeaderMapper to support MimeType
It turns out that `contentType` header (as well as `Accept`) may be
converted into `MimeType` upstream before the message is sent into HTTP
Outbound Channel Adapter meanwhile the logic is only to support String
and MediaType

* Change the `DefaultHttpHeaderMapper` to support more generic `MimeType`
for the `Content-Type` and `Accept` HTTP headers which can simply be
converted to the expected `MediaType`

**Cherry-pick to 5.1.x & 5.0.x**
2019-06-21 16:45:32 -04:00
Artem Bilan
f04962301d Fix Rsocket module according latest SF changes 2019-06-21 16:19:57 -04:00
Artem Bilan
3ec6b56931 Polishing RSocket module according latest SF 2019-06-20 09:56:07 -04:00
Artem Bilan
d79c06a987 GH-2967: Fix ScatterGatherH for headers copy (#2968)
* GH-2967: Fix ScatterGatherH for headers copy

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

The `ChannelInterceptor` is added into the `this.gatherChannel` on each
request message making a subsequent requests for scatter-gather as
halting on reply.

* Add an interceptor into an injected `this.gatherChannel` only once
during `ScatterGatherHandler` initialization
* Introduce `ORIGINAL_REPLY_CHANNEL` and `ORIGINAL_ERROR_CHANNEL`
headers to carry a request reply and error channels from headers
* Populate `REPLY_CHANNEL` and `ERROR_CHANNEL` headers back before
sending scattering replies into gatherer
* Transfer a `GATHER_RESULT_CHANNEL` header now directly from the scatter
message to make it available in the reply from the gatherer
* Add note about those headers in the `scatter-gather.adoc`
* Modify `ScatterGatherTests` to be sure that `ScatterGatherHandler`
works for several requests

**Cherry-pick to 5.1.x**

* * Fix language in doc
2019-06-19 16:14:11 -04:00
Artem Bilan
36c14ef179 Some polishing for RSocket support 2019-06-18 15:16:34 -04:00
Artem Bilan
244e5942df Fix nohttp for custom whitelist.lines
Looks like we can't have a custom `whitelist.lines` in the `/checkstyle`
dir.

* Move `whitelist.lines` with the `http://www.jcraft.com` entry into the
`/src/nohttp`
* Upgrade `nohttp` to `0.0.3`
* Revert `jsch` URL in the `sftp.adoc`
* Upgrade to Micormeter-1.1.5
2019-06-17 16:55:37 -04:00
Artem Bilan
153a748166 Fix StompMHWebSocketIntTests for reconnect events
https://build.spring.io/browse/INT-MASTERSPRING40-740
2019-06-17 13:02:24 -04:00
Artem Bilan
a77dac5347 Fix new Sonar smells; revert to BUILD-SNAPSHOTs 2019-06-15 10:59:36 -04:00
Spring Buildmaster
62859256d4 [artifactory-release] Next development version 2019-06-14 21:09:55 +00:00
Spring Buildmaster
22d71b84e8 [artifactory-release] Release version 5.2.0.M3 2019-06-14 21:09:51 +00:00
Spring Buildmaster
87593853e1 [artifactory-release] Next development version 2019-06-14 20:49:02 +00:00
Spring Buildmaster
4405bfe680 [artifactory-release] Release version 5.2.0.RELEASE 2019-06-14 20:48:57 +00:00
Gary Russell
1b5c588271 Upgrade Spring Security to 5.2.0.M3 2019-06-14 16:20:01 -04:00
Artem Bilan
3ddc004a8b Fix RSocket adapters for routing metadata support 2019-06-14 16:15:12 -04:00
Artem Bilan
24b8e58938 Upgrade to latest Lettuce Redis driver 2019-06-14 13:38:22 -04:00
Gary Russell
144790e921 Upgrade Spring Framework, AMQP Versions 2019-06-14 13:27:01 -04:00
Artem Bilan
71fbe29da4 Add Docs for Flux Aggregator
* Some test polishing
* Fix not properly wrapped code snippet in the `scripting.adoc`

Doc polishing
2019-06-14 11:32:55 -04:00
Gary Russell
2fb7554dcf Fix new tangle introduced by Control Bus changes
- tangle between `expression` and `endpoint`
- move `Pausable` to `core`
2019-06-14 11:17:34 -04:00
Gary Russell
173eca2963 Upgrade to Spring Data Moore RC1 2019-06-14 10:31:06 -04:00
Gary Russell
0b3421ce6d Upgrade rsocket to 0.12.2-RC4 2019-06-13 16:43:27 -04:00
Gary Russell
70c799f9dd Upgrade reactor milestones 2019-06-13 16:40:52 -04:00
Artem Bilan
1142caf092 Ignore JdbcLockRegLeaderInTests.testLostConnection
https://build.spring.io/browse/INT-MASTER-1584/

Looks like an embedded DBd is not fully cleared
if we don't close application context
2019-06-13 13:00:47 -04:00
Michael Wiles
360c74026a GH-2962: check the whole ctx hierarchy for nullChannel
Fixes https://github.com/spring-projects/spring-integration/issues/2962

* addressing code style removed comments and addressed review comments

**Cherry-pick to 5.1.x**
2019-06-13 11:59:44 -04:00
Artem Bilan
d85d6ee735 INT-3073: Add FluxAggregatorMessageHandler
JIRA: https://jira.spring.io/browse/INT-3073

Add `FluxAggregatorMessageHandlerTests`

* Add `FluxAggregatorMessageHandlerTests`
* Fix `FluxAggregatorMessageHandler` for the default `messageForWindowFlux`
to rely on the `publish().autoConnect()` to build a target `Flux` for
window and also copy headers from the first `Message` in the window.
Looks like `switchOnFirst()` doesn't work somehow with windows or I just
don't use it properly, although it isn't clear how to continue chain but
get the whole `Flux` as a single entry for message payload

* Add more tests for `FluxAggregatorMessageHandlerTests`
* Fix `AbstractMessageSplitter` to cast properly a primitive array

* Implement `Lifecycle` in the `FluxAggregatorMessageHandler`

* Add JavaDocs into the `FluxAggregatorMessageHandler`

Javadoc polishing
2019-06-13 11:13:09 -04:00
Amit Sadafule
45fe5be0cd GH-2956: Add MessageHandler.getMetricsCaptor()
Fixes https://github.com/spring-projects/spring-integration/issues/2956

* Add `getMetricsCaptor.getMetricsCaptor()` for possible customization in the target implementation
* Added dependancy for `@Nullable`

**Cherry-pick to 5.1.x**
2019-06-11 10:27:54 -04:00
Gary Russell
78a0ec74e7 GH-2958: Also Add to Common Header in AMHEMS
Resolves https://github.com/spring-projects/spring-integration/issues/2958

The previous commit added the raw source message to a common header
`IntegrationMessageHeaderAccessor.SOURCE_DATA` so that the spring-cloud-stream
can construct an error message containing the data when using functions.

However, we also need to add it to the common header when the `ErrorMessage`
is created by Spring Integration for the normal message channel binder.

This allows the DLQ processing to be agnostic as to who created the
error message.
2019-06-11 10:14:44 -04:00
Gary Russell
1067f91a8b AMQP: Add bindSourceMessage property (inbound)
Resolves https://github.com/spring-projects/spring-integration/issues/2958
2019-06-10 18:09:47 -04:00
Artem Bilan
0addbe536b Increase wait timeout in the JdbcLockLeaderTests
Looks like latest upgrades for the CI server made virtual machines a bit
slower (less resources are allocated), so we don't have a reasonable
time for switching between threads.
2019-06-10 14:10:54 -04:00
Artem Bilan
1c88ba19d7 Polishing for nohttp plugin
* Move the plugin and its task into the root project configuration
* Add more image file extensions to exclude
* Fix `sftp.adoc` do not use HTTP url for the JSCH library project page;
 use GitHub repo link instead
2019-06-10 13:59:30 -04:00
Gary Russell
703141b433 Reverse check/checkAsciidocLinks order 2019-06-05 15:16:51 -04:00
Gary Russell
8c68255050 Fix doc links; add checkAsciidocLinks to testAll 2019-06-05 14:51:10 -04:00
Gary Russell
466daa8774 TCP: Connect Timeout; Close Stream
- Add `connectTimeout` to client connection factories
- Add `closeStreamAfterSend` to outbound gateway

* Polishing - PR Comments.
2019-06-05 14:38:13 -04:00
Artem Bilan
cd075723e2 Fix new Sonar smells 2019-06-05 10:03:03 -04:00
Artem Bilan
5e7c1ae2e7 Add RSocket Java DSL
* Add `@NonNullApi` for RSocket packages
* Some code style and JavaDocs polishing
2019-06-04 13:50:32 -04:00
Artem Bilan
0c32a57e99 Fix Sonar smells for XML module 2019-05-31 10:44:36 -04:00
Gary Russell
7e0a5e90b4 Build: asciidoc link check improvement
- find all link errors before failing
2019-05-30 18:14:39 -04:00
Artem Bilan
315f0e711f Fix Sonar vulnerabilities for varargs
* Fix smell for static `AmqpInboundGateway.attributesHolder`

* Fix readOnlyHeaders in the `MessageBuilder`
2019-05-30 15:41:53 -04:00
Artem Bilan
1d08d3bdc2 Various Docs build fixes
https://build.spring.io/browse/INT-MASTER-1568/

* Fix `whats-new.adoc` for broken link
* remove `logDocuments = true` from the `build.gradle`
* Change the Gradle task name in the `.travis.yml` for consistency
2019-05-30 15:27:49 -04:00
Gary Russell
2a50a26252 Build: check external asciidoc links
* Check external links have a description

* Use Groovy regex instead of Java

* Add source file name to exception message

* Add 'checkAsciiDocLinks' to Travis build
2019-05-30 15:09:45 -04:00
Artem Bilan
374b4b70f1 GH-2880: Handle Pausable in Control Bus (#2940)
* GH-2880: Handle `Pausable` in Control Bus

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

* Refactor `ControlBusMethodFilter` to handle `Pausable` managed operations
* Optimize and internal `ControlBusMethodFilter.filter()` logic to rely
on the `MergedAnnotations`
* Modify `EnableIntegrationTests` to test new functionality and document
the feature

* * `ControlBusMethodFilter` to deal with plain `Lifecycle` impls as well
2019-05-30 14:10:00 -04:00
Artem Bilan
e9591c6fdf Make spring-ws-core optional for SI-xml
It turns out that `spring-ws-core` brings too much WS stuff which
triggers and auto-configuration to be enabled in Spring Boot app when
we don't expect it.

* The `UnmarshallingTransformer` is already aware of `MimeMessage` and
`MarshallingUtils` being optional, so just remove redundant `public`
modifier for `maybeUnmarshalMimeMessage()` method
* Load `ServletContextResource` class in the `XsltPayloadTransformer`
on demand making such a dependency as optional
2019-05-30 14:08:15 -04:00
Gary Russell
a9a2fccf1f Add @MongoDbAvailable to new test 2019-05-30 10:53:16 -04:00
Artem Bilan
34db267a8a GH-2936: Add custom converters for MongoDbMS
Fixes https://github.com/spring-projects/spring-integration/issues/2936

* Add `MongoDbMessageStore.setCustomConverters()` to allow to inject
any custom converters for `payload` as well as header values

**Cherry-pick to 5.1.x**
2019-05-30 10:36:37 -04:00
Gary Russell
d2d09cd8d8 Upgrade Jackson 2019-05-30 09:39:21 -04:00
Artem Bilan
65c884cec7 Enable nohttp Gradle plugin
* Add `io.spring.nohttp` Gradle plugin into the build script and allow
it only on CI server, since it is going to parse every file
* Fix tests do not use `http` any more
* Fix `test.html` in the `mail` modules tests to exclude a Namespace for
OExchange XRD protocol
* Fix some files for new line in the end of file according Checkstyle
violations
2019-05-30 09:32:26 -04:00