Commit Graph

10120 Commits

Author SHA1 Message Date
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
Artem Bilan
b6bd83d548 Fix deprecation for TX; fix JMS tests; Moore-SR6
* Upgrade to Spring Data Moore-SR6
* Fix `TransactionHandleMessageAdvice` and `TransactionInterceptorBuilder`
for deprecations in the `TransactionInterceptor`
* Fix `TransactionHandleMessageAdvice` and `TransactionInterceptorBuilder`
consumers to expose new `TransactionManager`-based options and
deprecate `PlatformTransactionManager`-based
* Fix failing JMS tests to reuse an ActiveMQ Connection Factory with a
`trustedPackaged(*)`

**Cherry-pick to master**

# Conflicts:
#	build.gradle
#	spring-integration-core/src/main/java/org/springframework/integration/dsl/ConsumerEndpointSpec.java
#	spring-integration-core/src/main/java/org/springframework/integration/dsl/PollerSpec.java
#	spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionHandleMessageAdvice.java
#	spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionInterceptorBuilder.java
2020-03-25 13:56:37 -04:00
Artem Bilan
838abe03de Upgrade dependencies
* Fix `ActiveMQMultiContextTests` for `amqFactory.setTrustAllPackages(true)`
2020-03-24 17:05:48 -04:00
Gary Russell
fbf06e8bb5 GH-3181: MQTT: Support MANUAL Acks
Resolves https://github.com/spring-projects/spring-integration/issues/3181

* Doc polishing

* Rework acknowledgment into the existing `AcknowledgmentCallback`.

* Fix javadocs and doc linFix javadocs and doc linkk

* Doc polishing; explain uses of `ACKNOWLEDGMENT_CALLBACK` header.
2020-03-19 15:20:13 -04:00
Artem Bilan
3eedda6c9d GH- 3223: Build ResolvableType after mapping
Fixes https://github.com/spring-projects/spring-integration/issues/3223

The `json__TypeId__` header may have a value which cannot be resolved to the `Class` in the current classpath
So, skip `ResolvableType` building logic until we really sure that end-user wants to map JSON headers
* WARN a build exception that we can't load a class for the `json__TypeId__` when we try to build a `ResolvableType`
in the  `DefaultAmqpHeaderMapper`
* Document the negation feature for JSON headers

**Cherry-pick to 5.2.x**
2020-03-19 14:51:32 -04:00
Gary Russell
eea29e729a GH-3215: MQTT Event for failed connection outbound
Resolves https://github.com/spring-projects/spring-integration/issues/3215

* Add docs; publish an event for an initial connection failure too.

**Cherry-pick to 5.2.x**
2020-03-17 15:09:22 -04:00
Artem Bilan
92421f7575 Add Kotlin wrappers for router specs (#3218)
* Add Kotlin wrappers for router specs

To avoid casting and extra logic logic in the end-user code,
it is better to provide Kotlin-specific API to let end-users to
do whatever is really dictated by API and don't think about specific types to cast

* * Fix typos; code clean up
2020-03-17 12:56:45 -04:00
Zach Shutters
71e6b27b41 GH-3216: Fix doc for outbound file adapter
Fixes https://github.com/spring-projects/spring-integration/issues/3216
2020-03-16 13:28:23 -04:00
Artem Bilan
3058345648 Upgrade to Gradle 6.2.2
* Improve `build.gradle`:
 - Upgrade some plugins
 - Remove unused (or mistaken) dependencies
 - Add transitive `exclude` into Spring Data dependencies
 - Add `inputs.dir(sourceDir)` for docs tasks in attempt to avoid their build because of `up-to-date`
2020-03-13 13:15:38 -04:00
Spring Buildmaster
e2b6383d04 [artifactory-release] Next development version 2020-03-11 20:40:29 +00:00
Spring Buildmaster
24ad1edc22 [artifactory-release] Release version 5.3.0.M3 2020-03-11 20:40:25 +00:00
Artem Bilan
46cf5db78a GH-3213: Expose LeaderInitiatorFB.candidate
Fixes https://github.com/spring-projects/spring-integration/issues/3213

* Expose a `LeaderInitiatorFactoryBean.setCandidate()` for better control over candidate options
* Expose a `candidate` attribute for the `<int-zk:leader-listener>` tag
* Fix `dokka` task to obtain `package-list` URL from the local dir
* Migrate ZK tests to JUnit 5
2020-03-11 16:07:17 -04:00
Artem Bilan
e9a3580ef5 Upgrade dependencies; fix new Sonar smells 2020-03-11 10:22:51 -04:00
Artem Bilan
6b82681cc0 GH-3211: Add DefSftpSF.setKnownHosts(Resource) (#3212)
* GH-3211: Add DefSftpSF.setKnownHosts(Resource)

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

* Add `DefaultSftpSessionFactory.setKnownHosts(Resource)` to
allow to configure externally any resource for file with known_hosts content
* Deprecate an existing method in favor of new one
* The new method makes it aligned with the `setPrivateKey(Resource)`
* Fix tests do not use a deprecated method any more

**Cherry-pick to 5.2.x**

* * Rename to `setKnownHostsResource()` to avoid XML parser confusion
* Change `sftp.adoc` to reflect a new property
2020-03-10 16:50:00 -04:00
Artem Bilan
36f96ec2c6 Document Kotlin DSL (#3210)
* Document Kotlin DSL

* Remove unused imports in `FunctionsTests.kt`

* * Fix typos in Docs
2020-03-10 16:47:41 -04:00
Artem Bilan
c45cc66a84 GH-3207: RSocket inbound: decode each flux item (#3208)
* GH-3207: RSocket inbound: decode each flux item

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

Previously an incoming RSocket Publisher has been decoded as a single unit
leading to extra work on the client side, e.g. a delimiter has to be provided
to treat each payload item as independent

* To have a consistency with Spring Messaging and its `PayloadMethodArgumentResolver`
change an `RSocketInboundGateway` to process inbound payloads as `Flux` and decode
each item independently.
* Change `RSocketDslTests` to remove delimiters and make it consistent with the regular
`RSocketRequester` client

* * Add `decodeFluxAsUnit` option into `RSocketInboundGateway`
* Document the change
2020-03-10 16:07:01 -04:00