Commit Graph

10178 Commits

Author SHA1 Message Date
Artem Bilan
5d7f0d2d1c Fix RedisQueueMessageDrEndpointTests for Java 14 2020-06-24 12:43:12 -04:00
Artem Bilan
6a3bea5a64 Add keepAlive(true) to testing Redis CF 2020-06-24 11:58:09 -04:00
Artem Bilan
94956859a2 Fix RedisAvailableRule for the proper evaluate
* Fix `RedisQueueMessageDrivenEndpointTests` for missed options
and for proper stop when the polling from the test queue is over
2020-06-23 16:27:45 -04:00
Artem Bilan
9367d7f4de Fix MessagingGateway for reactive reply type
* Upgrade dependencies to be ready for release
2020-06-23 14:26:11 -04:00
Artem Bilan
3bb445e133 Fix deprecations from Reactor 2020-06-22 13:32:06 -04:00
Artem Bilan
498f42d480 Fix deprecations from SF
* Remove `whitelist` words
* Resolve Sonar smells
* Add `await()` for FTP file removal test: looks like this operation may fail under the stress build
2020-06-19 12:07:58 -04:00
Artem Bilan
3a9ae217b8 Fix UDP tests to rely on a random port
* Iterate over addresses in NI for a real one

* Use `0` for `ackPort`

