Commit Graph

11361 Commits

Author SHA1 Message Date
abilan
edbaf6d590 Start version 6.2.0
* Add Christian Tzolov to author name in the doc
* Move `whats-new.adoc` content to new `changes-6.0-6.1.adoc`
* Upgrade to Gradle `8.1.1`
* Upgrade to Spring Framework `6.1`
* Fix `StompSessionManagerTests` for deprecated `ConcurrentTaskScheduler` ctor
* Fix XML configs for Kafka to use types for ctor args instead of their names.
Apparently SF doesn't do a discovery by names anymore.
2023-05-16 20:40:11 -04:00
Spring Builds
6433445ee7 [artifactory-release] Next development version 2023-05-16 20:34:40 +00:00
Spring Builds
96c7f3034d [artifactory-release] Release version 6.1.0 2023-05-16 20:34:37 +00:00
abilan
af4c7d2ad4 Bring back sshd-sftp-2.9.2
Looks like there is some bug in the latest version,
so the directory cannot be created on Linux

We will revise the problem in the next version
2023-05-16 15:38:04 -04:00
abilan
a937d5ff6c Add diagnostics to SftpRemoteFileTemplateTests 2023-05-16 15:10:29 -04:00
abilan
e70d0ef5e2 Upgrade dependencies; prepare for release
* `--add-opens` for `java.lang` and `java.util`
in Groovy and Scripting modules to let `java.util.Date` scoped prototype bean
to work back with new CGLIB classpath limitations
2023-05-16 13:17:22 -04:00
abilan
3618965491 GH-8623: DefLockRepository: back to LocalDateTime
Fixes https://github.com/spring-projects/spring-integration/issues/8623

Turns out not all JDBC drivers (or RDBMS vendors) support `java.time.Instant`
mapping to their `TIMESTAMP` type.
For example the PostgreSQL fails like:
```
org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.time.Instant.
```

