Commit Graph

62 Commits

Author SHA1 Message Date
Artem Bilan
4f48cc8150 Improve docs for Python support 2024-10-04 16:21:01 -04:00
Wim De Troyer
f4f246d8c7 Fix typos in the distributed-locks.adoc 2024-10-04 10:03:07 -04:00
Artem Bilan
2cf2f109f9 Revert "GH-9455: Introduce IntegrationKeepAlive (#9493)"
This reverts commit 8f838d04ce.
2024-09-30 13:34:07 -04:00
Martin Tomik
3a8e3abc7d GH-9492: Honor @Nested in @SpringIntegrationTest
Fixes: #9492
Issue link: https://github.com/spring-projects/spring-integration/issues/9492

Switches `MockIntegrationContextCustomizerFactory` & `SpringIntegrationTestExecutionListener`
to use `TestContextAnnotationUtils` in order to properly support
`@NestedTestConfiguration` semantics.

Adds an integration test with a base class and several
`@Nested` inner test classes to verify the various
permutations of `@SpringIntegrationTest` inherit/override
behavior when used w/ `@NestedTestConfiguration`.

**Auto-cherry-pick to `6.3.x` & `6.2.x`**
2024-09-27 10:47:43 -04:00
Artem Bilan
8f838d04ce GH-9455: Introduce IntegrationKeepAlive (#9493)
Fixes: #9455
Issue link: https://github.com/spring-projects/spring-integration/issues/9455

* Add an `IntegrationKeepAlive` infrastructure bean to initiate a long-lived non-daemon thread
to keep application alive when it cannot be kept like that for various reason, but has to.
* Expose `spring.integration.keepAlive` global property to disable an `IntegrationKeepAlive` auto-startup
* Test and document the feature
2024-09-25 14:31:41 -04:00
Artem Bilan
52e8174c66 Improve docs for GraalVM Polyglot dependencies
* Deprecate `jython` language indicator since only GraalVM Polyglot is there from now on
2024-09-25 13:03:07 -04:00
Artem Bilan
ec31a5bed8 GH-9507: Migrate Python support to GraalVM Polyglot
Fixes: #9507
Issue link: https://github.com/spring-projects/spring-integration/issues/9507

* Deprecate `PythonScriptExecutor` in favor of `PolyglotScriptExecutor` with a `python` as language
* Add handling for `PolyglotWrapper` return type of the script evaluation
* Rework `DeriveLanguageFromExtensionTests.testParseLanguage()` to the `@ParameterizedTest`
2024-09-24 17:19:43 -04:00
Artem Bilan
a6c3a30d5b GH-9452: Expose ZipTransformer.setFileNameGenerator()
Fixes: #9452
Issue link: https://github.com/spring-projects/spring-integration/issues/9452

* Move the logic about `fileNameGenerator` configuration out of `AbstractZipTransformer`
since this property is not used by `UnZipTransformer` implementation
* Add more docs about `ZipTransformer` logic
2024-09-12 16:19:17 -04:00
Artem Bilan
e3a46ca528 GH-9436: Add support for SpEL IndexAccessor configuration (#9451)
Fixes: #9436
Issue link: https://github.com/spring-projects/spring-integration/issues/9436

* Expose `IndexAccessor` configuration options on the `AbstractEvaluationContextFactoryBean`
and `SpelPropertyAccessorRegistrar`
* Expose `<index-accessors>` sub-element for the `<spel-property-accessors>`
* Adjust tests
* Document the feature, including recently added `JsonIndexAccessor`
2024-09-12 15:38:58 -04:00
SSHINE OF BORG
d5d9f754c8 Fix LockRegistrty typo in the distributed-locks.adoc 2024-09-10 20:11:58 +00:00
Artem Bilan
e9a577d6bd GH-9428: Emit MQTT delivery events even if share client instance
Fixes: #9428

Issue link: https://github.com/spring-projects/spring-integration/issues/9428

When `ClientManager` is used for MQTT channel adapters, a `MqttMessageDeliveredEvent`
is not emitted since callback for the `ClientManager` is not aware about `deliveryComplete`

* Use a `MqttActionListener` abstraction for the `publish` operation instead of a `deliveryComplete`
from a common callback
* Make some other refactoring into the `MqttPahoMessageHandler` and `Mqttv5PahoMessageHandler`
extracting a common logic into their `AbstractMqttMessageHandler` superclass
* Introduce an `MqttMessageNotDeliveredEvent` to be emitted from the `MqttActionListener.onFailure()` callback
* Adapt mocks in the `MqttAdapterTests` for a new code flow
* Add delivery events verification into the `ClientManagerBackToBackTests`

* Fix race condition in the `ClientManagerBackToBackTests`

Looks like the message can be consumed even before we just emit that `MqttMessageSentEvent`
2024-09-04 15:31:01 -04:00
Artem Bilan
6641cf8e21 Remove ControlBusController.getCommandsForBean
The extra REST API to get commands for specific bean does not make sense.
Exactly same data can be extracted from the JSON returned by the `getCommands` REST API
2024-08-20 10:43:53 -04:00
Ricore72
d1146e5f17 GH-9368: Adding MqttMessageDrivenChannelAdapter at runtime
Fixes: #9368

* fixing MessageDrivenAdapters

1) exposing isConnection() in ClientManager
2) implementing isConnection() in Mqttv3ClientManager and Mqttv5ClientManager
3) Modifining OnInit() in AbstractMqttMessageDrivenChannelAdapter

