Commit Graph

11554 Commits

Author SHA1 Message Date
Artem Bilan
5bf94c68a9 Add jf gradlec for verify staging WF 2023-12-07 16:10:51 -05:00
Artem Bilan
6a9632e2ba Use jf to run Gradle (for possible auth) 2023-12-07 16:08:36 -05:00
Artem Bilan
9e8f395098 Bring back JFrog for verify staging
We need to auth for Artifactory before pulling from `https://repo.spring.io/libs-staging-local`
2023-12-07 16:04:26 -05:00
Artem Bilan
a2c264f51f Fix verify staging WF without JFrog 2023-12-07 15:46:48 -05:00
Artem Bilan
a733935ef1 Rework verify staging WF for Gradle init script
**Cherry-pick to `6.1.x`**
2023-12-07 15:44:19 -05:00
Artem Bilan
940ec888f7 Add new line in the end of FileTailMessProdTests
**Cherry-pick to `6.1.x`**
2023-12-06 13:27:36 -05:00
Artem Bilan
a6f826e1cf Remove unused imports from FileTailMessProdTests
The Checkstyle violation for unused imports in the `FileTailingMessageProducerTests`
Leftover from the previous fix for this class

**Cherry-pick to `6.1.x`**
2023-12-06 13:11:57 -05:00
Artem Bilan
a3d347eddd Fix FileTailingMessProducerTests for tail events
The `OSDelegatingFileTailingMessageProducer` publishes event from scheduled task

* Modify `FileTailingMessageProducerTests.testGuts()` to use `CountDownLatch`
to wait for those asynchronous events

**Cherry-pick to `6.1.x`**
2023-12-06 12:56:07 -05:00
Artem Bilan
9db838eaee Fix Build Status Badge in README for GH Actions 2023-12-06 12:23:08 -05:00
Artem Bilan
c7e3a7c24a GH-8800: Fix SMB Gateway for recursive MGET
Fixes: gh-8800

The `SmbFile.getName()` returns plain file name, not with a
sub-directory as it is expected by the `AbstractRemoteFileOutboundGateway`
for (S)FTP protocols

* Introduce `AbstractRemoteFileOutboundGateway.getFullFileName()`
with dir and file name concatenation by default (as it was before)
and override it in the `SmbOutboundGateway` to return the full path according this protocol.
* Fix `SmbOutboundGateway.enhanceNameWithSubDirectory()` to return an `SmbFile` instance
since it has all the info about remote file, include requested directory
* Fix `SmbOutboundGateway.getFilename()` to remove the trailing `/` in the dir name
since this is not what expected by the `AbstractRemoteFileOutboundGateway` logic

**Cherry-pick to `6.1.x`**
2023-12-06 17:29:28 +01:00
Artem Bilan
6d2bf330d1 Add backport-issue.yml GHA workflow 2023-12-06 10:28:11 -05:00
Artem Bilan
ba287aeb5b GH-8797: Fix DefSftpSessionFactory.timeout logic
Fixes https://github.com/spring-projects/spring-integration/issues/8797

After migration to Apache MINA we have missed to fix `DefaultSftpSessionFactory.timeout`
to be `0` by default as it states in its Javadocs and reference manual
It is `null` by default which really means an infinite wait.

* Fix `DefaultSftpSessionFactory.timeout` to be a reasonable 30 seconds by default
* Fix `setTimeout()` Javadocs and respective `session-factory.adoc`
* Propagate this `timeout` down to the `SftpClient` for its commands interactions
2023-12-04 13:30:33 +01:00
Artem Bilan
9f7acd7d9d Add explicit ref to verify-staged-artifacts.yml
**Cherry-pick to `6.1.x`**
2023-12-01 17:34:57 -05:00
Artem Bilan
504212592e Migrate CI/CD to GitHub Actions
* Remove JFrog plugin since it is supplied from CI/CD by Gradle init script
* Remove Sonar and Jacoco since we don't manage those service anymore
2023-12-01 16:40:40 -05:00
Artem Bilan
b0194e955e Change developer emails 2023-11-28 12:06:22 -05:00
Spring Builds
fd8e0368fb [artifactory-release] Next development version 2023-11-21 20:31:05 +00:00
Spring Builds
10bb183c05 [artifactory-release] Release version 6.2.0 2023-11-21 20:31:02 +00:00
Artem Bilan
52030de72a Upgrade to Spring GraphQL 1.2.4 2023-11-21 13:28:32 -05:00
Artem Bilan
e18d4ebdbb Bring back previous Derby version
Looks like the latest one available is already compiled against Java `21`
2023-11-20 18:49:49 -05:00
Artem Bilan
7428d0b9b2 Upgrade dependencies 2023-11-20 18:30:00 -05:00
Artem Bilan
10a764729c Fix MessageDrivenAdapterTests for partitions
Related to https://github.com/spring-projects/spring-kafka/issues/2891