* Use real `InetAddress` from the `NetworkInterface`
2020-06-18 16:30:59 -04:00
Filip Hrisafov
9ad348b75f Log attempting to receive email under debug level instead of info (#3312) 2020-06-18 12:06:00 -04:00
Artem Bilan
b4a82eb078 Resolve deprecations for MulticastSocket
* Use new `joinGroup(SocketAddress, NetworkInterface)` API
* Resolve `NetworkInterface` in UDP components as
`getByInetAddress(InetAddress.getByName(localAddress))`
* join group as `socket.joinGroup(new InetSocketAddress(this.group, 0), null);`
* Fix `SocketTestUtils.chooseANic()` to select a real `NetworkInterface`
bound to a real IP address
* Fix `MulticastRule` to populate a `multicast.local.address` against a
host name for the network interface not an interface logical name
2020-06-18 11:05:41 -04:00
Artem Bilan
3f5aba2cb9 Support Java 14 (#3310)
* Support Java 14

* Provide changes to avoid deprecated Java API
and have a compatibility back to Java 8
* Change affected test classes to JUnit 5 whenever it is possible
* Ignore/Disable some TCP/IP tests which don't pass on Java 14

* Fix (some) TCP tests on JRE 14

* Fix SSL Handshake test - client side handshake is successful with java 14

- change the badClient cert to a badServer cert to force an error on the client side

Co-authored-by: artembilan <raven666>
Co-authored-by: Gary Russell <grussell@pivotal.io>
2020-06-17 14:00:06 -04:00
astrubel
b0cd0156c7 GH-3307: Retry TransTimedEx in LockRepo.acquire
Fixes https://github.com/spring-projects/spring-integration/issues/3307

The `DefaultLockRepository.acquire()` is transactional method and
can fail with the `TransactionTimedOutException`.
When we call `JdbcLock.lock()`, we expect an attempt until we really obtain a lock.

* Treat a `TransactionTimedOutException` as a `TransientDataAccessException` and 
therefore retry a locking attempt logic

**Cherry-pick to 5.3.x, 5.2.x & 4.3.x**
2020-06-16 10:18:41 -04:00
DEEPAK GUNASEKARAN
7cefd53e10 GH-3092: Refactor (S)FTP outbound specs, handlers
Fixes https://github.com/spring-projects/spring-integration/issues/3092
2020-06-15 16:27:24 -04:00
Artem Bilan
2419c03b25 Replace whitelist with allowlist 2020-06-15 14:20:51 -04:00
Gary Russell
7ec1f5cc4b GH-3299: Fix client connectionId for TCP/NIO
Resolves https://github.com/spring-projects/spring-integration/issues/3299

Connect before creating the `TcpNioConnection` object and publishing the
`TcpConnectionOpenEvent`.

This was a regression caused by supporting connect timout; which moved
the connect to after the object was created and event published, causing
the `connectionId` to start with `unknown`.

**cherry-pick to 5.3.x, 5.2.x**
2020-06-10 09:42:51 -04:00
artembilan
3499cd615a Code clean up for JacksonJsonUtils
* Mention `trustedPackages` in the `redis.adoc`

**Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x**
2020-06-09 14:49:25 -04:00
astrubel
02f0c10c80 GH-3294: Retry JdbcLock.unlock for TransDataAccEx
Fixes https://github.com/spring-projects/spring-integration/issues/3294

A `DeadlockLoserDataAccessException` occurs at `JdbcLockRegistry$JdbcLock.unlock()` - 
better to retry like in the `lock()`

**Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x**
2020-06-09 13:27:32 -04:00
artembilan
b436cbecc5 Fix NPE for component name after FactoryBeans
SO: https://stackoverflow.com/questions/62190244/spring-integration-upgrade-from-5-2-x-to-5-3-problem

When the component is populated to the application context via `FactoryBean`,
all its `BeanFactory` callbacks should be propagated from that `FactoryBean` -
only lifecycle control for this component we have through its `FactoryBean`

**Cherry-pick to 5.3.x**
2020-06-09 11:05:17 -04:00
Gary Russell
6e78569c00 GH-2736: TCP Async GW - Fix async check
Checking for NIO cannot be done in `onInit()` because the factory is
not yet started.

**cherry-pick to 5.3.x**
2020-06-02 11:17:10 -04:00
Artem Bilan
ef939a09a4 GH-3283: HTTP Inbound handle SpEL errors (#3289)
* GH-3283: HTTP Inbound handle SpEL errors

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

* Process all the request message preparation exceptions
in the provided error channel to let target application
to make a decision about an appropriate HTTP status instead of
default 500 Server Error

* * Rephrase `ResponseStatusException` doc in the http.adoc

Co-authored-by: Gary Russell <grussell@vmware.com>

Co-authored-by: Gary Russell <grussell@vmware.com>
2020-05-28 11:47:15 -04:00
Artem Bilan
5bd6278fcb Fix new sonar smells 2020-05-28 09:56:39 -04:00
Artem Bilan
b8e2dfe4e1 GH-3280: NullChannel as reply for void gateways (#3292)
* GH-3280: NullChannel as reply for void gateways

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

To properly support a one-way gateway (`void` return type), it is
better to ignore any possible replies from downstream instead of
unexpected `no output-channel or replyChannel header available`
error

* Populate a `nullChannel` into a `replyChannel` header
for `void` gateway methods when `replyChannel` is not set explicitly
* Remove redundant `GatewayProxyFactoryBean.PARSER` in favor of
similar `EXPRESSION_PARSER` in the super class
* Test and document the feature

* * Fix language in the `whats-new.adoc`

Co-authored-by: Gary Russell <grussell@vmware.com>

* * Fix language in gateway.adoc

Co-authored-by: Gary Russell <grussell@vmware.com>

Co-authored-by: Gary Russell <grussell@vmware.com>
2020-05-27 16:10:05 -04:00
Artem Bilan
e98169146b GH-3288: Add Kotlin DSL transform(Transformer)
Fixes https://github.com/spring-projects/spring-integration/issues/3288

* For better end-user experience with Kotlin DSL and get a gain from
existing `Transformer` implementations add a `transform(Transformer)`
EI-method into the `KotlinIntegrationFlowDefinition`
* Also add `filter(MessageSelector)` for any out-of-the-box `MessageSelector`

**Cherry-pick to 5.3.x**
2020-05-27 13:39:54 -04:00
Artem Bilan
8d1dd0b68d Some docs clean up 2020-05-27 12:21:24 -04:00
Artem Bilan
8ba27f6e60 Move 5.3 changes to history 2020-05-26 16:54:15 -04:00
Gary Russell
55620973d6 Update spring-amqp version 2020-05-26 13:42:48 -04:00
Vladimir Plizga
7b71a944f5 Fix typo in CONTRIBUTING.adoc 2020-05-26 09:37:29 -04:00
Vladimir Plizga
38a6b8e8c7 GH-3286: Make FileTailingEvent#getMessage public
Fixes https://github.com/spring-projects/spring-integration/issues/3286

The `FileTailingEvent.getMessage()` is really meant to be as `public`

**Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x**
2020-05-21 09:40:41 -04:00
Artem Bilan
665f6bfb69 GH-3282: Fix JdbcMetadataStore for DuplicateKeyEx (#3285)
* GH-3282: Fix JdbcMetadataStore for DuplicateKeyEx

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

The `INSERT INTO ... SELECT ... FROM ... HAVING` may fail with
`DuplicateKeyException` in between transactions.
* Catch `DuplicateKeyException` from in the `tryToPutIfAbsent()`
and return `0` as a fact of not inserted to let other logic to work
as expected.

There is no test coverage for this since it is almost impossible to
reproduce such a race condition on DB

**Cherry-pick to 5.3.x & 5.2.x**

* * Remove misleading message in the comment sentence
2020-05-20 14:45:45 -04:00
Gary Russell
75021beae4 Use Awaitility in TCP/UDP Tests 2020-05-19 15:01:22 -04:00
Artem Bilan
b8f0fb215a Upgrade dependencies & Gradle 2020-05-19 14:10:19 -04:00
Artem Bilan
8f92bb26d3 Start version 5.4
* Fix compatibility after upgrading to some latest dependencies
2020-05-19 12:47:30 -04:00
Gary Russell
42845f03f3 Convert (S)FTP Tests to JUnit5
* Fix SftpTestServer for latest RemoteFileTestSupport changes.
2020-05-18 14:27:45 -04:00
Spring Buildmaster
bc84d47da0 [artifactory-release] Next development version 2020-05-13 20:34:34 +00:00
Spring Buildmaster
8fd0f06854 [artifactory-release] Release version 5.3.0.RELEASE 2020-05-13 20:34:29 +00:00
Artem Bilan
9e1979f62a Upgrade dependencies; prepare for release 2020-05-13 16:03:18 -04:00
Artem Bilan
bf0260a616 GH-3276: reactive inbound: Fix onErrorResume
Fixes https://github.com/spring-projects/spring-integration/issues/3276

The `onErrorResume` for the `MessagingGatewaySupport.doSendAndReceiveMessageReactive()`
was in wrong place: only for the `buildReplyMono` which works only
when an outbound flow is fully based on reactive channels.
With a regular direct channel we can get an exception from the
`sendMessageForReactiveFlow` which is not covered with the mentioned
`onErrorResume` for the error handling on the configured `errorChannel`

Cherry-pick to `5.2.x & 5.1.x`
2020-05-13 15:24:18 -04:00
Artem Bilan
79056581f0 Fix RESOLVABLE_TYPE header population
* We should not build a RESOLVABLE_TYPE header when we map requests.
Only for replies. See: https://github.com/spring-projects/spring-integration-samples/issues/277
* We should log `ClassNotFoundException` only at debug level - to noise with info or warn

**Cherry-pick to 5.2.x**
2020-05-13 13:06:46 -04:00
Yury Kartsev
6bd5ca4cbe Fix XML examples in handler-advice reference doc
1. Add proper terminating tags for `request-handler-advice-chain`.
2. Replace `int:request-handler-advice-chain` with `int-http:request-handler-advice-chain` when used inside of an `int-http:outbound-gateway`.
3. Replace `<bean ref="*" />` with `<ref bean="*" />`
4. Replace `</int:int:service-activator>` with `</int:service-activator>`
2020-05-13 12:16:13 -04:00
Yury Kartsev
aa26d2fc64 Fix typo in reference manual
Fix typo in reference manual for transaction support.
2020-05-11 20:52:05 -04:00
Artem Bilan
d71fb2e5da GH-3271: Close session on error in stream source
Fixes https://github.com/spring-projects/spring-integration/issues/3271

When exception happens at `.withPayload(session.readRaw(remotePath))`
in the `AbstractRemoteFileStreamingMessageSource` we don't close session.
The resource leaking happens in the caching session factory

* Add `session.close();` into the `catch (IOException e) {`
in the `AbstractRemoteFileStreamingMessageSource.doReceive()`
to clean up resources properly

**Cherry-pick to 5.2.x, 5.1.x & 4.3.x**
2020-05-11 16:40:55 -04:00
Artem Bilan
f047f0528b Fix Checkstyle to rely on the absolute path
It turns out that relative path in the property
`<property name="file" value="src/checkstyle/checkstyle-suppressions.xml"/>`
in some cases is resolved against a Gradle deamon dir as a root for configs

* Fix Checkstyle plugin config to use an absolute path in the project for
the `configDirectory`.
* Since `configDirectory` is exposed as a Checkstyle config variable,
we can use its `${config_loc}` placeholder to rely on the absolute path
in the project
2020-05-06 15:53:28 -04:00
Gary Russell
3e63fe4eb7 BoundRabbitChannelAdvice - reject invalid config
Don't allow a `waitForConfirmsTimeout` if the factory is not configured
for simple publisher confirmations.

Otherwise, a runtime error will occur.

**cherry-pick to 5.2.x, 5.1.x**
2020-04-29 15:12:31 -04:00
Spring Buildmaster
346762a0e2 [artifactory-release] Next development version 2020-04-29 18:03:21 +00:00
Spring Buildmaster
f25c91ea46 [artifactory-release] Release version 5.3.0.RC1 2020-04-29 18:03:16 +00:00
Artem Bilan
1f47b6b55d Fix typo in build.gradle 2020-04-29 13:41:17 -04:00
Artem Bilan
cde9506ce4 Upgrade dependencies; prepare for release 2020-04-29 13:30:12 -04:00
Artem Bilan
c264e12deb Fix new Sonar smells 2020-04-29 09:27:54 -04:00
Artem Bilan
dc15910f2c GH-3266: Don't override props in AnnGWProxyFB
Fixes https://github.com/spring-projects/spring-integration/issues/3266

It turns out that `AnnotationGatewayProxyFactoryBean.onInit()` implementation
parses a `@MessagingGateway` attributes ignoring possible properties
population by setters.
This way a Java DSL `GatewayProxySpec` becomes useless since all
its options are overridden by default values from a synthesized
`@MessagingGateway`.
Also it is inconsistency when we declare an `AnnotationGatewayProxyFactoryBean`
as regular bean, but then called setters are ignored

* Add `protected` getters into `GatewayProxyFactoryBean` for all
the properties which can be overridden by annotation attributes
* Fix `AnnotationGatewayProxyFactoryBean` to consult with those getters
before populating a property with value from the annotation

**Cherry-pick to 5.2.x**
2020-04-28 17:27:17 -04:00
Artem Bilan
9ec6529992 Upgrade to Rsocket 1.0-RC7; fix deprecations
* Fix RSocket docs according new functionality

**Cherry-pick to 5.2.x**
2020-04-28 17:20:38 -04:00
Artem Bilan
2d9a5f60f4 Introduce a ReceiveMessageAdvice (#3265)
* Introduce a `ReceiveMessageAdvice`

* Deprecate an `AbstractMessageSourceAdvice` in favor of
`default` method in the `MessageSourceMutator`
* Move a `applyReceiveOnlyAdviceChain()` logic into the `AbstractPollingEndpoint`:
now both `PollingConsumer` and `SourcePollingChannelAdapter` can use
`ReceiveMessageAdvice`
* Introduce a `SimpleActiveIdleReceiveMessageAdvice` based already
on the `ReceiveMessageAdvice` and deprecate a `SimpleActiveIdleMessageSourceAdvice`
which is fully replaceable with newly introduced `SimpleActiveIdleReceiveMessageAdvice`
* Add `@SuppressWarnings("deprecation")` for those out-of-the-box `ReceiveMessageAdvice`
implementation which still use an `AbstractMessageSourceAdvice` for
backward compatibility
* Document a new feature and give the `MessageSourceMutator` a new meaning

* * Fix language in the `polling-consumer.adoc`
2020-04-28 13:03:30 -04:00