* Adding test to ClientManagerBackToBackTests

Adding tests for addition of MessageDrivenAdapters at runtime.

1) Adding config classes Mqttv3ConfigWithStartedManager, Mqttv5ConfigWithStartedManager.
2) Adding test for config classes above.

* Fixing code style

* Adding required changes

* `ClientManager` - @since 6.4 comment to `isConnecttion()`
* `Mqttv3ClientManager`, `Mqttv5ClientManager` - adding local variable and lock logic
* `AbstractMqttMessageDrivenChannelAdapter` - changed `connectCompete()` to false

* adding runtime ClientManger tests

* `testV3ClientManagerRuntime` and `testV5ClientManagerRuntime` adding MessageDrivenAdaptes at runtime using `IntegrationFlowContext`

* Adding Documentation for MqttPahoMessageDrivenChannelAdapter and Mqttv5PahoMessageDrivenChannelAdapter

* fixing code style

* adding required chnages

* `ClientManager`, `Mqttv3ClientManager`, `Mqttv5ClientManager`, `AbstractMqttMessageDrivenChannelAdapter` - renamig `isConnection()` to `isConnected()`
* fixing docs `mqtt.adoc` and `whats-new.adoc`
* `ClientManagerBackToBackTests` adding factory interface `MessageDrivenChannelAdapterFactory` to create adapters

* removing started tests
2024-08-19 11:48:02 -04:00
Artem Bilan
57c98e1611 GH-9380: Add DefaultSftpSessionFactory.setSshClientConfigurer()
Fixes: #9380

Expose a `Consumer<SshClient> sshClientConfigurer` option for the `DefaultSftpSessionFactory`
to further customize an internal `SshClient` instance.
2024-08-14 15:56:22 -04:00
Artem Bilan
e332ce988a Fix ControlBusControllerConfiguration for FormattingConversionService
* Use `ObjectProvider<FormattingConversionService>` instead for injection
to resolve the target bean later when we check that `spring-mvc` or `spring-webflux` is present in classpath
* Fix `control-bus-controller.adoc` for `{beanName}` attribute resolution attempt
2024-08-14 11:59:42 -04:00
Artem Bilan
4d787554b8 GH-9381: Introduce Control Bus commands management
Fixes: #9381

Currently, there is no way to know in one place what Control Bus commands are available and with what arguments

