Commit Graph

10056 Commits

Author SHA1 Message Date
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
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