Commit Graph

58 Commits

Author SHA1 Message Date
Artem Bilan
c264e12deb Fix new Sonar smells 2020-04-29 09:27:54 -04:00
Artem Bilan
9ec6529992 Upgrade to Rsocket 1.0-RC7; fix deprecations
* Fix RSocket docs according new functionality

**Cherry-pick to 5.2.x**
2020-04-28 17:20:38 -04:00
Artem Bilan
e9a3580ef5 Upgrade dependencies; fix new Sonar smells 2020-03-11 10:22:51 -04:00
Artem Bilan
c45cc66a84 GH-3207: RSocket inbound: decode each flux item (#3208)
* GH-3207: RSocket inbound: decode each flux item

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

Previously an incoming RSocket Publisher has been decoded as a single unit
leading to extra work on the client side, e.g. a delimiter has to be provided
to treat each payload item as independent

* To have a consistency with Spring Messaging and its `PayloadMethodArgumentResolver`
change an `RSocketInboundGateway` to process inbound payloads as `Flux` and decode
each item independently.
* Change `RSocketDslTests` to remove delimiters and make it consistent with the regular
`RSocketRequester` client

* * Add `decodeFluxAsUnit` option into `RSocketInboundGateway`
* Document the change
2020-03-10 16:07:01 -04:00
Gary Russell
c84d264294 GH-3183: Add ReactiveRequestHandlerAdvice (#3197)
* GH-3183: Add ReactiveRequestHandlerAdvice

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

* Introduce a `ReactiveRequestHandlerAdvice` with a `BiFunction<Message<?>, Mono<?>, Publisher<?>>`
logic to apply a `Mono.transform()` operator for a returned from the handler `Mono` reply
* Fix `WebFluxRequestExecutingMessageHandler` to return a `Mono.then()` instead of an explicit subscription -
it happens downstream anyway during reply producing with a proper error handling, too
* Demonstrate `ReactiveRequestHandlerAdvice` in the `RSocketDslTests` - without `retry()` it fails
* Add `ConsumerEndpointSpec.customizeMonoReply()` for convenience
* Document `ReactiveRequestHandlerAdvice` feature

* * Fix language in docs
2020-03-05 13:37:54 -05:00
Artem Bilan
867a8cf108 GH-3155: Add support for Java DSL extensions (#3167)
* GH-3155: Add support for Java DSL extensions

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

Provide an `IntegrationFlowExtension` for possible custom EI-operators
in the target project use-cases.

* * Move `IntegrationFlowExtension` tests ot its own test class
* Make all the `IntegrationComponentSpec` ctors as `protected` for possible custom extensions
* Make some `BaseIntegrationFlowDefinition` methods and properties as `protected` to get them
access from the `IntegrationFlowExtension` implementations
* Document the feature

* * Fix language and typos in docs

* * Add `protected` to one more `GatewayEndpointSpec` ctor
* Add JavaDocs to `GatewayEndpointSpec` methods

* * Add `protected` to one more `JmsPollableMessageChannelSpec` ctor
2020-02-07 13:40:39 -05:00
Artem Bilan
370e943428 Remove deprecations from previous versions
* Remove Boon dependency and its usage
* Remove overloaded methods from the `IntegrationFlowDefinition`
- we can simply rely now on the super class
* Remove (or rework) deprecated entities in the docs
* Fix tests for removed deprecated APIs
* Rework affected tests to JUnit 5
2020-01-09 15:54:04 -05:00
Artem Bilan
5ac262f866 GH-3132: Remove usage of super();
Fixes https://github.com/spring-projects/spring-integration/issues/3132

It turns out that Checkstyle EmptyBlock doesn't complain about
empty default ctor.
Plus a new check for `super();` call treats it as a violation

* Remove `super();` from all the no-arg ctors
* Code style clean up in the affected classes according
IDEA suggestions

* Fix new Sonar smells
2019-12-27 15:13:00 -05:00
Artem Bilan
9dc3519f20 Start version 5.3
* Move `What's New` into `changes-5.1-5.2.adoc`
* Remove version from the `XSD` files:
 1. Align with SF
 2. The version for XSD doesn't matter for the current jar version,
 since only the version is available in classpath is from the current
 jar version
 3. Modify `spring.schemas` to map all the possible versions for XSD
 into the current one in a jar.
 This way target applications can upgrade without changing the version
 for XSD location and we don't need to require `versionless` variant
 any more
 4. The jar in classpath can handle only its own XSD, so independently
 of version or no-version variants we still may fail because the current
 jar may not support end-user code any more - need some fix over there
 anyway.
* Remove `checkTestConfigs` Gradle task since we don't worry about XSD
version any more
* Modify `schemaZip` Gradle task to populate XSDs into a distribution
still with a version to avoid overriding on-line XSDs for version `1.0.x`.
We may consider not do that since SF doesn't and just bite a bullet
for always overriding those on-line XSDs to the actual one from the latest
release.
2019-12-26 15:41:19 -05:00
Artem Bilan
42b812b711 Introduce RSocketInteractionModel (#3110)
* Introduce RSocketInteractionModel

* Deprecate `RSocketOutboundGateway.Command` in favor of newly introduced
top level `RSocketInteractionModel`
* Deprecate setter, DSL and XML configurations for the deprecated
`RSocketOutboundGateway.Command` in favor of newly introduced configurators
for the mentioned `RSocketInteractionModel`
* Add `IntegrationRSocketEndpoint.getInteractionModels()` contract for
inbound endpoints.
This way we can restrict mapped endpoints to the particular interaction
model(s)
* Add DSL and XML configuration for inbound interaction model option
* Document changes

* * Rebased into master; fix conflicts
* Fix consistency for `RetrieveSpec` in the `RSocketOutboundGateway`
and `rsocket.adoc`

* * Fix language in JavaDos and XSD attributes
2019-12-02 14:54:37 -05:00
Artem Bilan
75c9db1b0e RSocketOG: rename method to prepareRetrieveSpec 2019-11-25 14:04:42 -05:00
Artem Bilan
d9df857dc1 Fix RSocketOutboundGateway to use RetrieveSpec
Related to https://github.com/spring-projects/spring-framework/issues/24073
2019-11-25 13:20:39 -05:00
Artem Bilan
25e945908c Fix RSocket module according changes in SF
Related to https://github.com/spring-projects/spring-framework/issues/23999

* Since Spring Integration inbound endpoints are generic in their method
signature we can't rely on a new `EMPTY_CONDITION` because it turns on
configuration merge into just `FrameType.REQUEST_FNF` &
`FrameType.REQUEST_RESPONSE`.
So, use `FrameType.REQUEST_FNF`, `FrameType.REQUEST_RESPONSE`,
`FrameType.REQUEST_STREAM` & `FrameType.REQUEST_CHANNEL` explicitly to
cover all the valid request-response models for SI endpoints
* Rework `RSocketOutboundGatewayIntegrationTests` according new logic.
Plus refactor to earlier subscription into `FluxMessageChannel` to
avoid potential race conditions
2019-11-19 12:12:46 -05:00
Artem Bilan
069d8730e0 Fix NPE in RSocketInboundGateway.decodePayload() 2019-11-14 10:02:56 -05:00
Artem Bilan
3e68228ae3 More docs for new RSocket features 2019-11-01 16:53:23 -04:00
Artem Bilan
04ff879f7e Improve RSocket support
Related to: https://github.com/spring-projects/spring-boot/issues/18812

* Extract `ServerRSocketMessageHandler` into a `public` class to allow
to configure it as top-level bean and bind it into an existing server
* Change `ServerRSocketConnector` to accept the mentioned external bean
and don't create an internal RSocket server with an assumption that it
is create externally
* Add `IntegrationRSocketMessageHandler.requestMappingCompatible`
option to allow to configure `ServerRSocketMessageHandler` for both
Spring Integration RSocket channel adapters and regular `@MessageMapping`.
This is useful for Spring Boot auto-configuration

These changes give a hook to auto-configure Spring Integration RSocket
channel adapters in Spring Boot
2019-11-01 09:26:09 -04:00
Artem Bilan
a2e0dda4d8 Show Rsocket requestChannel in RSocketDslTests 2019-10-23 13:29:20 -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
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
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
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
Gary Russell
8de73d3417 Sonar Fixes
`getRouteMatcher()` is only `@Nullable` before initialization.
2019-07-25 09:52:50 -04:00
Gary Russell
b660920da8 Revert "RSocket - temporary work around for tests"
This reverts commit 016bb32aa7.
2019-07-25 09:47:02 -04:00
Gary Russell
016bb32aa7 RSocket - temporary work around for tests 2019-07-24 11:45:19 -04:00
Artem Bilan
c109e1df34 GH-2987: Add HTTPS entries into spring.schemas
Fixes https://github.com/spring-projects/spring-integration/issues/2987

To resolve XSD files properly from the classpath, their HTTPS reference
must be present in the `spring.schemas` to avoid the Internet interaction
for resolving an XSD file

**Cherry-pick to 5.1.x, 5.0.x & 4.3.x**
2019-07-18 14:05:18 -04:00
Artem Bilan
34723fb946 Fix Rsocket module for moved classes in SF 2019-07-18 11:18:48 -04:00
Artem Bilan
ebb22c2ed4 Fix RSocket module according latest SF
See https://github.com/spring-projects/spring-framework/issues/23170
2019-07-14 12:11:14 -04:00
Artem Bilan
d2a4987bcc Fix new Sonar smells 2019-07-12 10:38:44 -04:00
Artem Bilan
24348a105c Rely on the RSocket FrameType header
* After introduction an `rsocketFrameType` header in the message,
we don't need a custom `IntegrationRSocket` any more.
Fully rely on the `MessagingRSocket` from the Spring Messaging, only
handle properly a `RSocketFrameTypeMessageCondition.CONNECT_CONDITION`
for connections from clients to emit an `RSocketConnectedEvent`
* Copy a `ChannelSendOperator` from the Spring Messaging for the proper
reply handling, when we are interested in the source `Publisher`
subscription first.
See its JavaDocs for more info
* Reusing already `public PayloadUtils` instead of its method copies
2019-07-10 14:47:41 -04:00
Artem Bilan
53d4faa83c Fix new Sonar smells
* Use method chain in the `AggregatorSpec.processor()`
* Add JavaDoc to the `AvroHeaders.PREFIX`
2019-07-10 09:52:59 -04:00
Artem Bilan
91156444c4 Fix RSocket tests according new @ConnectMapping
For the `connect` frame Spring Messaging RSocket support has introduced
an new `@ConnectMapping` annotation.

* Use `@ConnectMapping` in the test controller's method to properly
map to the connection from the client
2019-07-09 12:02:25 -04:00
Artem Bilan
c6a5ea874c Polish RSocket module according latest SF
* Add support for the `MetadataExtractor` in the
`AbstractRSocketConnector`, `IntegrationRSocketMessageHandler`
and `IntegrationRSocket` for more flexible RSocket metadata
* Use `DefaultMetadataExtractor` in the
`IntegrationRSocketMessageHandler.afterPropertiesSet()` since the getter
is not available on the super class yet
* Use a `MetadataExtractor` in the `IntegrationRSocket` instead of an
old `CompositeMetadata` manipulation
* Use `PayloadUtils.retainDataAndReleasePayload()` since it is `public`
already
* Downgrade to the `rsocketVersion = '0.12.2-RC4'` since it looks like
the latest `1.0.0-RC1-SNAPSHOT` doesn't parse a frame properly on the
server side
2019-07-08 14:04:14 -04:00
Artem Bilan
9bdff8cfd3 Fix new Sonar smells 2019-07-01 13:40:08 -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
97aaf95ccb Polishing RSocket module according SF changes
* Fix Checkstyle violations in the `MessageHistoryConfigurer`
2019-06-24 16:39:30 -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
36c14ef179 Some polishing for RSocket support 2019-06-18 15:16:34 -04:00
Artem Bilan
a77dac5347 Fix new Sonar smells; revert to BUILD-SNAPSHOTs 2019-06-15 10:59:36 -04:00
Artem Bilan
3ddc004a8b Fix RSocket adapters for routing metadata support 2019-06-14 16:15:12 -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
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
6bcf71c863 Fix Sonar smell in the RSocketInboundGatewayParser 2019-05-18 09:13:05 -04:00
Artem Bilan
bc9aa83aea RSocket XML Config support 2019-05-17 11:45:03 -04:00