* Add `ControlBusCommandRegistry` infrastructure bean to gather control bus commands from beans and expose them for invocation
* Add `ControlBusController` to expose a `/control-bus` REST service against the mentioned `ControlBusCommandRegistry`
* Add `@EnableIntegrationManagement(loadControlBusCommands)` to be able to load all the Control Bus commands from the application context instead of on demand by default
* Deprecated existing SpEL(and Groovy)-based Control Bus functionality in favor of new, more manageable, logic
2024-08-13 13:26:27 -04:00
Artem Bilan
1e86856ba7 GH-9373: Document Spring nature of Spring Integration classes
Fixes: #9373
2024-08-09 10:14:24 -04:00
Swiss Chris
487a60e79a Fix endpoint default timeout in global-properties.adoc
Fixes: #9314 

**Auto-cherry-pick to `6.3.x` & `6.2.x`**
2024-07-13 22:00:34 -04:00
Eddie Cho
53445fe771 GH-9291: Enhanced unlock() method of JdbcLock to verify successful unlocking
Fixes: #9291

* Modify `unlock()` method of `JdbcLock`: if the lock ownership can not be removed due to data expiration, a `ConcurrentModificationException` should be thrown.
* Modify `unlock()` method of `RedisLock`: if the lock ownership can not be removed due to data expiration, a `ConcurrentModificationException` should be thrown.
* Maintain test cases
* Document the new behavior
2024-07-02 15:48:07 -04:00
Alessio Matricardi
272dde8945 GH-9228: Provide binding to ZeroMqMessageHandler
Fixes: #9228

* add docs

* protected constructor in ZeroMqMessageHandlerSpec, expose them via ZeroMq

* introduce ZeroMqUtils, for common Zero MQ utilities functions

* use ZeroMqUtils.bindSocket in ZeroMqMessageProducer

* refactor ZeroMqMessageHandler providing connectUrl and bindPort setters and simple constructors, following the same logic used for ZeroMqMessageProvider

* fix tests to follow the new ZeroMqMessageHandler implementation

* fix typo

* add new updates to whats-new.adoc

* address ZeroMQUtils comments

* remove connectUrl and boundPort setters, add Javadoc to new constructors

* add new DLS constructor for random port

* add since closure in ZeroMqUtils

* add DSL support methods and specific that, when not defined, the socket will be bound to a random port
2024-07-01 13:00:26 -04:00
Kevin Van keer
3d66ea00d9 GH-9230 fix error in code snippet
Fixes: #9230

Some code was present in the code snippet that shouldn't be there.


**Auto-cherry-pick to `6.3.x` & `6.2.x`**
2024-06-12 10:48:41 -04:00
Alessio Matricardi
80c8a61f33 GH-9197: Optional ZeroMQ topic wrapping
Fixes: #9197

* Update `ZeroMqMessageHandler` for `wrapTopic` option
* Add author, fix code style, add same logic also for `ZeroMqMessageProducer`
* Add `wrapTopic` function also in DSL specs
* Fix wrap topic test: duplicate socket address caused binding exception
* Rewrite the `MessageProducer.wrapTopic()` test
* Call `stop()` instead of `destroy()` method

**Auto-cherry-pick to `6.3.x` & `6.2.x`**
2024-06-10 10:56:07 -04:00
Artem Bilan
d76174edb1 GH-9192: Deprecate LobHandler usage
Fixes: #9192

With modern drivers we don't need BLOB-specific handling anymore.
The regular `PreparedStatement.setBytes()` and `ResultSet.getBytes()`
are enough for our serialized messages
2024-06-04 17:28:17 -04:00
Karol Kosiacki
753916ca24 GH-8898: Add AbstractRemoteFileStreamingMessageSource.clearFetchedCache
Fixes: #8898

