Commit Graph

10135 Commits

Author SHA1 Message Date
Spring Buildmaster
f25c91ea46 [artifactory-release] Release version 5.3.0.RC1 2020-04-29 18:03:16 +00:00
Artem Bilan
1f47b6b55d Fix typo in build.gradle 2020-04-29 13:41:17 -04:00
Artem Bilan
cde9506ce4 Upgrade dependencies; prepare for release 2020-04-29 13:30:12 -04:00
Artem Bilan
c264e12deb Fix new Sonar smells 2020-04-29 09:27:54 -04:00
Artem Bilan
dc15910f2c GH-3266: Don't override props in AnnGWProxyFB
Fixes https://github.com/spring-projects/spring-integration/issues/3266

It turns out that `AnnotationGatewayProxyFactoryBean.onInit()` implementation
parses a `@MessagingGateway` attributes ignoring possible properties
population by setters.
This way a Java DSL `GatewayProxySpec` becomes useless since all
its options are overridden by default values from a synthesized
`@MessagingGateway`.
Also it is inconsistency when we declare an `AnnotationGatewayProxyFactoryBean`
as regular bean, but then called setters are ignored

* Add `protected` getters into `GatewayProxyFactoryBean` for all
the properties which can be overridden by annotation attributes
* Fix `AnnotationGatewayProxyFactoryBean` to consult with those getters
before populating a property with value from the annotation

**Cherry-pick to 5.2.x**
2020-04-28 17:27:17 -04:00
Artem Bilan
9ec6529992 Upgrade to Rsocket 1.0-RC7; fix deprecations
* Fix RSocket docs according new functionality