Starting with Spring for Apache Kafka `3.1`, the `ackMode` for
listener container is coerced to `MANUAL` if no `groupId` assigned
2023-11-18 10:19:41 -05:00
Artem Bilan
22c4db291b GH-8792: Fix File StreamingMS for one file filter
Fixes https://github.com/spring-projects/spring-integration/issues/8792

1. Use a `SftpStreamingMessageSource` with a `maxFetchSize = 5` and a `ChainFileListFilter` filter composed with
`SftpSystemMarkerFilePresentFileListFilter` which `supportsSingleFileFiltering == false`
2. Put 2 files in the folder and invoke `SftpStreamingMessageSource.receive()` method twice.
3. Put 5 files in the folder and invoke `SftpStreamingMessageSource.receive()`` method five times.
4. The last two files won't be received.

When you set max fetch size to a number bigger than one (for example 5) and at a certain point
it is necessary to `this.toBeReceived.clear()` inside `AbstractRemoteFileStreamingMessageSource.doReceive()`,
those removed elements from toBeReceived are not rolled back.

* Fix `AbstractRemoteFileStreamingMessageSource.listFiles()` to calculate `maxFetchSize` as `getMaxFetchSize() - this.fetched.get()`

**Cherry-pick to `6.1.x`, `6.0.x` & `5.5.x`**
2023-11-17 16:39:02 -05:00
Artem Bilan
d95bc681dd GH-8786: Make FtpSession.finalizeRaw() robust
Fixes https://github.com/spring-projects/spring-integration/issues/8786

If `FtpSession.readRaw()` fails, the next `FtpSession.finalizeRaw()` call
would lead to `FTPClient.completePendingCommand()` failure since
there is no command to finish.

* Fix `FtpSession.finalizeRaw()` to exit earlier positively in case of
`FTPReply.isNegativePermanent()` for the current reply code set by the failure
from a previous `FtpSession.readRaw()`

**Cherry-pick to `6.1.x`, `6.0.x` & `5.5.x`**
2023-11-14 09:03:02 +01:00
Artem Bilan
264b21eda7 Fix condition in build.gradle 2023-11-13 17:07:30 -05:00
Artem Bilan
cfce3d027f Some build.gradle optimization
* Move `api project(':spring-integration-core')` to the common `dependencies` section
* Remove redundant `exclude group: 'org.springframework'`
* Add some required deps for `CassandraContainer`
2023-11-13 16:48:12 -05:00
Artem Bilan
87a0705985 Fix race condition in HazelcastMetadataStoreTests
The listener on `IMap` is called in async manner.

* Add `await().untilAsserted()` for the first `verify(listener)`
* Migrate this `HazelcastMetadataStoreTests` to JUnit 5
2023-11-13 15:26:37 -05:00
Gary Russell
4f86320228 Increase Timeouts in FTP RotatingServersTests
Some unknown delays on MacOS cause the tests to fail.
2023-11-13 14:35:13 -05:00
Artem Bilan
537add5cf0 GH-8785: Propagate WebSocket client connect fail
Fixes https://github.com/spring-projects/spring-integration/issues/8785

The `ClientWebSocketContainer.start()` delegates to the `IntegrationWebSocketConnectionManager`
which performs an async connection to the server.

* Wait for `connectionLatch` in the `ClientWebSocketContainer.start()`
and check for `this.openConnectionException != null` to re-throw.
Mark `ClientWebSocketContainer` as stopped in that case

**Cherry-pick to `6.1.x` & `6.0.x`**
2023-11-09 13:08:28 +01:00
Mattias
bcfd81abba Fix sample in sftp/streaming.adoc
* Add missing `/` between the path and filename.
2023-11-08 09:54:09 -05:00
Artem Bilan
96adc08ad8 Adapt AMQP tests to latest Rabbit Streams Client
Related to https://github.com/spring-projects/spring-amqp/issues/2522

No need to use an `AddressResolver` with the latest RabbitMQ Streams Client library
The current configuration is reflecting whatever Spring Boot auto-configuration experience
would expect from us
2023-11-06 15:14:52 -05:00
Artem Bilan
a8b9a3d844 Upgrade dependencies
* Upgrade to the latest Gradle
* Upgrade to the latest Antora libraries
* Move Spring deps to SNAPSHOTs
* Fix deprecation in the AMQP test
2023-11-06 15:10:48 -05:00
Andrii Hrytsiuk
ead97bba85 Fix some typos in docs
* Replaced phrase 'String with version' to 'Starting with version'
* Fixed formatting for code block
2023-11-06 12:04:27 -05:00
Artem Bilan
2eca467423 Fix link label for Expression Advice in docs 2023-11-06 11:19:39 -05:00
Artem Bilan
5370d50932 GH-8773: Fix MGS for removal from group
Fixes https://github.com/spring-projects/spring-integration/issues/8773

The https://github.com/spring-projects/spring-integration/issues/8732 introduced a filtering for messages in group.
So, plain `removeMessage()` doesn't work any more if message is connected to some group yet.
Therefore, `DelayHandler` is failing.

* Introduce `getMessageFromGroup()` and `removeMessageFromGroupById()` into `MessageGroupStore` API
and implement it respectively in all the stores
* Remove `@LongRunningTest` from delayer integration tests and adjust its config to delay not for a long

**Cherry-pick to `6.1.x`**
2023-11-03 19:37:38 +01:00
Kurt Hong
adb89706de Remove RetryListener from KafkaInbounds
* KafkaMessageDrivenChannelAdapter's ATTRIBUTES_HOLDER should be isolated.
In order to achieve custom retry in batch mode, we may to use a RetryTemplate in listener itself. But if the RetryTemplate is shared with another KafkaMessageDrivenChannelAdapter, batch mode's ATTRIBUTES_HOLDER might be over-written by another KafkaMessageDrivenChannelAdapter's IntegrationRecordMessageListener.
The situation is like shown below.
- There is only one RetryTemple bean in the application.
- There are two KafkaMessageDrivenChannelAdapters(A,B) in the application.
- A KafkaMessageDrivenChannelAdapter is batch mode and utilizing the retryTemplate in the listener.
- B KafkaMessageDrivenChannelAdapter is record mode and using the retryTemplate itself.
- (B KafkaMessageDrivenChannelAdapter's recordListener is registered in the retryTemplate.)
- When A retry is attempted in the listener, it will trigger B KafkaMessageDrivenChannelAdapter's recordListener.
- B KafkaMessageDrivenChannelAdapter's recordListener will overwrite A KafkaMessageDrivenChannelAdapter's ATTRIBUTES_HOLDER.

* should not mutate an externally provided RetryTemplate

* should not expose KafkaInboundEndpoint's methods outside the class and fix a checkstyle error.

* removing unused code and polishing

* restore retry around batch and bring back KafkaInboundEndpoint to endpoints.

* remove retry logic in batch mode and move ATTRIBUTES_HOLDER into KafkaInboundEndpoint

* remove generic type parameters of KafkaInboundEndpoint

* fix style error

---------

Co-authored-by: kurt <kurt@weversecompany.com>
2023-11-02 11:01:14 -04:00
Artem Bilan
f0561b610d GH-8778: Fix KafkaMessageSource deadlock (#8780)
* GH-8778: Fix KafkaMessageSource deadlock

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

The `KafkaMessageSource.doReceive()` have a lock around its whole body.
That includes the `pollRecord()` which can be blocked on the `KafkaConsumer.poll()`.
This way the rest of lifecycle management callbacks can be blocked until `KafkaConsumer.poll()` returns.

* Rework lifecycle management flags to `AtomicBoolean` since there is not too much work
in their respective callbacks
* Decrease a locking block in the `doReceive()` just to consumer setup part.
Leave `pollRecord()` outside of the lock
* Add `this.consumer.wakeup()` into `stopConsumer()` to break a `poll()` cycle
and return immediately for the next `close()` call

**Cherry-pick to `6.1.x` & `6.0.x`**

* * Use `compareAndSet` in `start` & `stop`
2023-10-26 15:33:38 -04:00
Artem Bilan
37fb37d7d8 GH-8779: MongoDbMS Fix distinct result conversion (#8781)
Fixes https://github.com/spring-projects/spring-integration/issues/8779

The `MongoTemplate` has now a `findDistinct()` API with a smart
result conversion instead of native driver plain expectations

**Cherry-pick to `6.1.x` & `6.0.x`**
2023-10-26 15:29:03 -04:00
Artem Bilan
769367deea GH-8770: Add PostgresSubsChannel.errorHandler (#8777)
* GH-8770: Add `PostgresSubsChannel.errorHandler`

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

The problem with the `PostgresSubscribableChannel.notifyUpdate()` is that the try-catch block is outside the loop,
so the loop will die on an exception, leaving further messages unprocessed.

* Add ``PostgresSubscribableChannel.errorHandler` option to be invoked
after a `RetryTemplate` and for every failed message.
* The `askForMessage()` new logic is to catch an exception on a message and call `errorHandler`
returning a `FALLBACK_STUB` to continue an outer loop in the `notifyUpdate()`

