Commit Graph

10043 Commits

Author SHA1 Message Date
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
Artem Bilan
509e8237e8 Upgrade to Spring Security 5.3RC1; RSocket 1.0RC6 2020-02-05 16:15:07 -05:00
Jayadev Sirimamilla
1d9a818efe GH-3157: pop sequence for message as well
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
2020-02-04 11:37:19 -05:00
Artem Bilan
e5740f253c Upgrade dependencies
* 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
2020-02-03 13:12:50 -05:00
Artem Bilan
d792915be6 Add debug log for ReactiveStreamsConsumerTests
https://build.spring.io/browse/INT-MASTER-1883/
2020-01-31 15:16:57 -05:00
Artem Bilan
2f4394d8b5 Populate a JsonHeaders.RESOLVABLE_TYPE on reply (#3163)
* 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
2020-01-31 14:17:19 -05:00
Artem Bilan
94c8cf7e21 Fix new Sonar smells 2020-01-31 11:27:36 -05:00
Artem Bilan
34bc8116df Add @LogLevels to ReactiveStreamsConsumerTests
https://build.spring.io/browse/INT-MASTERSPRING40-967/
2020-01-30 17:58:40 -05:00
Artem Bilan
89d86e1904 GH-3154: Support UriBuilderFactory.EncodingMode (#3162)
* 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
2020-01-30 15:12:39 -05:00
Jayadev Sirimamilla
9f07803abf GH-3152: Fix for nested Scatter Gather
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
2020-01-27 15:12:15 -05:00
Artem Bilan
290c803f85 Fix new Sonar smell 2020-01-27 11:25:41 -05:00
Artem Bilan
e70fd0d227 Fix new Sonar smells 2020-01-26 10:38:27 -05:00
Artem Bilan
a9cb80afae Fix some Sonar smells 2020-01-25 19:23:04 -05:00
Artem Bilan
bfe28dba9a Revert NPE check in the AbstMappingMessageRouter 2020-01-25 09:19:59 -05:00
Artem Bilan
990294b048 Fix AbstractMappingMessageRouter for NPE 2020-01-24 19:17:08 -05:00
Artem Bilan
d2df9dde9f Fix Checkstyle violations 2020-01-24 16:53:11 -05:00
Artem Bilan
ad5496fa4b Fix some Sonar smells 2020-01-24 16:46:32 -05:00
Artem Bilan
a201bdebee Fix new Sonar smells 2020-01-24 09:49:23 -05:00
Artem Bilan
cf01b7c0e5 Fix background color for code snippets in docs
* Change Copyright in docs for current year
2020-01-23 16:05:25 -05:00
Artem Bilan
be8a73ff36 Fix typos in MongoDb components JavaDocs 2020-01-23 10:43:33 -05:00
Spring Buildmaster
a75fc03e10 [artifactory-release] Next development version 2020-01-22 23:03:42 +00:00
Spring Buildmaster
b0a457409f [artifactory-release] Release version 5.3.0.M1 2020-01-22 23:03:37 +00:00
Artem Bilan
0606a6f87b Add JavaDSL for ReactiveMongoDbMessageSource
* Implement `ReactiveMongoDbMessageSourceSpec` and factories for it
* Rework `ReactiveMongoDbMessageSourceTests` to use new Java DSL for `ReactiveMongoDbMessageSource`
* Document changes
2020-01-22 17:36:52 -05:00
Artem Bilan
c7c7422fa3 Fix unused imports violation 2020-01-22 15:57:20 -05:00
Artem Bilan
8bd9464b74 Use Overflow.BUFFER for PollableChPublisherAdapter
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
2020-01-22 15:47:00 -05:00
Artem Bilan
9b7b0d91ac FluxMessageChannel: try.catch not onErrorContinue
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
2020-01-22 13:15:56 -05:00
Artem Bilan
a62a572a6c Add ReactiveMongoDbMessageSource polling test
* Insert test data before running test
* close an `ApplicationContext` after test
2020-01-22 12:35:20 -05:00
Gary Russell
545c500acc Replace DOS newlines with unix 2020-01-22 11:09:23 -05:00
Artem Bilan
6aa510be41 Upgrade dependencies before release 2020-01-21 14:38:06 -05:00
David Turanski
263995fb90 INT-4568: Add ReactiveMongoDBMessageSource
JIRA: https://jira.spring.io/browse/INT-4568

Clean up per review and some updates to `mongodb.adoc`
2020-01-21 12:13:13 -05:00
Artem Bilan
4b051684ef Stop endpoints in the end of tests
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
2020-01-17 09:55:11 -05:00
Artem Bilan
715e9a2042 Upgrade dependencies including Gradle 6.1
* 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
2020-01-16 16:13:06 -05:00