In some cases not all retched remote files are processed, and after changing the `SessionFactory` (e.g. `RotatingServerAdvice`)
thy might not be processed on the next polling cycle
2024-06-04 16:35:22 -04:00
Artem Bilan
8b2da4f996 Start version 6.4
* Move `whats-new` to `changes-6.2-6.3.adoc`
* Upgrade dependency to the latest (including Gradle)
* Move Spring dependencies to based on SF-6.2
* Fix some deprecations and incompatibility
2024-05-28 20:07:35 -04:00
Artem Bilan
503c1f4d89 GH-9124: Mention FileListFilter in the max-fetch.adoc
Fixes to: #9124
2024-05-09 15:31:38 -04:00
Emmanuel Ferdman
2b01a39a42 Update contribution file reference
The `samples.adoc` uses out-dated link to contributing guidelines.
2024-05-09 11:21:35 -04:00
Artem Bilan
074d544e94 GH-9001: Revise Observation propagation over the channel
Fixes: #9001

The `ObservationPropagationChannelInterceptor` does not propagate an observation properly.
And it fully cannot when the message channel is persistent.

* Deprecate `ObservationPropagationChannelInterceptor` in favor of enabled observation on the channel
and target `MessageHandler` which is a consumer of this channel.
* Remove tests with an `ObservationPropagationChannelInterceptor`
* Mention a correct behavior in the `metrics.adoc` and `ObservationPropagationChannelInterceptor` Javadocs

**Auto-cherry-pick to `6.2.x`**
2024-03-18 16:19:00 -04:00
Artem Bilan
2dea91b4c3 GH-8631: Add retry options to JMS inbound components
Fixes: #8631

The `ChannelPublishingJmsMessageListener` (and respective Java DSL specs)
can now be supplied with a `RetryTemplate` & `RecoveryCallback` for retying `send` & `send-and-receive` operations
in the internal gateway implementation.
The `JmsMessageHeaderErrorMessageStrategy` was introduced to have access into a raw JMS message from retry context.
The functionality is modeled after `AmqpInboundChannelAdapter`
2024-03-13 13:42:31 -04:00
Artem Bilan
ffe3605c90 GH-8981: Add UnicastingDispatcher.failoverStrategy option
Fixes: #8981

Sometime the simple `boolean failover` on the `MessageChannel` (default `true`)
is not enough to be sure that we can dispatch to the next handler or not.
Such a decision can be made using `ErrorMessageExceptionTypeRouter`, but that would
require an overhaul for the whole integration flow

* Introduce a simple `Predicate<Exception> failoverStrategy` into `UnicastingDispatcher`
and all its `MessageChannel` implementation consumers to allow to make a decision about next failover
according to a thrown exception from the current `MessageHandler`
* Expose `failoverStrategy` on the `DirectChannel`, `ExecutorChannel` & `PartitionedChannel`,
and add it into respective Java DSL specs
* Fix involved tests to rely on the `failoverStrategy` property from now on
* Document the new feature
2024-03-12 18:16:02 -04:00
Artem Bilan
2731e9411e GH-7925: Make message history header as mutable
Fixes: #7925

The `MessageHistory.write()` creates not only a new instance of the `MessageHistory`,
but also a new copy of the whole message.
This significantly impacts the performance when we have too many components to track

* Make `MessageHistory` as append-only container and create a new instance (plus message)
only on the first track when no prior history is present
* Change `WireTap`, `BroadcastingDispatcher`, `AbstractMessageRouter` and `AbstractMessageSplitter`
to use a new `AbstractIntegrationMessageBuilder.cloneMessageHistoryIfAny()` API for every branch a message
is produced.
Essentially, create a new message with copy of the message history to let that downstream sub-flow
have its own trace
* Modify failed unit tests for a new logic where message history header is not immutable anymore
* This also fixes an `AbstractMessageSplitter` for propagating its track into messages it emits

* * Do not clone message history header if only one consume in multi-publish
* Fix typos in docs
2024-03-05 15:05:34 -05:00
Artem Bilan
1d73ab59af GH-8901: Add MockIntContext.substituteTriggerFor
Fixes: #8901

