Commit Graph

900 Commits

Author SHA1 Message Date
abilan
db90e68ca7 Fix Sonar and JaCoCo relationship
* Explicitly enable Jacoco XML report
Must be `xml.required = true`
* Starting with version 3 the Sonarqube Gradle plugin
does not do any automatic dependencies on other tasks:
https://docs.sonarqube.org/latest/analyzing-source-code/scanners/sonarscanner-for-gradle/
* It is also does not apply the task to sub-projects.
So, to make the root `sonarqube` task we need to have config like this:
```
 rootProject.tasks['sonarqube'].dependsOn jacocoTestReport
```
Note: the `sonarqube` task is deprecated in favor of `sonar`,
but that is exactly what our current Bamboo Sonar plugin does.
So, when that is upgraded, we need to revise our config again
* We don't need `xml.outputLocation` since its default is what Sonar expects
2023-03-17 14:45:52 -04:00
abilan
f128a3f2eb Use sonar instead of deprecated sonarqube 2023-03-07 10:01:01 -05:00
abilan
1022d94dec Upgrade to Sonar 4.0.0.2929 2023-03-07 09:47:30 -05:00
abilan
4cbd22b583 Gradle 8.0.2, Dokka 1.8.10, Checkstyle 10.8.0 2023-03-06 09:23:03 -05:00
abilan
38f19348cf Upgrade to rome-2.0.0; fix deprecation
* Fix `FeedInboundChannelAdapterParser` to properly populate a `Resource` ctor arg
2023-02-28 16:48:30 -05:00
abilan
ea4d185da9 Remove redundant build config for Kotlin 2023-02-22 16:39:12 -05:00
Christian Tzolov
451374dd11 GH-3772 Add Protobuf transformation support
Fixes https://github.com/spring-projects/spring-integration/issues/3772

