Commit Graph

9969 Commits

Author SHA1 Message Date
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
Artem Bilan
aa895e7365 Upgrade dependencies; prepare for release
* Fix MongoDB tests for changed return type from Spring Data MongoDB
2019-12-04 13:07:56 -05:00
Gary Russell
d5e3148618 Upgrade Spring AMQP, Data versions 2019-12-04 12:36:15 -05:00
Artem Bilan
94e08169a5 Use EmitterProcessor in the FluxMessageChannel (#3104)
* Use EmitterProcessor in the FluxMessageChannel

The `EmitterProcessor` has a good logic to block upstream producer
when its downstream subscriber cannot keep up with overproducing.

* Rework `FluxMessageChannel` logic to rely on the `EmitterProcessor`
instead of `Flux.create()`
* Cancel `FluxMessageChannel` internal subscriptions in the `destroy()`
* Fix `ReactiveStreamsTests.testFluxTransform()` for the splitter's
delimiter
* Ensure in the `FluxMessageChannelTests.testFluxMessageChannel`
that we can have several concurrent subscribers to the
`FluxMessageChannel`

* * Use `flux.onComplete()` instead of iteration over subscribers
* Change `subscribers` list into just `AtomicInteger` count marker
* fix `DefaultSplitterTests` according a new logic in the `FluxMessageChannel`

* GH-3107: Add errorOnTimeout for TcpInboundGateway

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

The `MessagingGatewaySupport` has an `errorOnTimeout` option to throw
a `MessageTimeoutException` when downstream reply doesn't come back in
time for configured reply timeout

* Expose an `errorOnTimeout` option as a `TcpInboundGateway` ctor
property
* Add new factory methods into a `Tcp` factory for Java DSL
* Ensure a property works as expected in the `IpIntegrationTests`
* Document a new option

* * Use `delaySubscription()` for subscribing publishers in the `FluxMessageChannel`
to wait until this one subscribed.
* Use an `EmitterProcessor` to catch subscriptions and pass them as a
signal to delayed upstream publishers
* Fix  `FluxMessageChannelTests.testFluxMessageChannelCleanUp` to
verify an actual property instead of removed.
* Fix `RSocketOutboundGatewayIntegrationTests` for the proper subscription
into a `FluxMessageChannel` before actual interaction with an RSocket
gateway.
This should help us also to avoid some race conditions in the future

* Revert "GH-3107: Add errorOnTimeout for TcpInboundGateway"

This reverts commit fa6119ddc4e423e8b15ca3fdc9fc4c79ea9d56af.

* * Refactor `FluxMessageChannel` to use `ReplayProcessor` for `subscribedSignal`.
This one is used `delaySubscription` for the upstream publishers
* Use a `AtomicBoolean` for subscription state since `doOnSubscribe()`
is called before `EmitterProcessor` adds subscribers for its `downstreams`
* Use `publishOn(Schedulers.boundedElastic())` for upstream publishers
to avoid blocking over there when our `EmitterProcessor` doesn't have
enough demand
* Refactor reactive tests to have a subscription into the `FluxMessageChannel`
earlier than emission happens for it

* * Use `Flux.subscribe(Consumer)` instead of `doOnNext(Consumer).subscribe()`

* * Emit `subscribedSignal` value after `.subscribe(subscriber)`
instead of `doOnSubscribe`
* Check for `this.processor.hasDownstreams()` before emitting such an event

* * Use `this.processor.hasDownstreams()` as a value to emit for `subscribedSignal`.
This way we are less vulnerable race conditions when subscribers are changed
actively
2019-12-03 12:19:14 -05:00
Artem Bilan
762f839602 Upgrade to SF-5.2.2; Lettuce-5.2.1 2019-12-03 11:04:55 -05:00
Artem Bilan
42b812b711 Introduce RSocketInteractionModel (#3110)
* Introduce RSocketInteractionModel

* Deprecate `RSocketOutboundGateway.Command` in favor of newly introduced
top level `RSocketInteractionModel`
* Deprecate setter, DSL and XML configurations for the deprecated
`RSocketOutboundGateway.Command` in favor of newly introduced configurators
for the mentioned `RSocketInteractionModel`
* Add `IntegrationRSocketEndpoint.getInteractionModels()` contract for
inbound endpoints.
This way we can restrict mapped endpoints to the particular interaction
model(s)
* Add DSL and XML configuration for inbound interaction model option
* Document changes

* * Rebased into master; fix conflicts
* Fix consistency for `RetrieveSpec` in the `RSocketOutboundGateway`
and `rsocket.adoc`

* * Fix language in JavaDos and XSD attributes
2019-12-02 14:54:37 -05:00
Artem Bilan
8e7c1067f3 Fix pub/sub race conditions in Reactive tests 2019-12-02 14:03:12 -05:00
Artem Bilan
daa89bf091 Fix changes-5.0-5.1.adoc for proper version range 2019-11-27 16:18:23 -05:00
Artem Bilan
75c9db1b0e RSocketOG: rename method to prepareRetrieveSpec 2019-11-25 14:04:42 -05:00
Artem Bilan
d9df857dc1 Fix RSocketOutboundGateway to use RetrieveSpec
Related to https://github.com/spring-projects/spring-framework/issues/24073
2019-11-25 13:20:39 -05:00
Artem Bilan
516ecbcf8b GH-3114: Honor SpEL contract in ExpressionEvalMap
Fixes https://github.com/spring-projects/spring-integration/issues/3114

The contract of SpEL with its
`getValue(EvaluationContext context, @Nullable Object rootObject)` is
that we need to deal with provided `rootObject` even if it is `null`
and don't consult with `context.getRootObject()`

* Fix `ExpressionEvalMap` to have an internal `rootExplicitlySet`
to indicate that `root` explicitly provided by consumer, even if it is null.
According this flag call respective `Expression.getValue()`
* Add `@Nullable` to methods and their arguments into `ExpressionEvalMap`
& `FunctionExpression` to honor `Expression` contracts
* Populate an `HttpEntity` explicitly into `ExpressionEvalMap` from the
`HttpRequestHandlingEndpointSupport` and `WebFluxInboundEndpoint` for
full picture

* Fix JavaDocs indentations in the `ExpressionEvalMap`
2019-11-25 13:03:33 -05:00
Gary Russell
ee7be04c15 Update roles in publish-maven.gradle 2019-11-21 16:21:07 -05:00
Artem Bilan
2da7ae016d Add NPE test for ExprEvalSqlParameterSourceFactory
Related to https://github.com/spring-projects/spring-integration/issues/3113

Also clean up code style in the `ExpressionEvaluatingSqlParameterSourceFactory`
2019-11-21 12:11:30 -05:00
Gary Russell
9fb2e570c9 GH-3113: Fix NPE in EESqlParameterSourceFactory
Resolves https://github.com/spring-projects/spring-integration/issues/3113
2019-11-21 09:13:14 -05:00
Gary Russell
ffa199876d Fix Sonar issue from previous commit 2019-11-21 09:07:21 -05:00
Gary Russell
f80ecf17fa Fix TcpConnectionFactory FactoryBean
- bean factory and application context were not injected
- `afterPropertiesSet()` was not called

**cherry-pick to all supported branches**
2019-11-20 14:57:59 -05:00
Artem Bilan
0ec9859c0f Refactor some tests into JUnit 5
* Improve their interaction with Reactor Test
2019-11-19 15:28:55 -05:00
Artem Bilan
25e945908c Fix RSocket module according changes in SF
Related to https://github.com/spring-projects/spring-framework/issues/23999

* Since Spring Integration inbound endpoints are generic in their method
signature we can't rely on a new `EMPTY_CONDITION` because it turns on
configuration merge into just `FrameType.REQUEST_FNF` &
`FrameType.REQUEST_RESPONSE`.
So, use `FrameType.REQUEST_FNF`, `FrameType.REQUEST_RESPONSE`,
`FrameType.REQUEST_STREAM` & `FrameType.REQUEST_CHANNEL` explicitly to
cover all the valid request-response models for SI endpoints
* Rework `RSocketOutboundGatewayIntegrationTests` according new logic.
Plus refactor to earlier subscription into `FluxMessageChannel` to
avoid potential race conditions
2019-11-19 12:12:46 -05:00
Artem Bilan
0f5bd4a40a INT-3494: Resolve dir for writing as a Resource (#3109)
* INT-3494: Resolve dir for writing as a Resource

JIRA: https://jira.spring.io/browse/INT-3494

The expression for local directory can be resolved into a `Resource`
or resource location.
* Fix `ExpressionUtils.expressionToFile()` to support `Resource` and
also use `ResourceUtils.getFile(path)` when expression result is a string
* Modify tests to ensure that resource is resolved properly
* Upgrade affected tests to JUnit 5
* Mention an new functionality in docs

* * Improve Java doc for `ExpressionUtils.expressionToFile()`
* Finish the sentence in the `file.adoc`
2019-11-14 16:27:59 -05:00
Artem Bilan
069d8730e0 Fix NPE in RSocketInboundGateway.decodePayload() 2019-11-14 10:02:56 -05:00
Artem Bilan
72f7c72392 GH-3107: Add errorOnTimeout for TcpInboundGateway
Fixes https://github.com/spring-projects/spring-integration/issues/3107

The `MessagingGatewaySupport` has an `errorOnTimeout` option to throw
a `MessageTimeoutException` when downstream reply doesn't come back in
time for configured reply timeout

* Expose an `errorOnTimeout` option as a `TcpInboundGateway` ctor
property
* Add new factory methods into a `Tcp` factory for Java DSL
* Ensure a property works as expected in the `IpIntegrationTests`
* Document a new option

* Add a setter for MessagingGatewaySupport.errorOnTimeout option
* Expose an `errorOnTimeout` option on the DSL's `MessagingGatewaySpec`
making all the out-of-the-box inbound gateways possible to react to the
`MessageTimeoutException` when no reply during reply timeout
* Propagate properly `errorOnTimeout` in the `JmsInboundGateway`
* Modify docs respectively

* Improve docs about `errorOnTimeout`
2019-11-14 09:07:46 -05:00
Artem Bilan
0bbdd3a5f7 Upgrade to Gradle 6.0; AMQP and Data SNAPSHOTs 2019-11-13 11:24:28 -05:00
Artem Bilan
783a07cf06 Fix HTTP tests accoridng SF changes
Related to https://github.com/spring-projects/spring-framework/pull/1956
2019-11-13 10:34:33 -05:00
Artem Bilan
d9e09b93fc Test that Kotlin synthetic classes work in SpEL
Related to https://github.com/spring-projects/spring-framework/issues/23812

* Modify `FunctionsTests.kt` test to be sure that fall back to SpEL
invocation in case of Kotlin lambda works as expected.
This is like an additional test to the fix in Spring Framework
2019-11-13 10:09:08 -05:00