Provide a convenient API `MockIntegrationContext.substituteTriggerFor(String pollingAdapterId, Trigger trigger)`
to mitigate the time span which might be provided in the original configuration

* Add `MockIntegrationContext.substituteTriggerFor(String pollingAdapterId, Trigger trigger)`
* Refactor `MockIntegrationContext` for Java 17 code style
* Change `MockIntegrationContext.beans` to `MultiValueMap` since we may replace several properties of
the same endpoint
* Modify `MockMessageSourceTests.testMockMessageSource()` to use new `substituteTriggerFor()`, too
* Add Javadoc for the `OnlyOnceTrigger`
* Document the new feature and mention it with correlation to `OnlyOnceTrigger`
2024-02-15 14:59:52 -05:00
Artem Bilan
c35982e0e2 Fix preface.adoc for SI version 2024-02-15 13:35:35 -05:00
Spring Builds
92cfd0ed05 Fix typos in JDBC & JPA docs
**Auto-cherry-pick to `6.2.x`**
2024-02-08 18:10:15 -05:00
Spring Builds
507c2b0755 Fix typos and broken links in docs
**Auto-cherry-pick to `6.2.x`**
2024-02-08 17:30:10 -05:00
Artem Bilan
31bb5fcdea Fix whats-new.adoc ref in the index.adoc
**Auto-cherry-pick to `6.2.x`**
2024-02-08 16:09:49 -05:00
Soby Chacko
deda4fac7d Fix 404 issue with the reference docs
Due to an antora ordering issue, the reference docs on the latest GA from
the project site throws an HTTP 404.

See spring-projects/spring-framework#32083 for more details.
2024-01-26 17:08:10 -05:00
Artem Bilan
710558f68a GH-8850: Mqttv5MDChA: MqttSubscription-based config
Fixes: #8850

Expose `MqttSubscription`-based ctors for the `Mqttv5PahoMessageDrivenChannelAdapter`
2024-01-16 17:33:51 -05:00
Artem Bilan
5d55753dae Fix typos in mongodb.adoc 2024-01-08 09:30:25 -05:00
Artem Bilan
23c792e11b Start version 6.3.0
* Upgrade supported dependencies to their latest versions or `alpha`, `RC`
* Migrate to `com.github.spotbugs` plugin
* Upgrade to GraalVM `23.1.1`, which includes `org.graalvm.polyglot:js` migration
* Remove `spring-integration-security` module
* Fix Debezium tests according to the latest changes in the Debezium library
* Fix deprecations and incompatibility for latest Smack and Spring AMQP
2023-12-21 17:39:34 -05:00
Artem Bilan
6207bca3bd GH-8806: Ignore HTTP body for DELETE & TRACE
Fixes: #8806

According to RFC 9110, the `TRACE` request must not contain the body and DELETE (like GET and HEAD)
should not.

* Fix `BaseHttpInboundEndpoint` adding `TRACE` & `DELETE` to the `NON_READABLE_BODY_HTTP_METHODS` list
* Clean up typos and links in the `http/inbound.adoc`
2023-12-12 17:25:01 -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
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
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
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
Artem Bilan
af609cac79 Change the default polling trigger to 1 second (#8751)
* Change the default polling trigger to 1 second

The current default trigger for the poller is 10 milliseconds fixed delay.
This is very tight policy for Microservices where we might not have too many
scheduled threads to distribute polling endpoint jobs evenly.

* Change the default trigger to 1 second to align with what Spring Boot already
claims.
Same 1 second policy is used in Spring Cloud Stream as well

* Fix language in Docs

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

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-10-09 13:33:49 -04:00
Adama Sorho
459de03ea3 GH-8738: Fix MQTT inbound example syntax error
Fixes https://github.com/spring-projects/spring-integration/issues/8738
2023-09-19 10:37:44 -04:00