Commit Graph

9992 Commits

Author SHA1 Message Date
Artem Bilan
7a3a8a4bee Restore IntegrationFlowDefinition from previous
It turns out that some downstream projects are going to
support both Spring Boot 2.2 and 2.3 versions (Spring Cloud).
This way they are going to compile against Spring Integration 5.2,
but possible have a runtime against Spring Integration 5.3.

* Restore `IntegrationFlowDefinition` from the previous version
to keep binary compatibility at runtime
2020-01-16 12:49:58 -05:00
Artem Bilan
5cd36c7af9 Fix new Sonar smells 2020-01-16 09:05:23 -05:00
Artem Bilan
442c4fa4d5 GH-3111: Document @Lazy for messaging annotations (#3142)
* GH-3111: Document @Lazy for messaging annotations

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

* Fix some typos in docs
* Ensure in tests that announced `@Lazy` works as expected

* Doc Polishing

Co-authored-by: Gary Russell <grussell@pivotal.io>
2020-01-15 10:16:25 -05:00
Artem Bilan
f93a740065 Messaging Annotations: process ReactiveMH (#3141)
* Messaging Annotations: process ReactiveMH

* Add support for `ReactiveMessageHandler` as a `@ServiceActivator` bean
* Wrap `ReactiveMessageHandler` in the `ReactiveMessageHandlerAdapter`
in the `ServiceActivatorAnnotationPostProcessor`
* Unwrap `ReactiveMessageHandlerAdapter` in the `AbstractMethodAnnotationPostProcessor`
for `ReactiveStreamsConsumer`

* * Add documentation for the `ReactiveMessageHandler`
& Reactive MongoDb channel adapters
2020-01-14 16:17:40 -05:00
Artem Bilan
d13752b40b Infrastructure for ReactiveMessageHandler (#3137)
* Infrastructure for ReactiveMessageHandler

We have now a `ReactiveMongoDbStoringMessageHandler` which implements
a `ReactiveMessageHandler`, but not a `MessageHandler` for possible
deferred subscriptions to the returned Reactor type

We don't have a proper application context processing for this
new type of message handlers

* Change a  `ConsumerEndpointFactoryBean` to apply an `MH` and `RMH`
as possible types for handler
* Introduce a `ReactiveMessageHandlerAdapter` to wrap an `RMH`
into a `MH` for synchronous calls in the regular consumer endpoints
* Wrap an `RMH` into a `ReactiveMessageHandlerAdapter` for regular
endpoints and unwrap for `ReactiveStreamsConsumer`
* Add `RMH`-based ctor into `ReactiveStreamsConsumer` for target
reactive streams composition (`flatMap()` on the `RMH`)
* Remove a `DelegatingSubscriber` from the `ReactiveStreamsConsumer`
in favor of direct calls from the `doOnSubscribe()`, `doOnComplete()`
& `doOnNext()`
* Add an `onErrorContinue()` to handle per-message errors, but don't
cancel the whole source `Publisher`
* Use `Disposable` from the `subscribe()` to cancel in the `stop()`
- recommended way in Reactor
* Use `onErrorContinue()` in the `FluxMessageChannel` instead of
`try..catch` in the `doOnNext()` - for possible `onErrorStop()`
in the provided upstream `Publisher`
* Handle `RMH` in the `ServiceActivatorFactoryBean` as a direct handler
as well with wrapping into `ReactiveMessageHandlerAdapter` for return.
The `ConsumerEndpointFactoryBean` extracts an `RMH` from the adapter
for the `ReactiveStreamsConsumer` anyway
* Add XML parsing test for `ReactiveMongoDbStoringMessageHandler`
* Add `log4j-slf4j-impl` for all the test runtime since `slf4j-api`
comes as a transitive dependency from many places

* * Fix conflicts after rebasing to master

* * Fix typo in warn message
* Change `Assert.state()` to `Assert.isTrue()`
for `ConsumerEndpointFactoryBean.setHandler()`

* * Fix `ConsumerEndpointFactoryBean` when reactive and no advice-chain
* Fix race condition in the
`ReactiveMongoDbStoringMessageHandlerTests.testReactiveMongoMessageHandlerFromApplicationContext()`

* * Handle `ReactiveMessageHandler` in Java DSL.
Essentially request a wrapping into `ReactiveMessageHandlerAdapter`.
Describe such a requirements in the `ReactiveMessageHandlerAdapter` JavaDocs
* Some Java DSL test polishing
* Add Java DSL for `ReactiveMongoDbStoringMessageHandler`
* Propagate missed `ApplicationContext` population into an internally
created `ReactiveMongoTemplate` in the `ReactiveMongoDbStoringMessageHandler`
2020-01-13 08:41:41 -05:00
Artem Bilan
e0509cc339 Fix new Sonar smell 2020-01-10 10:16:50 -05:00
Artem Bilan
d74f9e8b86 Fix new Sonar smell 2020-01-09 16:46:53 -05:00
Artem Bilan
370e943428 Remove deprecations from previous versions
* Remove Boon dependency and its usage
* Remove overloaded methods from the `IntegrationFlowDefinition`
- we can simply rely now on the super class
* Remove (or rework) deprecated entities in the docs
* Fix tests for removed deprecated APIs
* Rework affected tests to JUnit 5
2020-01-09 15:54:04 -05:00
Artem Bilan
cfaabe2a8d Revert MongoDb driver 4 changes
* Bring Spring Data MongoDb back to `2.3`;
essentially rely on Spring Data BOM for dependencies
* Change `mongodb-driver-reactivestreams` driver version back to `1.12.0`
* Upgrade to Spring Security 5.3 M1
* Fix MongoDb module to use `MongoDbFactory` class instead of new (not committed yet)
`MongoDatabaseFactory`
* Remove `uuidRepresentation()` configuration from the `MongoClients` factory usage -
that is going to be MongoDb driver 4 feature
2020-01-09 11:31:01 -05:00
Artem Bilan
be9d735c1c Fix Gemfire tests for the latest Spring Data
* Upgrade to SF-5.2.3.BUILD-SNAPSHOT to confirm
that there is no regression in  HTTP module
2020-01-07 11:56:36 -05:00
Artem Bilan
13bd3e5255 Fix some Sonar smells 2020-01-06 09:55:25 -05:00
Artem Bilan
1d80e9ff05 Fix new Sonar smells
* Optimize logic in the `ExpressionEvaluatingParameterSourceFactory`
do not compute object if they are present in maps.
Plus extract some common code to the method
2020-01-02 10:43:22 -05:00
Artem Bilan
5eb3bfe1c3 Fix new Sonar smells
* Some code clean up in the affected classes
2019-12-31 11:35:47 -05:00
Artem Bilan
fc4c85a860 Upgrade Artifactory plugin 2019-12-30 14:23:14 -05:00
Artem Bilan
357eae8a7e Migrate to Gradle 6 dependency model & publication
* Use Gradle variants for publishing `optional` and `provided`
* Use some transitive dependencies explicitly from other modules
since all the optional dependencies are not pulled by Gradle any more
2019-12-30 14:12:31 -05:00
Jonathan Pearlin
4ab7c3979b Handle possible null management overrides 2019-12-29 12:38:44 -05:00
Artem Bilan
57d458498c Fix MongoDB long running tests for latest Driver 2019-12-29 09:11:11 -05:00
Artem Bilan
a6b99dba35 Fix new Sonar smells 2019-12-27 22:32:38 -05:00
Artem Bilan
5ac262f866 GH-3132: Remove usage of super();
Fixes https://github.com/spring-projects/spring-integration/issues/3132

It turns out that Checkstyle EmptyBlock doesn't complain about
empty default ctor.
Plus a new check for `super();` call treats it as a violation

* Remove `super();` from all the no-arg ctors
* Code style clean up in the affected classes according
IDEA suggestions

* Fix new Sonar smells
2019-12-27 15:13:00 -05:00
Artem Bilan
9c68ae4a7d Upgrade dependencies, including Gradle
* Alongside with existing `springAmqpVersion` & `springVersion`
also expose `springDataVersion` & `springSecurityVersion`
project properties.
These can be used in external CI plans for compatibility builds
* Fix `IntegrationGraphServerTests` for the current state of graph -
The node name is now based on the endpoint id, not a `MH` bean name
* Fix MongoDB tests for compatibility with the latest driver
2019-12-27 10:00:36 -05:00
Artem Bilan
fab7741368 Shorten internal component names for graph (#3128)
* Shorten internal component names for graph

The long `IntegrationContextUtils.ERROR_LOGGER_BEAN_NAME` name
is used for `errorChannel` `LoggingHandler`'s endpoint.
It is too long for endpoint node in the graph meanwhile the
`errorChannel` is good everywhere

* Change an `IntegrationGraphServer` logic to shorten internal
component names before drawing a graph
* Introduce `IntegrationUtils.obtainComponentName()` for
shortening an internal name if any
* Use `IntegrationConfigUtils.BASE_PACKAGE` in the `IntegrationMBeanExporter`
instead of its own static property
* Remove `IntegrationConfigUtils.FACTORY_BEAN_OBJECT_TYPE` in favor
of introduced in SF `FactoryBean.OBJECT_TYPE_ATTRIBUTE`
* Rework affected test classes to JUnit 5
* Remove usage of deprecated options in the `@EnableIntegrationManagement`
* Document names shortening feature for graph

* * Improve `obtainComponentName()` function
2019-12-26 15:41:19 -05:00
Artem Bilan
c08f4ec5c6 GH-3118: MessagingGW: Don't proxy default methods (#3119)
* GH-3118: MessagingGW: Don't proxy default methods

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

The `GatewayProxyFactoryBean` proxies all the methods in the provided interface,
including `default` and `static`.
This is not what is expected from end-users.

* Proxy only `abstract` methods from the provided interface
* Introduce a `DefaultMethodInvokingMethodInterceptor` to call `default`
method on the interface using a `MethodHandle` approach for those methods
calling

* * Introduce a `proxyDefaultMethods` option to let to
restore a previous behavior
* Handle a new property from XML, annotations & DSL configurations
* Ensure that the property works in various tests
* Document the feature

* * Fix typo in the `build.gradle`
2019-12-26 15:41:19 -05:00
Gary Russell
13c72f653e Upgrade to data Neumann and S-D-Mongo 3.0
* Fix reactive driver version; reinstate tests.
2019-12-26 15:41:19 -05:00
Artem Bilan
b4fcf9ec87 GH-3120: Identify polling MG as outbound-CA
Fixes https://github.com/spring-projects/spring-integration/issues/3120

The messaging gateway method without arguments works as a
polling channel adapter.
In this case a Messaging Gateway component is present in the end of flow.
Therefore we treat it as an `outbound_channel_adapter`
2019-12-26 15:41:19 -05:00
Artem Bilan
07f0aa95d6 Remove IntegrationPatternType.gateway
The `GatewayProxyFactoryBean` really produces an Inbound Gateway
for downstream flow and its proxy becomes a start of the flow

* Determine a return type of the gateway method to indicate
that `void` one leads to the `IntegrationPatternType.inbound_channel_adapter`
instead of regular `IntegrationPatternType.inbound_gateway`
2019-12-26 15:41:19 -05:00
Artem Bilan
2263827b3f INT-4568: Add reactive MongoDbMH
JIRA: https://jira.spring.io/browse/INT-4568

* Refactor `AbstractMessageHandler` and implement `MongodbReactiveMessageHandler`

* Rename `AbstractBaseMessageHandler` to `MessageHandlerSupport`

* Clean up code style and resolve possible Sonar smells
2019-12-26 15:41:19 -05:00
Artem Bilan
ebadfde609 Fix IP type for ClaimCheckOutTransformer
The `ClaimCheckOutTransformer` contains an `IntegrationPatternType.claim_check_in`
value for its `getIntegrationPatternType()`.

* Use correct `IntegrationPatternType.claim_check_out` instead
2019-12-26 15:41:19 -05:00
Artem Bilan
c0a32622ea Introduce IntegrationPattern abstraction
* Add `IntegrationPattern` contract to implement on the target components
which represent particular EIP
* Add `IntegrationPatternType` with an internal `IntegrationPatternCategory`
to return from the component implementing `IntegrationPattern`
* Parse `IntegrationPatternType` in the `IntegrationNode` for potential
use on the UI for drawing a particular icon

* More pattern representations

* Clean up Checkstyle
* Fix JavaDocs
* Add `integrationPatternCategory` assertion into the `IntegrationGraphServerTests`

* Add more IntegrationPattern implementations
* Provide some delegation and overriding logic whenever we have
components wrapping

* Fix unused imports

* Add `inbound_gateway` pattern indicator
* Add conditional on `expectReply` to indicate a component as an
`IntegrationPatternType.outbound_channel_adapter` or
`IntegrationPatternType.outbound_gateway`
* Make some code clean up in affected classes

* Add a `gateway` type for `@MessagingGateway`

* Comment the reason for `outbound_gateway` type in the `AbstractReplyProducingMessageHandler`
* Bump `IntegrationGraphServer.GRAPH_VERSION`
* Add new attributes into graph sample in the `graph.adoc`
* Document an `IntegrationPattern`

* Apply changes for version 5.3

* Rebased into `5.3-WIP`
* Add a `whats-new.adoc` note about an `IntegrationPattern`
2019-12-26 15:41:19 -05:00
Artem Bilan
9dc3519f20 Start version 5.3
* Move `What's New` into `changes-5.1-5.2.adoc`
* Remove version from the `XSD` files:
 1. Align with SF
 2. The version for XSD doesn't matter for the current jar version,
 since only the version is available in classpath is from the current
 jar version
 3. Modify `spring.schemas` to map all the possible versions for XSD
 into the current one in a jar.
 This way target applications can upgrade without changing the version
 for XSD location and we don't need to require `versionless` variant
 any more
 4. The jar in classpath can handle only its own XSD, so independently
 of version or no-version variants we still may fail because the current
 jar may not support end-user code any more - need some fix over there
 anyway.
* Remove `checkTestConfigs` Gradle task since we don't worry about XSD
version any more
* Modify `schemaZip` Gradle task to populate XSDs into a distribution
still with a version to avoid overriding on-line XSDs for version `1.0.x`.
We may consider not do that since SF doesn't and just bite a bullet
for always overriding those on-line XSDs to the actual one from the latest
release.
2019-12-26 15:41:19 -05:00
Artem Bilan
1a9fb83199 GH-3129: Use VARCHAR2 for non-fixed strings (#3133)
Fixes https://github.com/spring-projects/spring-integration/issues/3129

The `CHAR` type in Oracle is for fixed length values.
If the value is not of expected length it is padded with whitespaces.
This causes wrong assumptions when we perform queries against tables.

* Change the `CHAR` into a `VARCHAR2` in those tables for Oracle
where we don't have values with a fixed length.
In fact only `MESSAGE_ID` comes with always fixed length as `36`
because it is fully based on the `UUID`
2019-12-26 13:04:17 -05:00
Gary Russell
939e49cd60 Fix argument type in JMS OCA Spec javadoc 2019-12-24 12:17:23 -05:00
Gary Russell
6ba19823ff Fix javadoc copy/paste typos in JMS OCA Spec 2019-12-24 12:10:31 -05:00
div
c6358a93d4 GH-3123: Don't logout FtpSession if not connected
Fixes https://github.com/spring-projects/spring-integration/issues/3123
2019-12-20 12:14:45 -05:00
Artem Bilan
1334c75147 Fix new Sonar smell 2019-12-20 11:55:26 -05:00
Artem Bilan
5455ccb8dc Fix AbstractMethodAnnPP.postProcess() complexity 2019-12-19 10:55:17 -05:00
Artem Bilan
a9ab4827a9 Fix tests for the previous commit - new behavior 2019-12-18 17:06:59 -05:00
Artem Bilan
887a0896ef Fix Messaging Annotations for ReplyProdMHWrapper
To ensure advice-chain applicability the provided plain
`MessageHandler` is wrapped into a `ReplyProducingMessageHandlerWrapper`
with its particular `.wrapper` bean name.
When we build a graph for integration components, we use a
`componentName` from the `IntegrationObjectSupport` to represent a
node for endpoint in the graph.
In most cases the component name is an endpoint id around a `MessageHandler`

* Populate the missed component name in a `ReplyProducingMessageHandlerWrapper`
in the `AbstractMethodAnnotationPostProcessor` so nodes in the graph has
a proper name for their endpoint in the application context
2019-12-18 16:14:51 -05:00
Artem Bilan
cf7f2df920 Fix link for message-transformation in index.adoc 2019-12-12 12:49:59 -05:00
Gary Russell
34c4554adf Fix UUID import in test 2019-12-12 10:30:30 -05:00
Artem Bilan
54aeaff0f0 Add mavenLocal project property for Gradle
Related to https://github.com/checkstyle/checkstyle/issues/7322

To be able to build the project against `mavenLocal()`, add a
`mavenLocal` project property which can be specified as command line arg
`-PmavenLocal`, so a `mavenLocal()` is added into `repositories`
conditionally
2019-12-06 14:29:44 -05:00
Artem Bilan
71adc5d111 Remove sonar.projectKey & sonar.projectName yet
It turns out that these properties have some reasonable defaults, but
Sonar plugin on Bamboo can't read them anyway.
So, we have to modify CI plan for respective values for the project
2019-12-05 11:39:00 -05:00
Artem Bilan
492aaf91d6 Revert "Remove sonar.projectKey & sonar.projectName"
This reverts commit 66731169c3.
2019-12-05 11:10:00 -05:00
Artem Bilan
66731169c3 Remove sonar.projectKey & sonar.projectName
Remove `sonar.projectKey` & `sonar.projectName` properties from the
`sonarqube` task since they have a reasonable defaults according
plugin docs: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-gradle/

It looks like the feature to override these properties in the Bamboo
plugin doesn't work properly
2019-12-05 10:53:56 -05:00
Artem Bilan
2e10cc8e9c Add checkstyleVersion Gradle CLI property
Related to https://github.com/checkstyle/checkstyle/issues/7306

According to discussion with Checkstyle team, we agreed to give us
project for testing their latest changes for regressions to avoid
situation like in the mentioned issue with `RequireThis`

* We expose a `checkstyleVersion` for Gradle command line to let to
provide a Checkstyle version externally.
This feature is going to be used on Checkstyle CI to run check in our
project against their SNAPSHOT

The command to run checks against external version is like this:
`./gradlew clean check --parallel -x test -PcheckstyleVersion=[CHECKSTYLE_VERSION]`
Where `[CHECKSTYLE_VERSION]` is a placeholder which should be replaced
with environment-specific variable or an explicit version.
2019-12-05 10:26:30 -05:00
Artem Bilan
2d13032847 Add sonar.projectName property for SonarQube 2019-12-04 18:18:40 -05:00
Artem Bilan
9a3f5b1a51 Revert "Attempt to remove Sonar and Jacoco plugins"
This reverts commit 6400f59194.
2019-12-04 17:54:35 -05:00
Artem Bilan
6400f59194 Attempt to remove Sonar and Jacoco plugins
* It seems all the SonarQube and Jacoco work is done by the
appropriate plugin on Bamboo.
Let's check it!
We always can revert such a change
2019-12-04 17:50:57 -05:00
Artem Bilan
837eda30a9 Populate sonar.projectKey property
* Change deprecated `sonar.jacoco.reportPath` to a new recommended one -
`sonar.coverage.jacoco.xmlReportPaths`
2019-12-04 17:35:12 -05:00
Spring Buildmaster
c8befb268d [artifactory-release] Next development version 2019-12-04 18:51:13 +00:00
Spring Buildmaster
d233288a8b [artifactory-release] Release version 5.2.2.RELEASE 2019-12-04 18:51:09 +00:00