Commit Graph

19 Commits

Author SHA1 Message Date
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
Artem Bilan
30750f53b7 Polishing for RSocket channel adapter (#2928)
* Polishing for RSocket channel adapter

* Add JavaDocs
* Remove unused code

* * Fix Sonar smells
2019-05-12 11:25:59 -04:00
Artem Bilan
36e7041c26 Add RSocketInboundGateway; refactoring (#2923)
* Add `RSocketInboundGateway`; refactoring

* Extract an `AbstractRSocketConnector` for common client and server connectors logic
* Introduce an `IntegrationRSocketAcceptor` and `IntegrationRSocket` for the
mapping and handling logic of RSockets and messages in between
* Introduce an `IntegrationRSocketEndpoint` marker interface for Inbound Gateway mappings
* Add `RSocketInboundGateway` implementation, which is called from the
`IntegrationRSocketAcceptor` by the `IntegrationRSocketEndpoint` mapping
* Add `RSocketConnectedEvent` to emit when the client is connected to the server.
It does not make sense in Spring Integration to delegate such a logic into the
`RSocketInboundGateway`

* * Add `ServerRSocketConnector` to represent an RSocket server and
container for connected `RSocketRequester`s from clients
* Extract `accept(ConnectionSetupPayload setupPayload, RSocket sendingRSocket)`
server logic into an internal `ServerRSocketAcceptor` extension for the
`IntegrationRSocketAcceptor`
* Address PR comments:
 - `RSocketConnectedEvent.toString()`
 - `ApplicationEventPublisherAware` into the `ServerRSocketConnector`
 - Log RSocket connection if no `this.applicationEventPublisher`
* Remove `handleConnectionSetupPayload()` from the `IntegrationRSocket`
since it is not delegated to the target handler
* Provide reasonable default `RSocketStrategies` for the
`AbstractRSocketConnector` and `RSocketInboundGateway`
* Add initial `RSocketInboundGatewayIntegrationTests`

* * Don't use `BytyBuffer` in the `RSocketConnectedEvent.toString()`
* Always `payload.retain()` when we convert `Payload` to `DataBuffer`
* Fix `IntegrationRSocketAcceptor.detectEndpoints()` stream logic
to really iterate over all the `IntegrationRSocketEndpoint` beans
* Fix test to use an explicit `ClientConfig` class for the
`@SpringJUnitConfig`: looks like JUnit 5 is OK to scan for `package
protected` classes as well
* Add request/reply tests into the `RSocketInboundGatewayIntegrationTests`
for both server and client sides

* * Remove `DataBuffer` from `RSocketConnectedEvent.toString()`

* * Fix Checkstyle violation in the RSocketInboundGatewayIntegrationTests
2019-05-10 17:20:19 -04:00
Artem Bilan
90d2b30066 Remove RSocketInboundGateway since it isn't ready 2019-05-03 15:15:02 -04:00
Artem Bilan
e2b661845e RSocketOutbound refinements; resolve deprecations
* Use properly `cache()` for the `Mono` in the `ClientRSocketConnector`
* Don't require a `publisherElementTypeExpression` in the
`RSocketOutboundGateway`: the target element type is determined
automatically in the `DefaultRequestSpec.toResponseSpec()`
* SF has deprecated `MediaType.APPLICATION_JSON_UTF8`: fix all its usage
in favor of recommendations to use the `MediaType.APPLICATION_JSON` instead
* Also fix plain `application/json;charset=UTF-8` literals to use
`MediaType.APPLICATION_JSON` instead
2019-05-03 13:00:12 -04:00
Gary Russell
0bb901b286 Sonar fixes
- printStackTrace in test mail server
- Illegal throws
- Large anon. classes

* - indexOf char
- stored external object

* - ignored exceptional return values

* - checkstyle
2019-04-30 13:57:12 -04:00
Artem Bilan
4199ff57cd Make RSocketOutboundGateway for server side
* Introduce a `ClientRSocketConnector` to represent a common logic for
client side connection and management an obtained `RSocket`
* Rework the `RSocketOutboundGateway` to perform similar RSocket request
logic on the server side as well.
* Refactor `RSocketOutboundGatewayIntegrationTests` to demonstrate that
RSocket requests work the same way from the server side as well.
For this reason a `CommonConfig` has been extracted with the same
`RSocketOutboundGateway` configuration reuse on both server and client
sides.
2019-04-30 12:06:43 -04:00
Artem Bilan
e977234844 Fix new Sonar smells 2019-04-26 09:22:28 -04:00
Artem Bilan
89e11f2c46 Add initial support for RSockets (#2902)
* Add initial support for RSockets

* Add `spring-integration-rsocket` module and respective dependencies
* Implement `RSocketOutboundGateway` based on the Spring Messaging
`RSocketRequester`.
This component supports dynamic RSocket properties via expressions
against request message.
to handle `Publisher` for requests, it must be present in the request
message `payload` instead of `FluxMessageChannel` upstream, since the
last one just flattens events to be handled in the `MessageHandler` one
by one.
The result `Mono` is subscribed downstream in the `FluxMessageChannel`
or directly by the `AbstractReplyProducingMessageHandler`.
If result is a `Flux` it is just wrapped into the `Mono` to be processed
downstream by end-user code.
The point is that these request/replies are volatile and live in the
particular context meanwhile a `FluxMessageChannel` is long living
publisher in the application context boundaries.
* The `RSocketOutboundGatewayIntegrationTests` is an adapted copy of
`RSocketClientToServerIntegrationTests` from Spring Messaging
* Add `doOnError()` into the `Flux` created in the
`AbstractMessageProducingHandler` for `Publisher` replies

* * Use singular for the `RSocket` term
* Use no-op `Consumer` for the `strategiesConfigurer` and
`factoryConfigurer` in the `RSocketOutboundGateway` and also
`Assert.notNull()` in the appropriate setters to avoid null check during
`RSocketRequester.builder()` initialization
* Use `TcpServer.create().port(0)` in the
`RSocketOutboundGatewayIntegrationTests` to allow to select free OS port
and bind into it.
The selected port is used later for client configuration in the
`RSocketOutboundGateway` bean definition

* * Change `RSocketOutboundGatewayIntegrationTests.PORT` to lower case
2019-04-25 14:07:56 -04:00