**Cherry-pick to `6.1.x` & `6.0.x`**

* * Rename private `PostgresSubscribableChannel.askForMessage()` method to more specific `pollAndDispatchMessage()`
2023-10-25 13:26:24 -04:00
Artem Bilan
4b27a3c521 Disable ci-snapshot for push event for now 2023-10-23 12:41:55 -04:00
Artem Bilan
102087b07a Add ci-snapshot.yml GHA Workflow
* Make it reuse a workflow from `spring-integration-aws` as an experiment
2023-10-23 11:48:03 -04:00
Igor Dianov
6db704158f GH-8768: Fix countQuery in JdbcMetadataStore
Fixes https://github.com/spring-projects/spring-integration/issues/8768

The `countQuery` is accidentally formatted against `putIfAbsentValueQuery`
2023-10-18 09:57:49 -04:00
Spring Builds
82d9ecfb75 [artifactory-release] Next development version 2023-10-17 17:53:37 +00:00
Spring Builds
6cb5bd3752 [artifactory-release] Release version 6.2.0-RC1 2023-10-17 17:53:33 +00:00
Artem Bilan
e933d63868 Fix PostgresSubscribableChannel race condition
The `PostgresSubscribableChannel` uses a task executor
for dispatching messages.
Even if we stop `PostgresChannelMessageTableSubscriber` and
unsubscribe from the channel, the task might be ongoing.

