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
Fixes https://github.com/spring-projects/spring-integration/issues/3157
* Fixed issue with sequences not being popped when Output processor returns a message.
* Updated documents and added additional Checks to the testcase to ensure proper `popSequence` is done.
* Updated documents and added corrected code formatting
* Updated documents and used headerAccessor Constants for matching headers
* Clean up code style
* Improve docs for the feature on the matter
* Gradle 6.1.1
* MongoDb 4.0
* Other Spring dependencies to `BUILD-SNAPSHOT`
* Fix MongoDb tests according latest Spring Data
* State in the docs that both MongoDb driver are `optional` now in the dependencies
* Populate a JsonHeaders.RESOLVABLE_TYPE on reply
Fixes https://github.com/spring-projects/spring-integration-samples/issues/277
In the `AbstractAmqpOutboundEndpoint` the `JsonHeaders.RESOLVABLE_TYPE`
from request message is copied to reply message making inconsistency downstream.
The `JsonToObjectTransformer` consults first a `JsonHeaders.RESOLVABLE_TYPE`
and deserialize payload to wrong type
* Fix `DefaultAmqpHeaderMapper` to populate a `JsonHeaders.RESOLVABLE_TYPE`
alongside with other `JsonHeaders` populated from the reply AMQP message.
This way a `JsonHeaders.RESOLVABLE_TYPE` from request message won't have effect
* To get access to classes, supply `AbstractHeaderMapper` with a bean factory `ClassLoader`
* Introduce a couple utility methods into `JsonHeaders` for building a `ResolvableType`
**Cherry-pick to 5.2.x**
* * Fix code formatting for arguments wrapping
* GH-3154: Support `UriBuilderFactory.EncodingMode`
Fixes https://github.com/spring-projects/spring-integration/issues/3154
Spring Framework now provides a `DefaultUriBuilderFactory.EncodingMode`
for encoding URIs in the `RestTemplate` before and after uri template
enrichment with uri variables.
Therefore `encodeUri` and manual uri variables substitution is not necessary
in Spring Integration HTTP components
* Deprecate `AbstractHttpRequestExecutingMessageHandler.encodeUri` in favor of
`DefaultUriBuilderFactory.EncodingMode` and respective configuration
on the `RestTemplate` in HTTP module and `WebClient` in WebFlux module
* * Really populate `uriFactory` into an internal `RestTemplate`
* Ensure in tests that `encoding-mode` is populated properly into an internal `RestTemplate`
* Clean up affected HTTP tests for AssertJ and JUnit 5
* * Clean up formatting
* * Apply fix for WebFlux module
* Add docs for new `encoding-mode` option
* * Remove unused import in the test
Fixes https://github.com/spring-projects/spring-integration/issues/3152
The upstream `gatherResultChannel` header has been missed when we produced a reply from nested scatter-gather
Added Test Case for Nested Scatter Gather test
Simplified the the test cases and added author in changed cases
Corrected codestyle issue in Travis CI
Removed additional OriginalReplyChannel and originalErrorChannel in Headers.
Added additional not to be executed line of code in test case.
Restored OriginalErrorChannel Header and removed error handling related fixes
* Clean up code style and improve readability
**Cherry-pick to 5.1.x & master**
* Migrate `RouterTests` to JUnit 5
* Implement `ReactiveMongoDbMessageSourceSpec` and factories for it
* Rework `ReactiveMongoDbMessageSourceTests` to use new Java DSL for `ReactiveMongoDbMessageSource`
* Document changes
The `ReactiveStreamsConsumerTests.testReactiveStreamsConsumerPollableChannel()`
fails periodically.
Change the logic to rely on the `FluxSink.OverflowStrategy.BUFFER` for
possible future subscribers, meanwhile with `IGNORE` we just lose a message
altogether
It turns out that some upstream fluxes may come with the
`onErrorResume()` logic.
The `onErrorContinue()` here downstream in the `FluxMessageChannel.java`
eliminates an `onErrorResume()` purpose.
* Change the logic to `try..catch` in the `doOnNext()` instead and let
that upstream `onErrorResume()` to do its job
https://build.spring.io/browse/INT-MASTERSPRING40-954/
The `ReactiveStreamsConsumerTests` fails with some race condition from time to time.
Possible reason that no one endpoint is stopped in the end of test.
Even if we step out from the test method, background threads are still active
* Add `org.gradle.caching=true` and `org.gradle.parallel=true` into a `gradle.properties`
* Fix `Matcher` tests in the `spring-integration-test-support` for the latest JUnit 4