**Cherry-pick to 5.2.x**
2020-04-28 17:20:38 -04:00
Artem Bilan
2d9a5f60f4 Introduce a ReceiveMessageAdvice (#3265)
* Introduce a `ReceiveMessageAdvice`

* Deprecate an `AbstractMessageSourceAdvice` in favor of
`default` method in the `MessageSourceMutator`
* Move a `applyReceiveOnlyAdviceChain()` logic into the `AbstractPollingEndpoint`:
now both `PollingConsumer` and `SourcePollingChannelAdapter` can use
`ReceiveMessageAdvice`
* Introduce a `SimpleActiveIdleReceiveMessageAdvice` based already
on the `ReceiveMessageAdvice` and deprecate a `SimpleActiveIdleMessageSourceAdvice`
which is fully replaceable with newly introduced `SimpleActiveIdleReceiveMessageAdvice`
* Add `@SuppressWarnings("deprecation")` for those out-of-the-box `ReceiveMessageAdvice`
implementation which still use an `AbstractMessageSourceAdvice` for
backward compatibility
* Document a new feature and give the `MessageSourceMutator` a new meaning

* * Fix language in the `polling-consumer.adoc`
2020-04-28 13:03:30 -04:00
Artem Bilan
cfd03f89a0 Use a SimpleJsonSerializer in the FileSplitter (#3262)
* Use a SimpleJsonSerializer in the FileSplitter

* To avoid extra dependency for Jackson when we
serialize `FileSplitter.FileMarker` to JSON, use
a `SimpleJsonSerializer` instead.
* Fix `SimpleJsonSerializer` to escape a `\` symbol from property values
since it is used for quoting string values in the final JSON

* * Document the change
2020-04-27 15:42:45 -04:00
Jay Bryant
620b9bf52d Upgrade to latest version of Asciidoctor
Upgrade to latest version of Asciidoctor because we were several
versions behind and were steadily incurring more technical debt.

* Replace project-version attribute in Asciidoctor

I had removed the project-version attribute, but the docs use it all
over, so I put it back.

* Removed unneeded repositories

It turns out that those repositories are not needed.

A cross-reference was incorrectly formatted (missing the # character).
2020-04-27 12:37:53 -04:00
Gary Russell
e9a0149030 Fix race in TCP async gateway test 2020-04-25 13:20:57 -04:00
Artem Bilan
6b57e16440 GH-3253: Scan BF hierarchy for BeanDefinition
Fixes https://github.com/spring-projects/spring-integration/issues/3253

The `IntegrationFlowBeanPostProcessor` uses a `containsBean()`
and then `getBeanDefinition()` to be sure that we don't override already
existing bean even if it is created in the parent(s) context.
The problem that `containsBean()` check the hierarchy, but `getBeanDefinition()`
doesn't.
So, we fail with `NoSuchBeanDefinitionException` if bean exists in the parent ctx

* Introduce an utility `IntegrationContextUtils.getBeanDefinition()` to
scan `BeanFactory` recursively for `BeanDefinition` for the requested `name`
* Use this tool in the `IntegrationFlowBeanPostProcessor` logic

**Cherry-pick to 5.2.x & 5.1.x**
2020-04-24 14:01:03 -04:00
Gary Russell
ca80435951 GH-3256: Fix interaction with delayed listener reg
- Use the test listener before waiting for delayed listener registration.
- Don't wait for delayed listener registration if the test fails.
2020-04-24 10:45:44 -04:00
Gary Russell
1d4626f54c GH-3256: Support Testing TCP Connections
Resolves https://github.com/spring-projects/spring-integration/issues/3256
2020-04-23 17:04:29 -04:00
Artem Bilan
02407f7dff Add ReactiveMessageSourceProducer (#3254)
* Add `ReactiveMessageSourceProducer`

The `ReactiveMessageSourceProducer` wraps a provided `MessageSource`
into a `Flux` for subscription in the `subscribeToPublisher(Publisher<? extends Message<?>>)`
to make a source polling feature fully based on a reactive, on demand solution

* Introduce a `IntegrationReactiveUtils` replacing existing `MessageChannelReactiveUtils`
with more functionality
* Replace a deprecated `MessageChannelReactiveUtils` with a new `IntegrationReactiveUtils`
* Test and document the feature

* * Fix Docs typos

* * Remove unused imports from `MessageChannelReactiveUtils`

* * Fix JavaDoc copy/paste artifact
2020-04-23 15:28:16 -04:00
Gary Russell
9414765b28 Fix Sonar issue 2020-04-23 12:14:02 -04:00
Jay Bryant
eedd2b028f Upgrade spring-doc-resources
Upgrade spring-doc-resources from version 0.2.0 to version 0.2.1
to get a bug fix (setting the display width in HTML output).
2020-04-23 11:42:04 -04:00
Gary Russell
c2babe4ba2 Add remaining deprecations for legacy metrics
- add a module to suppress legacy metrics from the Integration Graph
- move graph tests package to match src/main

Fix missed deprecation and checkstyle.

More deprecations and remove GraphLegacyStatsNullModule.

* Revert GRAPH_VERSION.
* Fix JavaDocs warnings
* Fix `MBeanExporterParserTests`
2020-04-22 17:29:36 -04:00
Artem Bilan
b06322787e Fix RemoteFileOutboundGWTests for the proper mock 2020-04-18 21:21:08 -04:00
Artem Bilan
5ba1b9321f GH-3249: Fix RemoteFileTemplate dead lock in send
Fixes: https://github.com/spring-projects/spring-integration/issues/3249

When the `CachingSessionFactory` is configured with small enough pool
and it is very likely that dead lock may happen when `RemoteFileTemplate.send()`
is used.
The problem happens when we reach the `RemoteFileTemplate.exists()` call
which is done from the internal method called from already pulled from cache
`Session`

* Fix `RemoteFileTemplate` to use a `session.exists()` instead on the provided
into the method `Session`
* Demonstrate the problem in the `SftpRemoteFileTemplateTests.testNoDeadLockOnSend()`

**Cherry-pick to 5.2.x, 5.1.x & 4.3.x**
2020-04-18 21:06:15 -04:00
Artem Bilan
0d9b421cc9 Apply GitHub default community health
* Remove `CODE_OF_CONDUCT.adoc` if favor of the same for a GitHub org
* Move `LICENSE.txt` to the root project dir
* Fix `build.gradle` to copy a `LICENSE.txt` from the actual location
* Fix `README.md` and `CONTRIBUTING.adoc` to point into the actual `CODE_OF_CONDUCT`
& Security policy
* Add `ISSUE_TEMPLATE` directory with files similar to ones in `spring-session`
* Fix wrong section `id` in the `whats-new.adoc`
2020-04-18 16:55:53 -04:00
Artem Bilan
8505da163d Increase a block timeout in Gateway Mono test
* It turns out that 1 seconds is not enough on CI machine under the stress
2020-04-18 11:13:53 -04:00
Artem Bilan
47d7bf3fe2 Add missed doc contents entry for RSocket chapter
**Cherry-pick to 5.2.x**
2020-04-14 16:37:29 -04:00
Gary Russell
877fa4951e GH-3247: Fix test 2020-04-14 16:02:52 -04:00
Gary Russell
0cee7342a3 GH-3247: Throw UncheckedIOException 2020-04-14 15:45:55 -04:00
Artem Bilan
b75f1bd0da GH-3247: Fix SftpSession.exists for error code (#3248)
* GH-3247: Fix `SftpSession.exists` for error code

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

When there is no path on the SFTP server, a `ChannelSftp.SSH_FX_NO_SUCH_FILE`
error is returned in the thrown `SftpException`.

* Fix `SftpSession.exists()` to check for the `SSH_FX_NO_SUCH_FILE` to
return `false` and re-throw an exception otherwise
* Add mock test for `SftpSession.exists()`
* Add `org.mockito.AdditionalMatchers` to `checkstyle.xml` exclusions

**Cherry-pick to 5.2.x & 5.1.x**

* * Add exists tests against Mina embedded server
2020-04-14 15:26:14 -04:00
Artem Bilan
97702ae712 Fix some Sonar smells 2020-04-08 13:01:49 -04:00
Artem Bilan
d8c378bd28 GH-2788: Add MongoDbChangeStreamMessageProducer
Fixes https://github.com/spring-projects/spring-integration/issues/2788

* Introduce a `MessageProducerSupport.subscribeToPublisher(Publisher<Message<?>>)`
for components which produces `Flux` for data from their source
* Such a component is auto-stopped when subscription to that `Publisher` is canceled
* Implement a `MongoDbChangeStreamMessageProducer` based on the reactive support for
in Spring Data MongoDb
* Implement a Java DSL for `MongoDbChangeStreamMessageProducer`
* Disable a test for change stream since it requires server of version 4.x started with 'replSet' option
* Add `MongoHeaders` for change stream events

* Change `MessageProducerSupport` to use a `takeWhile((message) -> isRunning())`
instead of storing a `subscription` from a callback
* Document new features

* Remove trailing whitespaces

* Doc Polishing.
2020-04-07 16:51:55 -04:00
Artem Bilan
2d7e47355b GH-3243: sync computeIfAbsent in StoredProcExec
Fixes https://github.com/spring-projects/spring-integration/issues/3243

It turns out that `ConcurrentModificationException` is thrown from the
`HashMap.computeIfAbsent(HashMap.java:1134)` since Java 9 when the map is
modified concurrently independently from the key we try to modify

* Check for the value presence before computing
* `synchronized(this.jdbcCallOperationsMap)` around `computeIfAbsent()`
when `get() == null`

**Cherry-pick to 5.2.x**
2020-04-07 14:54:58 -04:00
Artem Bilan
cd64a0902e * Fix http:// usage in the test 2020-04-07 13:25:19 -04:00
Artem Bilan
d24c2c8431 Fix Checkstyle violations & RMI tests
* Increase latch timeouts for `RedisLockRegistryLeaderInitiatorTests`
* Some RMI tests fail with different outcome because an RMI registry might be
available on default `1099` port.
Fix them to not rely on that port
2020-04-07 13:21:46 -04:00
Artem Bilan
3a846bad29 Fix some Sonar smells 2020-04-07 11:26:13 -04:00
Gary Russell
cc0c2fd2fe GH-3241: Fix Sonar issue 2020-04-07 10:32:01 -04:00
Gary Russell
7d7c273515 GH-3241: MetadataStoreSelector - compare old/new (#3242)
Resolves: https://github.com/spring-projects/spring-integration/issues/3241

 * Docs and XML namespace support.
2020-04-06 18:12:36 -04:00
Artem Bilan
1f2a33437d Fix new Sonar smell 2020-04-03 12:04:32 -04:00
Artem Bilan
24e6be6f01 GH-3238: Fix Unmarshaller to close File resource
Fixes https://github.com/spring-projects/spring-integration/issues/3238

* Extract an `InputStream` from a `File` payload in the `UnmarshallingTransformer`
before parsing an XML.
Close this `InputStream` in the `finally` block to release the file resource

**Cherry-pick to 5.2.x, 5.1.x & 4.3.x**
2020-04-02 13:04:15 -04:00
Gary Russell
79f647990e GH-2736: Add DSL support for async TCP OB Gateway 2020-04-02 10:32:36 -04:00
Gary Russell
5cb3f21d41 GH-2736: Async Mode for TcpOutboundGateway
Resolves https://github.com/spring-projects/spring-integration/issues/2736

Support asynchronous request/reply.

* - Add `async` to the schema
- Fix tests1

* - Capture `isAsync` in a variable
- Fix typo
- Convert test to JUnit5
2020-04-01 17:43:29 -04:00
Spring Buildmaster
e37d3f0741 [artifactory-release] Next development version 2020-04-01 18:05:52 +00:00
Spring Buildmaster
e5772d4d38 [artifactory-release] Release version 5.3.0.M4 2020-04-01 18:05:47 +00:00
Artem Bilan
5b03db3f0f Upgrade dependencies; prepare for release
* Fix new Sonar smell
2020-04-01 13:42:14 -04:00
Gary Russell
fcca7a7b26 GH-3230: MMIH: Fix Pausable/Lifecycle Methods
Resolves https://github.com/spring-projects/spring-integration/issues/3230

Previously, methods with the same name as `Lifecycle` methods were unconditionally ignored.

- Use logic similar to `ControlBusMethodFilter` to explicitly compare the candidate Method
  to those on `Paused` and `Lifecycle` and only ignore those.
- Explicitly disallow these methods when named - previously the check was only performed
  if no method name was supplied.

* - reinstate `Pausable/Lifecycle` methods if explicitly requested.
- log `Pausable` methods that are not candidates.

* - Fix typo in test method.

**Cherry-pick to 5.2.x**
2020-04-01 12:17:26 -04:00
Artem Bilan
76e79012fe GH-3219: Add HandleMessageAdviceAdapter (#3234)
* GH-3219: Add `HandleMessageAdviceAdapter`

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

* * Fix language in doc

Co-Authored-By: Gary Russell <grussell@pivotal.io>

Co-authored-by: Gary Russell <grussell@pivotal.io>
2020-04-01 11:10:33 -04:00
Artem Bilan
7433e41036 Add more Kotlin DSL for sub-flows (#3233)
* Add more Kotlin DSL for sub-flows

* Introduce `KotlinSplitterEndpointSpec`, `KotlinEnricherSpec` &
`KotlinFilterEndpointSpec` to avoid an explicit use of `IntegrationFlow` usage
from Kotlin DSL
* Fix `AbstractKotlinRouterSpec` to extend `ConsumerEndpointSpec` for access
to more endpoint options as it is with Java DSL for similar specs
* Introduce a `KotlinIntegrationFlowDefinition.publishSubscribe()`
for a `BroadcastCapableChannel` and `vararg` of `KotlinIntegrationFlowDefinition` builders.
This allows us to not introduce a `BroadcastPublishSubscribeSpec` wrapper for Kotlin
and let us to remove `publishSubscribeChannel()` DSL methods for `PublishSubscribeSpec`
since it is covered with the `publishSubscribe(PublishSubscribeChannel())` and
respective set of sub-flows in Kotlin DSL as subscribers
* Use new Kotlin specs in the `KotlinIntegrationFlowDefinition` instead of their
Java variants

* * Mention `kotlin-dsl.adoc` in the ToC
2020-04-01 11:06:54 -04:00
Artem Bilan
6d5690fd58 GH-2996: Add Resource for remote file transfer (#3231)
* GH-2996: Add Resource for remote file transfer

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

* Fix `RemoteFileTemplate.send()` to support a `Resource` payload
for remote file transferring content
* Code style clean up for `RemoteFileTemplate`
* Remove `volatile` for configuration properties for better performance
* Change a `charset` to the `Charset` for only once conversion from string
during configuration phase
* Fix (S)FTP tests for new functionality
* Change affected tests to JUnit 5
* Document a new feature; mention all the supported types and `FileExistsMode` constants

* * Fix language in `whats-new.adoc`
2020-03-31 16:09:07 -04:00
Artem Bilan
63f8907e88 Change RMI tests to use fixed port
Our CI plans fail from time to time in the test which is based
on the OS-selected port

* Change the port to use a `SocketUtils.findAvailableTcpPort()`
since all other with the fixed port don't fail
* Rework all the RMI tests to JUnit 5
2020-03-29 11:29:17 -04:00
Gary Russell
83f218514c Upgrade to docResources 0.2.0 2020-03-27 16:37:55 -04:00
Artem Bilan
9c46b3420e Fix JsonToObjectTransformer for ClassNotFoundEx (#3228)
* Fix JsonToObjectTransformer for ClassNotFoundEx

Related to https://github.com/spring-projects/spring-integration/issues/3223

The `JsonToObjectTransformer` consults `JsonHeaders` first and tries to build
a `ResolvableType` from other type headers which may be just a string identifications.
In this case a `ClassNotFoundException` could be thrown if a `ResolvableType` cannot
be build against non-class identificators

* Add `valueTypeExpression` option to the `JsonToObjectTransformer` to let to
build a `ResolvableType` using any possible custom logic, e.g. resolving
target classes from some registry using their ids from the mentioned headers

**Cherry-pick to 5.2.x**

* * Fix English language mistakes
2020-03-27 15:42:24 -04:00
Artem Bilan
f1a0a066af Fix some typos in amqp.adoc 2020-03-26 14:09:43 -04:00
Artem Bilan
bff891b7a9 Fix new Sonar smells 2020-03-26 10:31:32 -04:00
Artem Bilan
ca493caf67 Upgrade to Gradle 6.3 2020-03-25 16:16:48 -04:00