* Use explicit `ThreadPoolTaskExecutor` in the test
to shout it down and wait for tasks to be completed before
verifying DB status
* Optimize `PostgresSubscribableChannel` to mark TX for rollback
when we got a message from DB, but no handlers subscribed
2023-10-17 13:25:05 -04:00
Artem Bilan
bb908d8077 Upgrade dependencies; prepare for release
* Adapt `RabbitTestContainer` to the deprecations in the Testcontainers
2023-10-17 12:21:22 -04:00
Artem Bilan
bdefd8a6ec Deprecate spring-integration-security module
The `SecurityContextPropagationChannelInterceptor` has been migrated to `spring-security-messaging`.
Since it was only the class in the `spring-integration-security`, it is now fully considered
as deprecated
* Remove all the tests from `spring-integration-security`
* Modify `HttpDslTests` to demonstrate the `spring-security-messaging` in action
which has been replaced with whatever there was in `spring-integration-security`
* Remove redundant `exclude group: 'org.springframework'` for security
dependencies in `build.gradle` since all of them rely on the same SF deps
as SI
2023-10-17 17:30:21 +02:00
Johannes Edmeier
87a2ac5b5c GH-8760 Postgres: using DELETE ... RETURNING
Fixes https://github.com/spring-projects/spring-integration/issues/8760

* Make `PostgresChannelMessageStoreQueryProvider` to use single `DELETE ... RETURNING` for polling statements
* Add `isUsingSingleStatementForPoll` and use it from `JdbcChannelMessageStore`
* Execute Postgres init scripts to `PostgresContainerTest`
* Code clean up
* Document the new feature
2023-10-17 11:26:46 -04:00
Falk Hanisch
29186e2b46 GH-8757: Add nullabilty to .support.converter
Fixes https://github.com/spring-projects/spring-integration/issues/8757

* Add ctor `ObjectStringMessageConverter(Charset)`
* create tests for `ObjectStringMessageConverter`
* fix codestyle issues
* revise JavaDoc
* `@NonNullApi` for `org.springframework.integration.support.converter`
* revise `SimpleMessageConverter`
* `inboundMessageMapper` and `outboundMessageMapper` are initialized to their default implementations
Bboth are set in non-default ctors with final setters
* remove `@Nullable` from `private BeanFactory beanFactory`
* Handle empty `String... headerNames`
* Some code clean up
2023-10-16 15:59:21 -04:00
Artem Bilan
6909fbe7ad Fix race condition in GatewayInterfaceTests 2023-10-16 15:34:14 -04:00
Artem Bilan
ea8d917278 Code clean up for UUIDConverter 2023-10-16 14:10:41 -04:00