* 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
* 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
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
* 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
* 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
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
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
- 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
- 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
* 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
* 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
* 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
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**
To support `onErrorContinue()` logic for the plain `Subscriber`
we need to wrap its `onNext()` into a `try..catch` and respective
`errorHandler` in the `ReactiveStreamsConsumer`
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
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.
* 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
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**
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