Commit Graph

9752 Commits

Author SHA1 Message Date
Artem Bilan
f89e8aafa5 Fix Redis components for JDK deserialization
It turns out that `JdkSerializationRedisSerializer` by default is
based on the default Java class loader which may lead into
`ClassCastException` downstream after deserialization

* Make all the `JdkSerializationRedisSerializer` usage (default)
in Redis components based on the BeanFactory `ClassLoader`
* Fix tests to call `setBeanClassLoader()`
* Fix Mark Fisher's name in the `MultipartFileReader` :-)

**Cherry-pick to 5.1.x, 5.0.x & 4.3.x after restoring diamonds**
2019-06-28 16:16:05 -04:00
Artem Bilan
890cd1feb9 Add equals & hashCode into IntWebExchangeBindEx
According Sonar report we need to re-implement `equals()` & `hashCode()`
methods in the `IntegrationWebExchangeBindException` since it
extends a `WebExchangeBindException` with those methods
2019-06-28 09:43:28 -04:00
Artem Bilan
cc87c1b1b0 Optimize ServerRSocketConnector connection
When RSocket client connects to the server there is no reason to wrap
a `ConnectionSetupPayload` into a `Message` since we are not going to
send it downstream

* Refactor `IntegrationRSocket.handleConnectionSetupPayload()` just
return a `Mono<DataBuffer>` for converted `ConnectionSetupPayload`
* Ask for a `destination` and `RSocketRequester` from the
`IntegrationRSocket` instead of message headers
2019-06-27 16:22:42 -04:00
Artem Bilan
0675fdfac9 RSocketDslTests: Resolve server port eagerly
Looks like there is some connection race condition in Netty on Linux,
so we may not be started on server side fully when we try to select a
port from the OS

* Move local port resolution and, therefore, RSocket server start into
the earlier phase before creating a client
2019-06-27 12:51:32 -04:00
Artem Bilan
77954966cb Fix RSocket parser tests for https://example.com
The `http://example.org` is not white-listed in `nohttp` and it
doesn't resolve SSL handshake on HTTPS schema

* Add `@Deprecated` into `SimpleMessageListenerContainerSpec.txSize()`
2019-06-27 11:53:31 -04:00
Artem Bilan
1aea280cc9 Remove explicit Reactor deps for RSockets
* It looks like we don't need to manage Reactor dependencies in the
RSocket module: the `io.rsocket:rsocket-transport-netty` brings
everything we need, although it doesn't that with its own supported
versions
* Use non-HTTPS url for `example.org` in test config to avoid SSL
handshake
2019-06-27 11:14:36 -04:00
Artem Bilan
c18c2e2141 Add Validation to HTTP Inbound (#2978)
* Add Validation to HTTP Inbound

* Pull a validation functionality from `WebFluxInboundEndpoint` to its
super class `BaseHttpInboundEndpoint` making a validation available for
the `HttpRequestHandlingEndpointSupport` as well
* Do the same for the `validator()` option in DSL for the
`HttpInboundEndpointSupportSpec`
* Add `validator` XML attribute for both HTTP and WebFlux inbound
endpoint XSDs
* Test parsers for a new `validator` option
* Document validation in the `http.adoc`
* Apply some polishing in the `http.adoc`, as well as in the
`HttpRequestHandlingEndpointSupport` JavaDocs
* Clarify in `webflux.adoc` that validation is applied for the
`Publisher` items before the payload is finally built for the message to
send.
* Add WebFlux into the table of endpoints in the `endpoint-summary.adoc`

* * Remove unused imports
* Fix `SimpleMessageListenerContainerSpec` for deprecated `txSize` option
2019-06-27 09:47:45 -04:00
Artem Bilan
c5ec2d94c6 Remove double commas in docs for link syntax 2019-06-26 16:14:02 -04:00
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