- 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`
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**
* 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`
* 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
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.
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**
* 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
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**
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**
* 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
* 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`
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
* 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
* 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
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**
* 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
* 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`
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
* 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
* 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