Commit Graph

10963 Commits

Author SHA1 Message Date
Spring Builds
3602a0f1a4 [artifactory-release] Next development version 2022-09-20 21:39:56 +00:00
Spring Builds
00ce1ae4a8 [artifactory-release] Release version 5.5.15 2022-09-20 21:39:52 +00:00
Artem Bilan
4f4bdfcaa3 Fix deprecations from SF; prepare for release 2022-09-20 16:34:39 -04:00
Artem Bilan
6e68bd86ea Upgrade dependencies; prepare for release 2022-09-20 14:49:04 -04:00
Artem Bilan
9d73762d5c GH-3888: Fix NPE in the RedisLockRegistry.destroy() (#3889)
* GH-3888: Fix NPE in the `RedisLockRegistry.destroy()`

Fixed https://github.com/spring-projects/spring-integration/issues/3888

When `RedisLockType.SPIN_LOCK` (default), the `RedisLockRegistry.destroy()`
causes an NPE on the `redisMessageListenerContainer` since pub-sub is not used
in a busy-spin mode

* Check for `redisMessageListenerContainer` before calling its `destroy()`

**Cherry-pick to 5.5.x**

* * Reset properties in the `RedisLockRegistry` after `destroy()`
2022-09-20 14:30:26 -04:00
Gary Russell
63109f7ce2 GH-3878: Fix Javadocs for JdbcChannelMessageStore
Resolves https://github.com/spring-projects/spring-integration/issues/3878

**cherry-pick to 5.5.x**

Fix .gitignore
2022-08-31 10:29:11 -04:00
Artem Bilan
326e7acd7a Fix flowFromSupplier sample in kotlin-dsl.adoc
**Cherry-pick to 5.5.x**

# Conflicts:
#	src/reference/asciidoc/kotlin-dsl.adoc
2022-08-28 09:56:21 -04:00
Artem Bilan
b7710fcd4d GH-3875: Initialize ClassUtils as early as possible
Fixes https://github.com/spring-projects/spring-integration/issues/3875

The class `static` variables and initialization block are performed on first class access.

* Add "fake" `ClassUtils.resolvePrimitiveType(Integer.class)` call to the `IntegrationRegistrar`
to trigger `ClassUtils` initialization with the current Spring `ClassLoader`

**Cherry-pick to `5.5.x`**
2022-08-17 13:22:37 -04:00
Spring Builds
718d8a43a7 [artifactory-release] Next development version 2022-07-19 18:17:09 +00:00
Spring Builds
3183ff319d [artifactory-release] Release version 5.5.14 2022-07-19 18:17:04 +00:00
Artem Bilan
6ec55f9498 Fix Hibernate version 2022-07-19 13:34:33 -04:00
Artem Bilan
2fb87c8db1 Upgrade dependencies; prepare for release 2022-07-19 13:18:37 -04:00
Artem Bilan
8543798b10 Disable some time-sensitive tests on CI
**Cherry-pick to `5.5.x`**
2022-07-19 12:37:29 -04:00
Artem Bilan
f92a37786b GH-3843: propagate ErrorMessage.originalMes in MH
Fixes https://github.com/spring-projects/spring-integration/issues/3843

The `MessageHistory.write()` is missing the `ErrorMessage.originalMessage`
on creating a new `ErrorMessage` with message history header

* Reuse an `ErrorMessage.originalMessage` for newly created `ErrorMessage`
after populating the message history header

**Cherry-pick to `5.5.x`**
2022-07-18 15:49:09 -04:00
Artem Bilan
19b466809d GH-3827: Fix RemoteFile GET STREAM session leak
Fixes https://github.com/spring-projects/spring-integration/issues/3827

The `AbstractRemoteFileOutboundGateway.doGet()` for a `STREAM` option
does not close the `session` in case of error.
This may lead to some leaks or exhausted caches

* Close `session` in the `catch()` of the `AbstractRemoteFileOutboundGateway.doGet()`
* Adjust the `SftpServerOutboundTests` to configure a `CachingSessionFactory`
for the `testStream()` to verify there is no leaks attempting to
`GET STREAM` non-existing remote file twice

**Cherry-pick to `5.5.x`**
2022-07-18 14:08:26 -04:00
Artem Bilan
b6b649396b Fix KafkaOutAdapterParserTests race condition
The `Future` for `Producer.send()` can be fulfilled before
we return it (`isDone()`), so `KafkaTemplate` short-circuits
with a `KafkaException`.

* Modify `KafkaOutboundAdapterParserTests.testSyncMode()`
to assert against `KafkaException` which may be thrown earlier
then previously expected `KafkaProducerException`

**Cherry-pick to `5.5.x`**
2022-07-18 13:06:20 -04:00
Artem Bilan
3bfaa3868b Fix IntegrationMBeanExporter logic for endpoints
Related to https://stackoverflow.com/questions/72851234/error-in-startup-application-when-using-serviceactivator-in-spring-cloud-stream

The `MessagingAnnotationPostProcessor` register an `endpoint` bean for Messaging Annotation on POJO methods.
The `IntegrationMBeanExporter` post-process such a bean and registers respective MBean.
It does this not in optimal way scanning all the `IntegrationConsumer` beans for requested `MessageHandler`
which may cause a `BeanCurrentlyInCreationException`.

* Rework the logic of the `IntegrationMBeanExporter.postProcessAbstractEndpoint()` to propagate provided endpoint
for the monitor registration to bypass application context scanning for matched name.
* Swap `equals()` for `monitor` since an `extractTarget()` may return `null`
* Some other code clean in the `IntegrationMBeanExporter`
* Change one of the `@ServiceActivator` in the configuration for the `ScatterGatherHandlerIntegrationTests`
to POJO method.
However, this didn't fail for me with original code unlike in the sample application provided in the mentioned SO thread.

**Cherry-pick to `main`**
2022-07-11 10:30:37 -04:00
Artem Bilan
8228269fde ClassUtils: deprecate methods with typos
The `ClassUtils.isKotlinFaction0()` and `ClassUtils.isKotlinFaction1()`
are wrong names.

* Deprecate `ClassUtils.isKotlinFaction0()` and `ClassUtils.isKotlinFaction1()`
in favor of newly introduced `isKotlinFunction0()` and `isKotlinFunction1()`

**Cherry-pick to `main`**
2022-07-09 15:36:45 -04:00
Gary Russell
ecb04bbb54 GH-3826: Fix reducePermits
Must not go negative.
2022-06-27 14:38:04 -04:00
Artem Bilan
d3bf48ca3f GH-3826: Fix SimplePool for resizing from MAX
Fixes https://github.com/spring-projects/spring-integration/issues/3826

By default, the `SimplePool` is used with an `Integer.MAX_VALUE` pool size.
There is a performance degradation in the `setPoolSize()` when we try to
decrease the pool size: the `while` for `permits.tryAcquire()` is too long
close to the current `Integer.MAX_VALUE` pool size

* Revise the logic in the `setPoolSize()` to use `Semaphore.reducePermits()`
instead of the loop.
* Change the calculation for a new pool size for the current pool state:
or it is a size of a new request, or iti s equal to the `inUse.size()`.
It will be reduced on subsequent `releaseItem()` calls
* Reduce the number of `available` according a new pool size based on the `inUse`.
So, if `inUse > newPoolSize`, the `available` is cleared.
Otherewise, it is reduced to the number which would give `newPoolSize` together
with the `inUse` size

**Cherry-pick to `5.5.x`**
2022-06-27 13:48:54 -04:00
Artem Bilan
404fce8494 Fix MongoDbAvailableRule for assumeTrue()
Currently, the `MongoDbAvailableRule` logs a warning about missed availability
of the MongoDb server and returns from the `Statement.evaluate()` making the
test not ignored but as passed

* Fix the exception handling in the `MongoDbAvailableRule` for the `Statement`
to call `Assume.assumeTrue()` instead of the plain logging to mark the test as
ignored.
This will make a JUnit test report looking correctly and also will let Sonar Cube
to report test coverage as adequate

**Cherry-pick to `5.5.x`**
2022-06-23 16:34:30 -04:00
Spring Builds
2200c1daad [artifactory-release] Next development version 2022-06-22 18:28:09 +00:00
Spring Builds
15155206d7 [artifactory-release] Release version 5.5.13 2022-06-22 18:28:06 +00:00
Artem Bilan
1595825633 Upgrade dependencies; prepare for release
* Upgrade to Gradle `7.4.2`
2022-06-22 13:03:23 -04:00
Lucas Bowler
9e8fe0d144 GH-3822: Reconnection for MQTTv5 channel adapters
Fixes: https://github.com/spring-projects/spring-integration/issues/3822

* Apply spring-framework code style on modified class
* Remove unwanted formatting
* Take pull request comments into account
* Code and JavaDocs clean up
* Improve `Mqttv5BackToBackAutomaticReconnectTests` removing non-related code
* Improve `mqtt.adoc` for this new manual reconnection feature

**Cherry-pick to `5.5.x`**
2022-06-17 14:07:08 -04:00
Artem Bilan
32960fa98c Fix RedisLockRegistry for Java 8 compatibility 2022-06-08 13:44:44 -04:00
unseok kim
cce90eaef6 GH-3805: Introduce RedisLockRegistry.RedisLockType mode
Fixes https://github.com/spring-projects/spring-integration/issues/3805

The Redis Pub-Sub doesn't work in all the environment, therefore there has to
be a choice to use old busy-spin algorithm

* Change to select between spinLock method and pub-sub method
* Make spinLock as a default one to let the `RedisLockRegistry` work everywhere
* Fix javadoc, convention, lazy init
* Fix javadoc, convention
* Code clean up and docs for `RedisLockType` feature

**Cherry-pick to 5.5.x**
2022-06-08 13:17:00 -04:00
Artem Bilan
9f4f91d5f9 Use bean CL for JdbcMessageStore.deserializer
Related to https://stackoverflow.com/questions/72305387/spring-integration-delayer-starts-sending-null-message-payloads-when-switched

In some async use-cases (e.g. `DelayHandler`), the context classloader
might be different for the data to be deserialized from message store.

* Fix `JdbcMessageStore` to populate a bean `ClassLoader` into default
`AllowListDeserializingConverter` from the application context.
The provided `Deserializer` must ensure such a `ClassLoader` itself
* Add warning message to the `LambdaMessageProcessor` when converter
returns `null` for the payload it cannot convert to expected type.
Cannot be raised as error since some applications may already rely
on the `null` conversion result in their method arguments

**Cherry-pick to `5.5.x`**
2022-06-01 12:52:39 -04:00
Artem Bilan
469bd6ba04 GH-3816: Fix MongoDb module for the latest SD
Fixes https://github.com/spring-projects/spring-integration/issues/3816

The `MappingMongoConverter` now used different path when it
iterates documents form conversion from a DB cursor

* Fix `MongoDbMessageStore.MessageReadingMongoConverter` to override
a `read(TypeInformation<S>, Bson)` method to convert a `MessageWrapper` properly
* Upgrade to the latest MongoDb driver
2022-05-27 14:40:58 -04:00
Artem Bilan
ab6060fb2d The testWindowTimespan() is time-sensitive
The `FluxAggregatorMessageHandlerTests.testWindowTimespan()`
relies on the time-based window function of `100` millis.
Looks like a delay of `Thread.sleep(20)` may cause a resources race
condition and window is released only with one item.

* Disable `testWindowTimespan()` since there is no guarantee with what
timing settings it is going to work stably

**Cherry-pick to `5.5.x`**
2022-05-27 12:44:12 -04:00
Artem Bilan
5a42d7137a Deprecate TestUtils.dockerRegistryFromEnv()
The Testcontainers rely on the `TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX` ENV var
and build proper image name automatically.

* Deprecate `TestUtils.dockerRegistryFromEnv()` and remove its usage in the project
2022-05-27 12:44:12 -04:00
Artem Bilan
a614e4bdf9 Really reuse Testcontainers
The `withReuse(true)` and `testcontainers.reuse.enable=true` don't work together with `@Container`.
The JUnit extension gathers those containers and stop them in the end of test class unconditionally.

* Remove `@Container` annotation usage
* Use `@BeforeAll` and `GenericContainer.start()` manually
This way the container ensures to reuse existing running container and don't start a fresh one.
Since the container instance is stored in a `static` property, it is really started only once.
The rest tests in a suite just reuse that existing container.
Ryuk container will take care about their stopping and removal eventually afte JVM exit.

**Cherry-pick to `5.5.x`**

# Conflicts:
#	spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/mysql/MySqlContainerTest.java
2022-05-27 12:44:12 -04:00
Matthias Stock
c091a2d125 Removed dead link from jdbc.adoc
The linked resource is not available anymore:
https://web.archive.org/web/20210228160648/https://blog.engineyard.com/5-subtle-ways-youre-using-mysql-as-a-queue-and-why-itll-bite-you
2022-05-27 12:44:12 -04:00
Spring Builds
77ab988c59 [artifactory-release] Next development version 2022-05-27 12:44:07 -04:00
Spring Builds
994b176fc6 [artifactory-release] Release version 5.5.12 2022-05-27 12:43:55 -04:00
Artem Bilan
409d4d9358 Upgrade dependencies; prepare for release 2022-05-17 15:18:45 -04:00
Artem Bilan
3a8f3d8edb GH-3800: Fix Kotlin docs for route() DSL
Fixes https://github.com/spring-projects/spring-integration/issues/3800

* Mention `Message` as a type for reified generic argument in Kotlin DSL docs

**Cherry-pick to `5.5.x`**
2022-05-17 15:05:01 -04:00
Artem Bilan
b156e196ca GH-3794: Use less memory with scheduled tasks
Fixes https://github.com/spring-projects/spring-integration/issues/3794

* Replace hard reference to message group with its `id` in the
`AbstractCorrelatingMessageHandler.removeEmptyGroupAfterTimeout()`
* Replace hard reference to message with its `id` in the
`DelayHandler.rescheduleAt()`

**Cherry-pick to `5.5.x`**
2022-05-10 14:34:51 -04:00
Artem Bilan
f64ad0f509 GH-3785: Close stream for persistent collection (#3786)
* GH-3785: Close stream for persistent collection

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

* Fix `CollectionArgumentResolver` and `PayloadsArgumentResolver` to
close the `Stream` of message after its usage
* Rework `AbstractKeyValueMessageStore.removeMessagesFromGroup()`
to iterate input collection of messages not its stream to avoid
the mentioned problem

**Cherry-pick to `5.5.x`**

* * Add `JdbcMessageStoreTests.testMessageGroupStreamNoConnectionPoolLeak()`
to ensure that no leaks in the connection pool anymore.
* Improve `MessageGroupStore.streamMessagesForGroup()` JavaDocs about
requirements to close the `Stream` from persistent message store impls
2022-04-25 10:19:10 -04:00
Spring Builds
6788cc9a27 [artifactory-release] Next development version 2022-04-19 15:02:38 +00:00
Spring Builds
837f8ff00f [artifactory-release] Release version 5.5.11 2022-04-19 15:02:34 +00:00
Artem Bilan
cd73b61ffe Upgrade dependencies; prepare for release
* Make `artifactoryPublish` `dependsOn build` to ensure
that artifacts are not deployed until tests pass
2022-04-19 10:25:01 -04:00
Artem Bilan
f5efa0deac GH-3765 Resolve Lookup ctor lazily via reflection
Fixes https://github.com/spring-projects/spring-integration/issues/3765

The `DefaultMethodInvokingMethodInterceptor` has several strategies
for `default` method invocations in the messaging gateway.
One of them is based on the `Lookup` constructor which causes
a `WARNING: An illegal reflective access operation has occurred`.
This can be done lazily when there is no `MethodHandles.privateLookupIn`
in Java version used for the project.

* Fix `OPEN` enum value for the `Constructor<Lookup>` to be resolved in
a lazy manner via `Supplier` and `boolean` flag

**Cherry-pick to `5.5.x`**
2022-04-11 14:29:55 -04:00
Artem Bilan
c75be107fa Close mail folder if no messages to produce
Related to https://stackoverflow.com/questions/71667731/spring-integration-mimemessage-gmail-folder-is-not-open-exception

If no mail messages pulled from the folder or all of them are filtered out,
there is nothing to produce downstream.
Therefore, always close the folder in the end of `AbstractMailReceiver.receive()`
when no messages and even if `autoCloseFolder == false`

**Cherry-pick to `5.5.x`**
2022-04-07 14:16:39 -04:00
Artem Bilan
de4b3a3e11 Removed unused import 2022-03-29 09:23:33 -04:00
Artem Bilan
b64577262b Remove Werror option from JavaDoc config
This option is not available in Java 11 yet
2022-03-28 11:34:16 -04:00
Artem Bilan
6d86a15221 Enforce Java with Gradle options.release = 8
* Add suppressions for JavaDoc warnings
* Fix some tests for Java 17 compatibility
2022-03-28 11:28:43 -04:00
Artem Bilan
81f5b6bbbd Fix JacksonJsonUtils for Java 8 compatibility 2022-03-24 13:08:27 -04:00
Artem Bilan
dfaf5001fe Fix AMQP test for NPE from mocks
https://build.spring.io/browse/INT-MAIN-261/

**Cherry-pick to `5.5.x`**
2022-03-23 15:40:00 -04:00
Gary Russell
343be47c04 RGH-1439: AMQP: Log Warn For Misconfigured Confirm
See https://github.com/spring-projects/spring-amqp/issues/1439

**cherry-pick to 5.5.x*
2022-03-23 15:01:52 -04:00