Commit Graph

10074 Commits

Author SHA1 Message Date
Artem Bilan
e9a3580ef5 Upgrade dependencies; fix new Sonar smells 2020-03-11 10:22:51 -04:00
Artem Bilan
6b82681cc0 GH-3211: Add DefSftpSF.setKnownHosts(Resource) (#3212)
* GH-3211: Add DefSftpSF.setKnownHosts(Resource)

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

* Add `DefaultSftpSessionFactory.setKnownHosts(Resource)` to
allow to configure externally any resource for file with known_hosts content
* Deprecate an existing method in favor of new one
* The new method makes it aligned with the `setPrivateKey(Resource)`
* Fix tests do not use a deprecated method any more

**Cherry-pick to 5.2.x**

* * Rename to `setKnownHostsResource()` to avoid XML parser confusion
* Change `sftp.adoc` to reflect a new property
2020-03-10 16:50:00 -04:00
Artem Bilan
36f96ec2c6 Document Kotlin DSL (#3210)
* Document Kotlin DSL

* Remove unused imports in `FunctionsTests.kt`

* * Fix typos in Docs
2020-03-10 16:47:41 -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
Artem Bilan
1511dd8748 GH-3204: Add DSL intercept() operator
Fixes https://github.com/spring-projects/spring-integration/issues/3204

* Add an `intercept(ChannelInterceptor...)` method into `BaseIntegrationFlowDefinition` 
to register one or more channel interceptors at the current flow position.
* refactor to reuse `InterceptableChannel` creation from `wireTap`
* document the new operator
2020-03-05 16:15:52 -05: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
8a38a5e829 Merge spring-integration-kotlin-dsl project
* Migrate all the Kotlin tests to use new Kotlin DSL
* Upgrade to the latest Kotlin
* Generate KDocs
2020-03-05 13:10:32 -05:00
Gary Russell
f332a9446b GH-3199: Test for fail back with Long.MAX_VALUE
Resolves https://github.com/spring-projects/spring-integration/issues/3199
2020-03-05 11:15:27 -05:00
Artem Bilan
e71e250e36 Fix new Sonar smells 2020-03-04 10:41:45 -05:00
Gary Russell
0efcf2402a GH-3199: Missing What's new commit 2020-03-03 16:52:12 -05:00
Artem Bilan
45a91b25de Add Reactive TX Manager support (#3201)
* Add Reactive TX Manager support

* Change `TransactionInterceptorBuilder` and `TransactionHandleMessageAdvice` to reply
on a generic `TransactionManager`, so we can configure reactive one as well
* Change a `<transactional>` XML element to support a generic `TransactionManager` reference,
so we can configure reactive one as well
* Support `adviceChain` configuration for the `ReactiveMessageHandler` in the `ConsumerEndpointFactoryBean`
* Attemp to apply reactive transaction for the Reactive MongoDB channel adapter

* * Revert `MongoDbTests` change -
to support transactions we need the latest MongoDb server with replica enabled
* Document reactive transactions

* * Address PR reviews
2020-03-03 11:54:29 -05:00
Artem Bilan
294cfc1529 Remove unused imports 2020-03-03 11:14:11 -05:00
Artem Bilan
a795478263 Revert NPE check in the FailoverClientConnFactory
* Add `synchronized` to `MqttPahoMessageDrivenChannelAdapter` setters to fix sync inconsistency
2020-03-03 11:11:19 -05:00
Artem Bilan
fc4907d329 Fix new Sonar smells 2020-03-03 10:25:09 -05:00
Artem Bilan
e6e9f45164 Use Mono.create instead of Mono.fromCallable
It is better to poll message from `QueueChannel`
when ever a reactive request happens.
The `Mono.fromCallable()` operator does poll on subscription, not request
and caches the value.
However we may lose such a value in between.

* Use `Mono.create()` with its `monoSink.onRequest()` callback in the
`adaptPollableChannelToPublisher()` implementation to defer `inputChannel.receive()`
until an on demand request downstream
2020-03-02 16:57:29 -05:00
Gary Russell
cdbaf18664 GH-3199: TCP FailoverClientCF fail back default
Resolves https://github.com/spring-projects/spring-integration/issues/3199

- change the default behavior to not fail back until the current connection fails
- reduce method complexity (Sonar)
- 5.3 only
2020-03-02 14:45:09 -05:00
Tim Feuerbach
c6cf261e25 GH-3202: Fix tests failing with non-English locales
Fixes https://github.com/spring-projects/spring-integration/issues/3202

Set the locale to en-US for tests that assert error messages
2020-03-02 14:03:27 -05:00
Artem Bilan
8bc221b271 Fix new Sonar smells 2020-03-02 14:02:58 -05:00
Gary Russell
e2b63bed7c GH-3199: Fix typo; move capture of creation time 2020-02-28 16:39:41 -05:00
Gary Russell
4180e01e59 GH-3199: FailoverClientCF - Fail Back Option
Resolves: https://github.com/spring-projects/spring-integration/issues/3199

Previously, the FCCF did not cache a shared connection; if server 1 is down
and server 2 is up, this caused an attempt to connect to server 1 every time
we got the connection.

Add 2 options: `refreshSharedInterval` and `closeOnRefresh`, defaulting to
0 and false respectively, to maintain the same behavior as before the options
existed.

Disallow caching of the single shared connection if the delegate factories are
`CachingClientConnectionFactory` instances.

**cherry-pick to 5.2.x**

I will backport to 5.1.x, 4.3.x after review/merge.

* Polish javadocs and fix typo in docs
2020-02-28 15:52:16 -05:00
Gary Russell
1277531290 Fix Sonar issue 2020-02-28 10:37:40 -05:00
Artem Bilan
0e5258a661 Add log() to test Publisher for diagnostics
https://build.spring.io/browse/INT-MASTER-1916/
2020-02-27 18:12:31 -05:00
Gary Russell
bd9563bd1e disconnectCompletionTimeout Polishing
- rename from `stopCompletionTimeout`
- add to outbound adapter
- use in both places we disconnect on inbound

**cherry-pick forward to 5.2.x, master**

# Conflicts:
#	spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/MqttPahoMessageHandler.java
2020-02-27 17:30:49 -05:00
Gary Russell
2d3d37ecba Upgrade to MQTT Paho 1.2.2
- fix mock tests for internal client changes
- reduce stop wait for completion time

**cherry-pick to 5.2.x**

* Remove stack trace from test and convert to assertJ
2020-02-27 16:34:15 -05:00
Artem Bilan
87c8e47a88 GH-3192: pub-sub DSL for broker-backed channels (#3193)
* GH-3192: pub-sub DSL for broker-backed channels

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

* Introduce a `BroadcastCapableChannel` abstract to indicate those `SubscribableChannel`
implementations which can provide a pub-sub functionality
* Implement a `BroadcastCapableChannel` in broker-baked channels with pub-sub option
* Introduce a `BaseIntegrationFlowDefinition.publishSubscribeChannel()` based
on the `BroadcastCapableChannel` and `BroadcastPublishSubscribeSpec` to let to
configure sub-flow subscribers in fluent manner

* * Add some JavaDocs and document new feature

* * Show the channel bean definition in the doc
* Fix typo
2020-02-25 13:01:37 -05:00
Artem Bilan
7dbdbdee3f Fix new Sonar smells 2020-02-24 11:57:02 -05:00
Artem Bilan
50ac603d6c GH-3180: Add encoding-mode to WS outbound gateway (#3191)
* GH-3180: Add encoding-mode to WS outbound gateway

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

* Deprecate `encode-uri` in favor of newly introduced `encoding-mode`
* Add new property to XML and DSL configurations
* Fix tests according a new behavior
* Document the feature
* Fix docs for deprecated `encode-uri`
* Mention also WS from `http.adoc`

* * Fix typos in docs
2020-02-21 16:47:42 -05:00
Artem Bilan
b38c9e16e8 GH-3182: Properly reset bean in the MockIntCtx (#3190)
* GH-3182: Properly reset bean in the MockIntCtx

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

The `MockIntegrationContext.resetBeans()` doesn't really restore a state
of endpoint beans: the handle/source is applied only after start for that endpoint

* Stop endpoints in the `MockIntegrationContext.resetBeans()` is they are running currently
* Start them back only if their `autoStartup == true`
* Clear only those beans which names are provided for the `resetBeans()`

**Cherry-pick to 5.2.x**

* * Ensure that only provided beans are reset
2020-02-21 08:49:45 -05:00
Gary Russell
ea8c454d3b GH-2818: DSL support for -ws module
Resolves https://github.com/spring-projects/spring-integration/issues/2818

* Rework to improve fluency
* reduce the number of factory methods and use a different spec when
  an external WST is provided.
* Docs and address comments
2020-02-20 14:59:32 -05:00
Ted M. Young
8fb201867c Fixed broken links in Whats New
* Links used `.adoc/section` instead of `.adoc#section` causing links to not work.

* Fixed English 'effects' to 'affects'.
2020-02-20 09:34:00 -05:00
Artem Bilan
e9176a0a04 GH-3179: Document how priority is mapped into JMS
Fixes https://github.com/spring-projects/spring-integration/issues/3179

* Doc polishing.
2020-02-19 16:46:06 -05:00
Artem Bilan
d61a247f4b Fix ReactiveStreamsConsumer for PollableChannel
https://build.spring.io/browse/INT-MASTERSPRING40-985/

* Move `onSubscribe()` callback to the `subscribe()` operator
to honor a `request` contract from the target subscriber
2020-02-18 12:37:24 -05:00
Artem Bilan
6d936d9774 Fix some Sonar smells 2020-02-14 17:57:58 -05:00
Artem Bilan
236ded9ea1 Upgrade to Lettuce 5.2.2 2020-02-13 16:10:09 -05:00
Artem Bilan
8c4675aa83 Fix new Sonar smell
* Make `adaptPollableChannelToPublisher()` as non-blocking
2020-02-13 14:11:21 -05:00
Spring Buildmaster
89e31b2a21 [artifactory-release] Next development version 2020-02-12 18:36:42 +00:00
Spring Buildmaster
cadca23553 [artifactory-release] Release version 5.3.0.M2 2020-02-12 18:36:38 +00:00
Artem Bilan
5273203e33 Upgrade dependencies; prepare for release 2020-02-12 13:06:45 -05:00
Artem Bilan
a0cdfd90ee Change adaptPollableChannelToPublisher to Mono
We can use a `Mono.fromCallable()` in combination with `repeat()`
instead of possible race condition deal in the `Flux.create()`
2020-02-12 12:09:31 -05:00
Gary Russell
1ff69d4d24 GH-3175: Add .scanner() to inbound file sync spec
Resolves https://github.com/spring-projects/spring-integration/issues/3175

* Fix `@since` for backport

**Cherry-pick to `5.2.x`**
2020-02-11 12:57:26 -05:00
Artem Bilan
ede9528c19 Fix some tests for not closed application context 2020-02-11 12:43:33 -05:00
Artem Bilan
aeab030104 GH-3168: Fix FtpSession warning on logout
Fixes https://github.com/spring-projects/spring-integration/issues/3168

* Call `this.client.noop()` instead of `this.client.isConnected()` to really
check that client has a live connection with the server before calling a `this.client.logout()`
* Wrap `this.client.logout()` into a `try..catch` to be sure that we wil call a
`this.client.disconnect()` even if `logout()` fails for some reason.
* Change `WARN` logs about `Session.close()` into a `DEBUG` level -
when we have a problem with closing session because of server disconnect reason
we have no any control to do with a situation

**Cherry-pick to 5.2.x**
2020-02-11 12:06:05 -05:00
Artem Bilan
7009f9a5f6 Fix new Sonar smells 2020-02-11 09:52:29 -05:00
Artem Bilan
a8c471c061 Fix ReactiveStreamsConsumer for error handling
To support `onErrorContinue()` logic for the plain `Subscriber`
we need to wrap its `onNext()` into a `try..catch` and respective
`errorHandler` in the `ReactiveStreamsConsumer`
2020-02-10 16:27:59 -05:00
Artem Bilan
6591ce90f6 Fix ReactiveStreamsConsumer for plain subscriber
https://build.spring.io/browse/INT-MASTERSPRING40-978

Investigate a behaviour for `ReactiveStreamsConsumer`
when we use a plain `Subscriber` directly instead of `doOn...` callbacks.
It looks like there is some race condition when the data can be consumed
upstream, but there is no consumer downstream ready yet
2020-02-10 16:00:14 -05:00
Gary Russell
538cfe4868 GH-3172: Support consumer-side batching
Resolves https://github.com/spring-projects/spring-integration/issues/3172

When the listener container supports creating batches of consumed
messages, present the batch as the message payload - either a
`List<Message<?>>` or `List<SomePayload>`.

* Add 'since' to new method.
2020-02-10 11:52:34 -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
00b771d8a8 Fix NPE in the DefaultSessionFactoryLocator
**Cherry-pick to 5.2.x**
2020-02-07 10:51:22 -05:00
Andrey Kezhevatov
edf84a393d GH-3169: DSFL: addSessionFactory based on Object
Fixes https://github.com/spring-projects/spring-integration/issues/3169

All other `DefaultSessionFactoryLocator` contracts are based on the `Object`,
so this `addSessionFactor`y has to be on `Object` as well.

* Add `DefaultSessionFactoryLocator.addSessionFactory(Object key, SessionFactory<F> factory)`
* Deprecate existing one based on `String`
* Fix tests do no use a deprecated API
* Some other code style clean up in the affected classes

**Cherry-pick to 5.2.x**
2020-02-07 10:38:07 -05:00
Gary Russell
fa97ce0e66 AMQP: Multiple Sends within an OB Channel Adapter
In preparation for: https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/issues/209

When `multiSend` is true and multiple messages are sent as the payload
of a message, each message is sent within the `invoke()` method of the
`RabbitTemplate`.

* Fix javadoc typo

* Fix DSL Spec hierarchy

* Protected CTOR/fields in new and modified specs

* Protected CTORs, fields for remaining AMQP Specs
2020-02-06 15:32:09 -05:00