* Add basic To/From Protocol Buffer's com.google.protobuf.Message transformers.
* Allow the proto_type header to specify the type.
* Add tests.
* add Protobuf docs
* Leverage the Spring ProtobufMessageConverter
* move protobuf-java-util to test dependecies as optional
* protobuf docs improvements
* improve the expected type handling
* expected type expression
* fix indentation
* fix indentation for generated test classes
* suppress style check for proto generated classes
* address the transformer doc format
* fix whats new merge conflict
* fix doc sample code
* Some code clean up; fixing typos
2023-02-22 16:23:49 -05:00
abilan
2884bf0135 Various upgrades for version 6.1
* Upgrade to Gradle `8.0.1`
* Upgrade to Kotlin `1.8`
* Some other libs updates
* Resolve some compatible TODOs
2023-02-21 16:50:01 -05:00
abilan
53d1ecd208 Upgrade to the latest Micrometer dependencies 2023-02-21 15:18:05 -05:00
abilan
210a2f9d2c Migrate Zip Extension as a core module 2023-02-21 15:18:05 -05:00
abilan
39c73d404a Start version 6.1
* Upgrade dependencies whenever it is reasonable
* Fix deprecations and some new API paths
* Move docs to a new version with respective branching for the `changes-5.5-6.0.adoc`
2023-02-21 15:18:03 -05:00
abilan
a8dd9188c1 Upgrade dependencies; prepare for release 2023-02-21 13:14:40 -05:00
Artem Bilan
ac577e9ef7 Optional io.micrometer:context-propagation (#8556)
For better performance by default it is better to not pull
a `io.micrometer:context-propagation` a hard dependency.

* Remove `io.micrometer:context-propagation` dependency management
* It is pulled transitively by the `io.micrometer:micrometer-tracing-integration-test` in test scope
* Rework all the `ContextSnapshot` usage in the reactive code to respective recommended `handle()` API in `Flux` and `Mono`
2023-02-21 12:02:15 -05:00
abilan
4cd1085f94 Upgrade some dependencies
* Remove already redundant `parentObservation` population in the `AbstractMessageChannel`:
now it is handled properly by the `SimpleObservation` ctor
2023-02-14 15:01:42 -05:00
Artem Bilan
d9d7c49aac Propagate and Observation from Reactive context (#3999)
To propagate an `Observation` from reactive stream (e.g. WebFlux)
we have to capture its context and set it into the current thread scope.

* Add a `io.micrometer:context-propagation` dependency to support reactive context propagation
* Populate a `parentObservation` in the `IntegrationObservation.PRODUCER.observation()`
since it is not available for tracing on `Observation.onStart()`.
Might be tentative until upcoming fix in Micrometer Observation
* Populate from reactive context in the `WebFluxInboundEndpoint` where we use just `send()` operation downstream
* Populate from reactive context in the `MessagingGatewaySupport` where we use `send()` operation downstream or `FluxMessageChannel.subscribeTo()`
* Use `contextCapture()` in the `FluxMessageChannel` to gather a `ThreadLocal` info into a Reactor context
and then set back to `ThreadLocal` in the `transformDeferredContextual()` which really happens on a different thread
* Verify a trace propagation from WebFlux to an integration flow via Brave instrumentation in the `WebFluxObservationPropagationTests`
2023-02-01 14:13:40 -05:00
abilan
298b2403d9 Exclude org.glassfish.jaxb from spring-ws-core
The `spring-integration-ws` modules relies on the `com.sun.xml.bind:jaxb-impl`
as `provided` dependency
2023-01-18 11:51:40 -05:00
abilan
4be99de1f4 Upgrade dependencies; prepare for release
* Fix mail tests for the latest Greenmail changes
2023-01-18 11:03:10 -05:00
Artem Bilan
d298df8d0f Revise JS support for regular JVM (#3989)
* Revise JS support for regular JVM

Turns out that we just need to have `org.graalvm.sdk:graal-sdk` and `org.graalvm.js:js`
dependencies for regular JVM to enable JavaScript support for Spring Integration Scripting module

* Add respective `providedImplementation` dependencies
* Remove `@EnabledIfSystemProperty` from unit tests
* Mention those dependencies in the doc

* Rework sentence in the doc for better English

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2023-01-11 13:34:28 -05:00
abilan
52d43ea8ed Upgrade dependencies; prepare for release
Fix XML configs for new `Mockito.mock()` factory method
2022-12-20 16:25:06 -05:00
abilan
532f323313 Move Spring dependencies to SNAPSHOTs
* Use a `DefaultParameterNameDiscoverer` instead of deprecated `LocalVariableTableParameterNameDiscoverer`
* Fix assertion error message for `@Header` without `name` and with no `-parameters` compiler flag.
* Remove redundant repos for Gradle plugins

Related to: https://stackoverflow.com/questions/74600681/warning-printed-after-migrating-to-spring-boot-3-0-spring-integration-6-0
2022-11-28 15:49:52 -05:00
Gary Russell
1c94eaaa41 Upgrade Versions; Prepare for Release 2022-11-22 08:31:30 -05:00
abilan
91007e6745 Remove nohttp/allowlist.lines since all fixed 2022-11-18 16:10:09 -05:00
abilan
bfb2ca217f Upgrade dependencies including Gradle 2022-11-18 15:47:56 -05:00
abilan
2895a1eda9 Revert Spring WS BOM 2022-11-15 08:36:17 -05:00
abilan
ece3198ee9 Upgrade to MongoDB driver 4.8.0-rc0 2022-11-14 11:15:07 -05:00
artembilan
7bb330aaa9 Re-order mavenBom imports
It looks like some of Spring project's bom added after `spring-framework-bom`
causes a mess with dependencies: it brings those SF deps which are in the
latest `mavenBom`

* Move `spring-framework-bom` to the end of the list to be sure that
its version comes properly
* Do the same for Spring Data - after Spring AMQP and Spring Kafka
2022-11-09 17:39:16 -05:00
artembilan
0f4c941577 Use spring-ws-bom dependency 2022-11-09 16:38:24 -05:00
artembilan
4c8172d594 Move to SNAPSHOTs; upgrade Tomcat to 10.1.1
* Use `spring-amqp-bom`, `spring-kafka-bom`
2022-11-09 11:48:48 -05:00
artembilan
4d5548c9ed Add BOM file into distZip with other libs 2022-11-09 09:32:14 -05:00
Artem Bilan
f9b5f6cf7c Rearrange build for docs
* Copy docs to the `$buildDir/reference` instead of `docs`
to make `asciidoctor` tasks to calculate their UP-TO-DATE key properly
* Generate `kdoc` outside the `docs` dir to not interfere with `asciidoctor`
2022-11-08 12:13:22 -05:00
Artem Bilan
da56586619 Upgrade to Reactor 2022.0.0; prepare for release 2022-11-08 10:30:23 -05:00
Artem Bilan
90caafb697 Attempt to resolve okhttp-digest from JCenter 2022-11-08 10:14:59 -05:00
Artem Bilan
37f9b32033 Use plugins-release repo, not local one 2022-11-08 09:38:38 -05:00
Artem Bilan
32ec26e253 Upgrade to the latest deps; RCs
* Downgrade Tomcat to `10.0.23` since SF-6.0.0-RC3 is not compatible yet
* Exclude `jakarta.activation` and `com.sun.mail` transitive deps to avoid
classpath conflict with Jakarta EE 10
2022-11-08 09:30:02 -05:00
Artem Bilan
60f453e9ff Upgrade to Jakarta EE 10
* Fix mail module to fit to the latest mail API requirements
* Fix the last Sonar smell in the `SmbShare`
* Remove redundant dependency for `hamcrest-core` in various modules
2022-11-07 17:05:22 -05:00
Artem Bilan
dc56c09578 Upgrade to Servlet 6.0, Tomcat 10.1.1
* Upgrade to Micrometer `1.10.0` GA; Jackson `2.14.0`, Spring Kafka `3.0.0-RC2`
2022-11-07 13:17:01 -05:00
Artem Bilan
0b9bab313b Add Java DSL for Camel module and docs (#3937)
* Add Java DSL for Camel module and docs

* Introduce a `LambdaRouteBuilder` option into the `CamelMessageHandler`
to easily provide the Camel route just in-place

* * Fix language in docs

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-11-03 12:18:35 -04:00
Artem Bilan
1c4a474f53 Some testing improvements for Cassandra
* Remove the `cassandra.yaml` from test resources since it does not
have any effect on the clients.
Use `datastax-java-driver.basic.request.timeout` system property instead
with `10 seconds` value to allow Cassandra client to wait for query results
a little more than 2 seconds
* Expose just an IP address for contact endpoint avoiding overhead
with attempts to connect to all addresses returned by `localhost` resolution
* Bring back `log4j-slf4j-impl` dependency since it is required for other libs
2022-10-21 17:49:48 -04:00
Artem Bilan
f146b4cbbe Move Spring deps to SNAPSHOTs; other changes
* Removed overridden `getMethodValue()` in the `CookieTests` which is removed from SF already
* Re-enable JDBC tests related to complex named params because of the fix in SF
* `--add-opens` for Tomcat warnings
* Upgrade to `log4j-slf4j2-impl`
* Add `cassandra.yaml` resource with increased timeouts to wait more in busy environment from Cassandra cluster
2022-10-19 14:06:33 -04:00
Artem Bilan
b0bf59fef6 Upgrade to SWS 4.0.0-RC1; prepare for release 2022-10-18 14:37:49 -04:00
Artem Bilan
0951738ab3 Upgrade dependencies to be ready for release
* Revert `getMethodValue()` for `CookieTests` since it is removed in the SF SNAPSHOT
* Add `@Suppress("UNCHECKED_CAST")` to `FunctionsTests.kt` to suppress compilation warning
2022-10-18 12:30:44 -04:00
Artem Bilan
64f0e738a9 GH-3897: Deprecate ChannelSecurityInterceptor (#3915)
* GH-3897: Deprecate `ChannelSecurityInterceptor`

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

Spring Security has deprecated `AccessDecisionManager` and all its infrastructure
in favor of `AuthorizationManager`

* Deprecate and AOP `ChannelSecurityInterceptor` and all its infrastructure,
including `@SecuredChannel` and respective XML configuration.
The `AuthorizationChannelInterceptor` added to respective channels for security
or configured as a global channel interceptor fully covers the previous AOP configuration
* Fix deprecation warnings in other tests with security

* Fix language in docs

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

* * Remove `forRemoval` attr from `@Deprecated` markers for Security classes:
looks like to mark `@Deprecated` and even `@SuppressWarnings("deprecation")`
don't silence warnings on compilation

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-10-17 18:32:17 -04:00
Artem Bilan
ff076b6a19 GH-3902: Add Kotlin Coroutines Support (#3905)
* GH-3902: Add Kotlin Coroutines Support

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

* Add `isAsync()` propagation from the `MessagingMethodInvokerHelper`
to the `AbstractMessageProducingHandler` to set into its `async` property.
The logic is based on a `CompletableFuture`, `Publisher` or Kotlin `suspend`
return types of the POJO method
* Introduce `IntegrationMessageHandlerMethodFactory` and `IntegrationInvocableHandlerMethod`
to extend the logic to newly introduced `ContinuationHandlerMethodArgumentResolver`
and call for Kotlin suspend functions.
* Remove `MessageHandlerMethodFactoryCreatingFactoryBean` since its logic now is covered with the
`IntegrationMessageHandlerMethodFactory`
* Kotlin suspend functions are essentially reactive, so use `CoroutinesUtils.invokeSuspendingFunction()`
and existing logic in the `AbstractMessageProducingHandler` to deal with `Publisher` reply

* Fix `GroovySplitterTests` for the current code base

* Add `kotlinx.coroutines.flow.Flow` support
The `Flow` is essentially a multi-value reactive `Publisher`,
so use `ReactiveAdapterRegistry` to convert any custom reactive streams result to `Flux` and `Mono`
which we already support as reply types

* Add docs for `Kotlin Coroutines`
Rearrange the doc a bit extracting Kotlin support to individual `kotlin-functions.adoc` file

* Fix missed link to `reactive-streams.adoc` from the `index-single.adoc`
* Fix unintended Javadocs formatting in the `AbstractMessageProducingHandler`

* Add suspend functions support for Messaging Gateway
* Add convenient `CoroutinesUtils` for Coroutines types and `Continuation` argument fulfilling via `Mono`
* Treat `suspend fun` in the `GatewayProxyFactoryBean` as a `Mono` return
* Convert `Mono` to the `Continuation` resuming in the end of gateway call

* Document `suspend fun` for `@MessagingGateway`

* * Make `async` implicitly only for `suspend fun`

* * Remove unused imports

* * Verify sync and async `Flow` processing
* Mention default sync behavior in the docs

* * Improve reflection in the `CoroutinesUtils`

* Fix language in docs

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

* * Rebase and revert blank lines around `include` in docs

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-10-17 17:53:55 -04:00
Artem Bilan
a08713fe87 Migrate Cassandra extension project (#3913)
* Migrate Cassandra extension project

* Add `spring-integration-cassandra` module based on the extension project
* Add Java DSL for Cassandra module
* Add documentation
* Add `CassandraContainerTest` based on a Testcontainers

* Fix language in docs

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

* * Fix `reactive-streams.adoc` for a proper link to
the new `spring-integration-cassandra` module

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-10-17 16:03:37 -04:00
Artem Bilan
83f2a9c246 Migrate Groovy DSL extension project (#3914)
* Migrate Groovy DSL extension project

* Upgrade to Groovy `4.0.5`
* Apply `groovy` plugin for Groovy module to be able to compile Groovy classes for DSL
* Document new feature

* * Restore `lambdaWrapper` for the `GroovyIntegrationFlowDefinition.handle()`
to be able to preserve a generic argument type

* * Migrate more Spock test methods to JUnit style

* * Add missed `assert` to Groovy tests

* Fix language in docs

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

* * Fix Copyright and `@since` in new classes
* Remove deprecated `IntegrationFlows` class mentions in the `groovy-dsl.adoc`

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-10-17 15:41:58 -04:00
Artem Bilan
6641b1f545 GH-3664: Re-enable JavaScript support via GraalVM (#3911)
* GH-3664: Re-enable JavaScript support via GraalVM

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

The JavaScript JSR223 engine has been removed from Java.

Migrate JavaScript support into GraalVM Polyglot API:
* Implement `PolyglotScriptExecutor` which can also support other GraalVM languages
* Change the `ScriptExecutorFactory` to use a `PolyglotScriptExecutor` when it encounters JavaScript
* Re-enable tests for JavaScript
* Add GraalVM Polyglot support into docs

* * Reinstate `@EnabledIfSystemProperty` for GraalVM JS system property
2022-10-11 14:38:46 -04:00
Artem Bilan
1dd8b6bed5 Add jackson-databind to AMQP module for tests
The latest changes in Spring AMQP about migrating from RabbitMQ Hop
project to WebFlux has lead to dropping a Jackson deps which were
before transitive from Hop

* Add `com.fasterxml.jackson.core:jackson-databind` as tests dependency into AMQP module
2022-10-11 11:32:26 -04:00
Artem Bilan
daaa30e67f Make replyContainer as bean in Kafka tests
It looks like `replyContainer()` is not registered as a bean,
so its lifecycle is somehow out of application context control

* Mark `replyContainer()` method as a `@Bean` in the `KafkaDslTests` and `KafkaDslKotlinTests`
to see if this fixes flaky state of the test suite
* Upgrade to Kotlin `1.7.20` and fix `KafkaDslKotlinTests` according to its requirements
2022-10-06 16:01:08 -04:00
Artem Bilan
f24fbd992b Add documentation for Observability (#3896)
* Add documentation for Observability

* Adapt Observation code to the latest dependencies
* Add doc generation tasks for meters and spans
* Document new Observation API features
* Include generated meters and spans docs to a general `metrics.adoc` chapter

* * Adapt `ObservationPropagationChannelInterceptorTests` for the latest `SpansAssert` API

* * Adjust to the latest Micrometer SNAPSHOT
* Make Observation doc generation tasks only as local.
We don't need ambiguous changes to source code on CI

* * Automate metrics/spans docs generation as a part of `reference` build phase
* Replace 'org.springframework.integration' content in the generated files with a 'o.s.i'
to make it easier to read, especially in the tables
* Break `DefaultMessageReceiverObservationConvention <=> IntegrationObservation` classes tangle
using literal for `KeyValues` in the `DefaultMessageReceiverObservationConvention`
instead of nested enums from the `IntegrationObservation`
* Some other minor build script clean up

* Fix indent in `build.gradle` for `micrometerVersion` property code line

* Add new line after observation section in whats-new.adoc

* * Adapt to the latest Micrometer changes

* * Use Reactor `2022.0.0-SNAPSHOT` version
2022-10-06 12:42:26 -04:00
Artem Bilan
6b31d970de Remove spring-integration-gemfire module
Starting with Spring Data 2022.0.0 there is not going to be GemFire (Geode) support
directly from Spring team

A source code of the `spring-integration-gemfire` is moving to Spring Integration Extensions
from where community may consider to pull it and support in their own manner
2022-10-05 10:35:19 -04:00