* Use `LocalDateTime.now(ZoneOffset.UTC)` instead `Instant.now()`.
Essentially bringing back the behavior from the previous version
2023-05-16 11:00:14 -04:00
Artem Bilan
191f693377 Fix memory leak in the FluxMessageChannel (#8622)
The `FluxMessageChannel` can subscribe to any volatile `Publisher`.
For example, we can call Reactor Kafka `Sender.send()` for
input data and pass its result to the `FluxMessageChannel`
for on demand subscription.
These publishers are subscribed in the `FluxMessageChannel`
and their `Disposable` is stored in the internal `Disposable.Composite`
which currently only cleared on `destroy()`

* Extract `Disposable` from those internal `subscribe()` calls
into an `AtomicReference`.
* Use this `AtomicReference` in the `doOnTerminate()`
to remove from the `Disposable.Composite` and `dispose()`
when such a volatile `Publisher` is completed

**Cherry-pick to `6.0.x` & `5.5.x`**
2023-05-15 16:28:29 -04:00
Artem Bilan
3c0927e4ac GH-8585: Add Javadocs to Pollers & PollerFactory (#8621)
* GH-8585: Add Javadocs to Pollers & PollerFactory

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

* * Fix Javadoc tags order

* * One more Javadoc tags order
2023-05-15 12:50:46 -04:00
Artem Bilan
396f5fb87b GH-8014: Improve doc for Service Activator (#8619)
* GH-8014: Improve doc for Service Activator

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

* Fix language in Docs

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

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-05-15 12:30:14 -04:00
Artem Bilan
0916945096 GH-6827: More XSD docs for SI-ip.xsd (#8620)
Fixes https://github.com/spring-projects/spring-integration/issues/6827
2023-05-15 09:28:31 -04:00
Artem Bilan
5f1e12ea35 Introduce PartitionedChannel (#8617)
* Introduce `PartitionedChannel`

* Implement a `PartitionedChannel` as an extension of the `AbstractExecutorChannel`
* Supply this channel with a `PartitionedDispatcher` which is an extension of the `AbstractDispatcher`
* The target partition is essentially a `UnicastingDispatcher` with a single thead executor

* * Fix language in Javadocs
* Add docs for `PartitionedChannel` into `channel.adoc`
* Pre-populate partitions in the `PartitionedDispatcher`
to ensure a thread number reflection of the partition it is used for (for default `ThreadFactory`)
* Add Javadocs to `public` methods
* Add Java DSL `PartitionedChannelSpec` and respective factory methods into `Channels`
* Use `IntegrationMessageHeaderAccessor.CORRELATION_ID` header as a default partition key

* * Fix language in Javadocs
* Fix Checkstyle violations
* Mark `PartitionedDispatcher.prePopulatedPartitions()` with `synchronized`

* * Populate partitions from `PartitionedDispatcher` ctor
and when a custom `ThreadFactory` is set

* * Clear `executors` in `populatedPartitions()`

* * Bring back `synchronized populatedPartitions()` and use it in the `dispatch()`
2023-05-10 15:49:33 -04:00
abilan
32b6d823c0 Fix race condition in testFluxChannelCleanUp
Turns out `done` in the `SinkManyEmitterProcessor`
is set to `true` when we already processed all the data.
Therefore, it is better to `await().until()` for `done`
condition in the end of test
2023-05-08 11:19:54 -04:00
Artem Bilan
ffe50d2d30 GH-8613: Add JsonPropertyAccessor type for native (#8614)
Fixes https://github.com/spring-projects/spring-integration/issues/8613

If `JsonPropertyAccessor` is registered for SpEL, it would be great
to have it working in native images as well.

Since SpEL is fully based on reflection, expose
`JsonPropertyAccessor$ComparableJsonNode` and `JsonPropertyAccessor$ArrayNodeAsList`
reflection hints for their method invocations from SpEL

**Cherry-pick to `6.0.x`**
2023-05-08 10:31:23 -04:00
Artem Bilan
b999ac109c MH: Async by default for reactive output channel (#8612)
When we configure an output channel for the handler as a `FluxMessageChannel`,
in most cases we assume an async processing for the reply.
Especially this is critical when reply is a reactive type, so in the async
mode it is "flattened" by the mentioned `FluxMessageChannel`.
Therefore, it is a bit awkward to require to set async explicitly,
when we have already configured output channel as a `FluxMessageChannel`

* Remove redundant config for async from `R2dbcDslTests`
* Mention the change in the docs
2023-05-08 10:30:41 -04:00
Kazuki Shimizu
9e7b20a059 GH-8609: Fix TcpConnectorInterceptor chain propagation
Fixes https://github.com/spring-projects/spring-integration/issues/8609

* Changed to passed the self instance to `addNewConnection()` instead of argument's connection
in a `TcpConnectionInterceptorSupport` to compose a chain of interceptors from top to down.
This way the target `Sender` get the last interceptor in a chain as its connection.

**Cherry-pick to `6.0.x` & `5.5.x`**
2023-05-05 09:32:55 -04:00
Artem Bilan
59e676a4e9 Demonstrate @Publisher with an @EventListener (#8603)
* Demonstrate `@Publisher` with an `@EventListener`

The `@EventListener` from Spring Framework is a good tool for POJO configuration
to subscribe to events from an `ApplicationContext`.
The `@Publisher` is an AOP tool to publish a `Message` from POJO method call.

* Add a test and docs to demonstrate how the `@Publisher` can be used together with an `@EventListener`

* Add `@Publisher` with a `@RabbitListener` sample in docs

* * Fix FQCN for `@Queue` in the `AmqpTests`
2023-05-02 11:58:55 -04:00
Artem Bilan
90bc65ea49 GH-3866: DefLockRepository: expose query setters (#8606)
Fixes https://github.com/spring-projects/spring-integration/issues/3866

Some RDBMS vendors (or their JDBC drivers) may just log the problem
without throwing an exception.

* Expose setters for UPDATE and INSERTS queries in the `DefaultLockRepository`
to let end-user to modify them respectively, e.g. be able to add a PostgreSQL
`ON CONFLICT DO NOTHING` hint.
* Refactor `DefaultLockRepository` to `Instant` instead of `LocalDateTime`
with zone offset.
* Refactor `ttl` property to `Duration` type
* Fix `dead-lock` typo to `deadlock`
2023-05-01 17:27:20 -04:00
Artem Bilan
33d13a4649 GH-8583: Add Java & DSL samples into docs (#8608)
* GH-8583: Add Java & DSL samples into docs

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

When users jump into docs first thing these days they expect to see a Java DSL sample.

* Fix language in Docs

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

* * Improve `router.adoc` for DSL samples
* Add links to DSL chapters

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-05-01 16:49:16 -04:00
Artem Bilan
212bd46d65 GH-3763: Add handleReactive() for Java DSL (#8605)
* GH-3763: Add `handleReactive()` for Java DSL

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

Add a convenient terminal operator to `BaseIntegrationFlowDefinition`
based on a `ReactiveMessageHandler`.
Also add an overload like `handleReactive(ReactiveMessageHandlerSpec)`
to let end-user to choose a protocol-specific channel adapter

* * Fix `Namespace Factory` wording in the `BaseIntegrationFlowDefinition` Javadocs

* Fix language in Docs

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

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-05-01 15:24:00 -04:00
abilan
8291fb952d Fix README for logo and required Java version 2023-04-28 11:54:39 -04:00
Artem Bilan
49096b3937 * Use burrunan/gradle-cache-action got GH actions
According to the `gradle/gradle-build-action` docs it caches only a `main` branch.
This is not appropriate for us since we really never build `main` on GH actions.

With this change we will experiment if `burrunan/gradle-cache-action` does what we would like to get from the Gradle cache feature

* Some config adjustments for `gradle-cache-action`
2023-04-26 12:48:35 -04:00
abilan
75769ba883 Back to BEFORE_EACH for ImapMailReceiverTests
Looks like there are some leftovers after interactions with
channel adapters from config
2023-04-22 09:54:09 -04:00
abilan
33aaaba149 Some ImapMailReceiverTests improvements
* Increase reconnectTimeout to avoid race conditions
* Do not stub `protected` methods
* Rearrange properties settings before spying on object
2023-04-22 09:29:54 -04:00
abilan
e9cee2e08a Turn on DEBUG for Greenmail to diagnose test fail 2023-04-21 11:45:47 -04:00
abilan
1067075ec8 More ImapMailReceiverTests clean-ups 2023-04-20 20:47:21 -04:00
abilan
62179bfc90 Bring back IMAP server per unit test 2023-04-20 20:15:05 -04:00
abilan
a18a4caca6 Increase percentage for noDoubleStartForEndpoints 2023-04-20 17:16:54 -04:00
abilan
20b6ea6728 Fix checkstyle violation in ImapMailReceiverTests 2023-04-20 16:35:50 -04:00
abilan
fa1f8a4eff Some ImapMailReceiverTests improvements
* Fix typo in the `ImapIdleChannelAdapter` log message for not reconnecting error
2023-04-20 16:16:41 -04:00
abilan
5e348091f0 Upgrade to Mockito-5.3.0
Fix `ImapMailReceiverTests` and `Pop3MailReceiverTests` to not use mocks for messages
2023-04-20 15:25:51 -04:00
Spring Builds
3f27dfb9b5 [artifactory-release] Next development version 2023-04-19 20:01:36 +00:00
Spring Builds
4923f893e7 [artifactory-release] Release version 6.1.0-RC1 2023-04-19 20:01:33 +00:00
abilan
91fca72c99 Remove trailing space in IntWebSocketContainer
**Cherry-pick to `6.0.x` & `5.5.x`**
2023-04-19 13:18:48 -04:00
abilan
0391bedaeb Upgrade to json-path-2.8.0
* Fix `IntegrationGraphServerTests` to not use `net.minidev.json.JSONArray` API
since it is not available as transitive from `json-path` in the `testCompileClasspath`
2023-04-19 13:15:55 -04:00
Artem Bilan
1a579a6492 GH-8600: Fix WebSocket removeRegistration (#8601)
* GH-8600: Fix WebSocket `removeRegistration`

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

When we register a dynamic WebSocket endpoint and use a `WebSocketHandlerDecoratorFactory`
such an endpoint is not removed on an `IntegrationFlow` destruction.
The actual `WebSocketHandler` is decorated, however we still use an initial one
for condition.

* Refactor `IntegrationWebSocketContainer` to expose a `protected` setter for the
`WebSocketHandler` which is called from the `ServerWebSocketContainer` after decoration

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

* Fix language in Javadocs

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

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-04-19 12:54:00 -04:00
abilan
934e90a110 Revert json-path & Mockito versions
* Remove `mockito-inline` dependency
* Fix deprecations from Spring Security
* Fix `SmbSessionFactoryWithCIFSContextTests` for compatibility with latest `JCIFS`
* Migrate all the SMB tests to Junit Jupiter
2023-04-19 12:11:02 -04:00
abilan
dd53de8bfc Bring back Kotlin version 1.8.10
There is no Dokka plugin `1.8.20` yet
2023-04-19 09:46:03 -04:00
abilan
fe1a3ee096 Upgrade some dependencies 2023-04-19 09:43:16 -04:00
Artem Bilan
8dd1332d0a Fix NPEs in DSL Specs (#8597)
* Fix NPEs in DSL Specs

The `BaseWsInboundGatewaySpec` and `TailAdapterSpec` don't override super methods
and when we call them we fail with NPE since `target` was not populated.

* Fix `BaseWsInboundGatewaySpec` and its inheritors to populate the `target`
from their ctors.
* Remove redundant methods from `BaseWsInboundGatewaySpec` hierarchy
* Propagate `AbstractWebServiceInboundGateway` properties directly to the target
from the `BaseWsInboundGatewaySpec` inheritors
* Override `MessageProducerSpec` methods in the `TailAdapterSpec`
to populate respective option into the `FileTailInboundChannelAdapterFactoryBean`
* Expose more missed options for producer endpoint in the `FileTailInboundChannelAdapterFactoryBean`

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

* * `acceptIfNotNull()` for `errorMessageStrategy` in the `FileTailInboundChannelAdapterFactoryBean`

* * Fix `Unmarshaller` population logic in the `MarshallingWsInboundGatewaySpec`
2023-04-18 11:12:23 -04:00
Artem Bilan
feb4705e79 Improve Java DSL for Rabbit Streams (#8598)
* Improve Java DSL for Rabbit Streams

* Expose simple properties for `streamName` and `superStream`
on the `RabbitStreamInboundChannelAdapterSpec`
* Add `superStream(String superStream, String name, int consumers)` option
* Add `outboundStreamAdapter(Environment environment, String streamName)` factory for
simple use-cases
* Add `RabbitStreamTests` integration test to cover Rabbit Streams support
 and demonstrate respective Java DSL
* Mention the change in the docs

* * Fix typos in code and docs
2023-04-18 10:16:19 -04:00
abilan
fa178c3da6 Fix new Sonar smells
* And more convenient Kotlin methods based on `IntegrationFlow`
2023-04-16 14:49:45 -04:00
abilan
869c5c7088 Fix new Sonar smells 2023-04-15 20:00:38 -04:00
abilan
d5181bf0d7 Add Nullability support into Java DSL 2023-04-14 14:16:36 -04:00
Artem Bilan
053cc00484 GH-3557: Add maxDepth, dirPredicate to FileReadMS (#8596)
* GH-3557: Add maxDepth, dirPredicate to FileReadMS

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

* Expose a `watchMaxDepth` on the `FileReadingMessageSource` for its `Files.walkFileTree()` API usage
* Add `watchDirPredicate` option ot the `FileReadingMessageSource` to skip sub-tree for `Files.walkFileTree()`
scanning according to some condition against directory `Path`

* Fix language in docs

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

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-04-13 17:03:39 -04:00
Artem Bilan
aaaa489f0c Optimize MessageTriggerAction for Java DSL (#8595)
Currently, the `MessageTriggerAction.trigger` is configured
on the `BaseIntegrationFlowDefinition` to be called via reflection
in the `MessagingMethodInvokerHelper`

* Represent a `MessageTriggerAction.trigger` as a `Consumer<Message<?>>` method reference
and use a `LambdaMessageProcessor` for direct call
* Add a `Consumer` support for `LambdaMessageProcessor`
2023-04-13 12:56:45 -04:00
Artem Bilan
b99729544d GH-8586: Deprecate IntegrationComponentSpec.get() (#8594)
* GH-8586: Deprecate IntegrationComponentSpec.get()

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

The `IntegrationComponentSpec` is not a plain wrapper around single component.
Sometimes it comes with several components where all of them must be registered
as beans.
If `IntegrationComponentSpec.get()` is called from end-user code, we may lose
other related components, for example filters in the `FileInboundChannelAdapterSpec`.

* Deprecate `IntegrationComponentSpec.get()` with no-op for end-user,
rather encourage to leave it as is and let the framework take care about its lifecycle
and related components registration
* Fix `IntegrationComponentSpec` logic to deal as a simple `FactoryBean` instead of
extra overhead via `AbstractFactoryBean`
* Use `IntegrationComponentSpec.getObject()` in the framework code where `get()` was called
* Fix tests to expose `IntegrationComponentSpec` as beans instead of previously called `get()`
* Some other clean up and typos fixes in the affected classes
* Document the change

* * Revert `ObjectStringMapBuilder` in the `KafkaInboundGatewaySpec.getComponentsToRegister()`

* Fix language in docs

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

* * Remove trailing whitespace in the `ScriptMessageSourceSpec`

---------

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-04-13 09:16:42 -04:00
abilan
bbaffb22bf Fix Checkstyle violations
* Fix new Sonar smells
2023-04-11 16:54:30 -04:00
abilan
bbbfc47ca4 Use StandardEvalCtx in the ZeroMqMessageHandler
A simple one was used by mistake
2023-04-11 16:15:27 -04:00
abilan
e69285a06f Fix sample image link in the amqp.adoc 2023-04-11 15:41:29 -04:00