Commit Graph

10989 Commits

Author SHA1 Message Date
Gregory Bragg
0cf1dfee7e Some improvements for SMB module
* Improve permission information returned in `SmbFileInfo`
* Improve documentation for `SmbFileInfo.getPermissions()`
* Add Junit tests to verify all outbound gateway functionality
* Clean test directory of mistakenly migrated SMB extension code
2022-05-26 12:55:37 -04:00
Artem Bilan
751d8084b4 Improve Hazelcast test suite performance
* Add recommended JVM args to the Gradle module for HZ performance
* Move `IdempotentReceiverIntegrationTests` from JMX module to HZ for consistency
* Remove component scan from the `HazelcastIntegrationOutboundTestConfiguration` - redundant
* Use `HazelcastInstance.shutdown()` during normal context lifecycle.
The `@AfterClass` may happen early, so the `stop()` of the channel adapters may fail with
an exception that HZ is not available causing the `LifecycleProcessor` to wait for 30 seconds
on the lifecycle barrier
* Wrap `AbstractEndpoint.doStop()` call into `try..catch` to log error instead of re-throwing
to avoid the mentioned above 30 secs delay of the application context stop
2022-05-25 16:45:00 -04:00
Robert Höglund
a322f5c35d Move spring-integration-hazelcast from extensions
* Update javadocs
* Upgrade from log4j to log4j2
* Remove unnecessary test deps.
* Change from implmementation to api
* Remove unneeded test deps.
* Fix HZ XSD to be "versionless"
* Use `com.google.code.findbugs:annotations` dep to avoid warning from HZ code base
2022-05-25 12:26:28 -04:00
Dominic Stew
040438f5e9 Refresh README
* Modernize the homepage of Spring Integration
* Improve README.md file, so it has examples, explanations, and logo
2022-05-24 12:31:54 -04:00
Gregory Bragg
1f666bcc49 Documentation For new SMB components
* Updated SMB Module documentation for new components
`SmbStreamingMessageSource` and `SmbOutboundGateway`
* Update based on PR review feedback
* Omit XML config examples based on PR review feedback
2022-05-24 10:12:41 -04:00
Artem Bilan
4cc9b300d4 The testWindowTimespan() is time-sensitive
The `FluxAggregatorMessageHandlerTests.testWindowTimespan()`
relies on the time-based window function of `100` millis.
Looks like a delay of `Thread.sleep(20)` may cause a resources race
condition and window is released only with one item.

* Disable `testWindowTimespan()` since there is no guarantee with what
timing settings it is going to work stably

**Cherry-pick to `5.5.x`**
2022-05-23 12:08:03 -04:00
Gregory Bragg
4203a2369f SmbOutboundGateway: Other remote file operations
* Enhanced SmbOutboundGateway with supported remote file operations
* Updated SmbOutboundGateway code based on PR review feedback
* Fully implemented listNames() in SmbSession, added more JUnit tests
* Updated SmbSession code based on PR review comments
2022-05-20 16:37:39 -04:00
Artem Bilan
274b27270f * Improve time-sensitive ControlBusTests.testControlHeaderChannelReaper()
The `Thread.sleep(1000);` doesn't give a good async barrier to rely on
in the subsequent verification logic.
Use `await().until()` instead for several attempts until a condition is fulfilled
ot 10 seconds timeout is exhausted.
Also decrease `reapDelay` to `500` for better test suite performance
2022-05-20 11:59:09 -04:00
Artem Bilan
7262c5f6fd Really reuse Testcontainers
The `withReuse(true)` and `testcontainers.reuse.enable=true` don't work together with `@Container`.
The JUnit extension gathers those containers and stop them in the end of test class unconditionally.

* Remove `@Container` annotation usage
* Use `@BeforeAll` and `GenericContainer.start()` manually
This way the container ensures to reuse existing running container and don't start a fresh one.
Since the container instance is stored in a `static` property, it is really started only once.
The rest tests in a suite just reuse that existing container.
Ryuk container will take care about their stopping and removal eventually afte JVM exit.

**Cherry-pick to `5.5.x`**
2022-05-19 12:15:43 -04:00
Matthias Stock
e645d046a8 Removed dead link from jdbc.adoc
The linked resource is not available anymore:
https://web.archive.org/web/20210228160648/https://blog.engineyard.com/5-subtle-ways-youre-using-mysql-as-a-queue-and-why-itll-bite-you
2022-05-19 11:13:04 -04:00
Spring Builds
76d571f649 [artifactory-release] Next development version 2022-05-18 20:28:17 +00:00
Spring Builds
8cb8690dc7 [artifactory-release] Release version 6.0.0-M3 2022-05-18 20:28:13 +00:00
Gregory Bragg
ac6af716e1 Add Java DSL for SMB module
* Added supporting classes for DSL, fixed checkstyle build errors
* Added JUnit tests for DSL package
* Updated Java Doc with instructions to setup an external SMB share
* Updated AsciiDoc to include instructions on Java DSL configurations
* Updated implementation based on PR review feedback
* Clean up the code
* Add more info to `whats-new.adoc` for these SMB changes
2022-05-18 15:37:08 -04:00
Artem Bilan
1790f235b7 Fix Checkstyle violations
* Upgrade to Spring Security `6.0.0-M5`
2022-05-18 13:58:05 -04:00
Artem Bilan
ed6f26104f Rely on the official ENV var for Docker repo
* Remove obsolete `TestUtils.dockerRegistryFromEnv()`
* Upgrade to Spring GraphQL `1.0.0`
2022-05-18 13:04:13 -04:00
Artem Bilan
f5ab0c1665 Upgrade dependencies; fix compatibilities
* Fix new Checkstyle rules violations
2022-05-17 17:00:37 -04:00
Artem Bilan
627a797d49 GH-3800: Fix Kotlin docs for route() DSL
Fixes https://github.com/spring-projects/spring-integration/issues/3800

* Mention `Message` as a type for reified generic argument in Kotlin DSL docs

**Cherry-pick to `5.5.x`**
2022-05-17 15:04:21 -04:00
Artem Bilan
5a92d1fcdd * Shorten description of Configuration content item 2022-05-11 16:43:27 -04:00
Artem Bilan
ad19029378 * Remove Pivotal GemFire from content item 2022-05-11 16:43:27 -04:00
Artem Bilan
709f5585df Some Docs improvements
* Add short description to content link in the `index.adoc`
to make it more clear what target chapter is about
* Fix `index-header.adoc` to not show a links to other doc formats.
Instead, use correct link to single/multi according the current context
* Add `Feedback` and `Getting Started` sections to `preface.adoc`
2022-05-11 16:43:27 -04:00
Artem Bilan
9075453add GH-3794: Use less memory with scheduled tasks
Fixes https://github.com/spring-projects/spring-integration/issues/3794

* Replace hard reference to message group with its `id` in the
`AbstractCorrelatingMessageHandler.removeEmptyGroupAfterTimeout()`
* Replace hard reference to message with its `id` in the
`DelayHandler.rescheduleAt()`

**Cherry-pick to `5.5.x`**
2022-05-10 14:34:22 -04:00
Artem Bilan
6d7aebc65a GH-3592: Scatter-Gather: applySeq=true by default
Fixes https://github.com/spring-projects/spring-integration/issues/3592

* Configure XML parser & Java DSL for Scatter-Gather, based on the
`RecipientListRouter` to set an `applySequence` to `true` by default.
This will make a `gatherer` part to fully rely on the default correlation
strategies
2022-05-10 11:03:34 -04:00
Artem Bilan
db287cf98f Remove unused import in the SmbMessageHandler 2022-05-10 10:55:27 -04:00
Gregory Bragg
b64e37973e Add documentation for SMB Support
* Updated, polished documentation prior to PR review
* Updated after PR review comments, changed Adapter verbiage to Support
* Add `SmbMessageHandler(SmbRemoteFileTemplate)` ctors
* Clean up `smb.adoc` for extra redundant interim headlines
2022-05-10 10:48:23 -04:00
Artem Bilan
18e410afbe GH-3679: Better caching for SpringIntegrationTest (#3792)
* GH-3679: Better caching for SpringIntegrationTest

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

The `@SpringIntegrationTest` makes a test cache key based on its attributes values
when the same application context can be used in different test classes
with different endpoints to have stopped originally.

* Rework an `IntegrationEndpointsInitializer` to the `SpringIntegrationTestExecutionListener`
which consult a `MockIntegrationContext` for endpoints to be started or not before
the test execution and definitely stopped after the test execution to have a flexibility
with the cached context
* Improve a `MockIntegrationContext` to gather `AbstractEndpoint` beans and have them
marked for stopping in the beginning of the application context.
The `SpringIntegrationTestExecutionListener` takes care about startup in its `beforeTestClass()`
* Verify different state for the `SpringIntegrationTest` with the `CachedSpringIntegrationTestAnnotationTests`

* * Improve `SpringIntegrationTestExecutionListener` performance
when no `@SpringIntegrationTest.noAutoStartup()` is configured
* Fix `CachedSpringIntegrationTestAnnotationTests` check `isRunning()`
for the endpoint under the testing instead of `isAutoStartup()`
which is changed in one test class, but not other, and the order
of their execution would matter
* Migrate `MockMessageSourceTests` to JUnit 5 as a roadmap of the whole project

* Fixes https://github.com/spring-projects/spring-integration/issues/3787
2022-05-09 13:38:10 -04:00
Artem Bilan
0ad89147b2 Add distribution to setup-java@v3 GH action 2022-05-09 11:24:12 -04:00
Gregory Bragg
7ad71d38d9 Migrate SMB extension project to respective module
* Removed deprecated replaceFile and useTempFile session configs
* Refactored to use AssertJ instead of JUnit asserts as per PR feedback
* Code clean up for SMB module
2022-05-06 16:20:43 -04:00
Artem Bilan
392455eb34 Fix version for gradle-build-action GH action 2022-05-06 14:16:24 -04:00
Artem Bilan
e2c13874d2 Clean up pr-build-workflow.yml 2022-05-06 14:04:57 -04:00
Artem Bilan
22b74c7a33 GH-3790: Use new header constants for Kafka headers
Fixes https://github.com/spring-projects/spring-integration/issues/3790

Some `KafkaHeaders` constants have been removed and replaced with new
more meaningful

* Fix removed constants everywhere in the code and docs in favor of
newly introduced, which replaces old
2022-05-05 21:51:16 -04:00
Artem Bilan
da5d2ca4eb GH-3788 Support byte[] for JMS properties mapping
Fixes https://github.com/spring-projects/spring-integration/issues/3788

Some JMS vendors carry some important information in their JMS messages.
That information can be stored in the specific properties as `byte[]`.

* Add `byte[]` as a supported property type into a `DefaultJmsHeaderMapper`
* Verify `byte[]` property mapping and propagation via embedded ActiveMQ
broker.

**Cherry-pick to `5.5.x`**
2022-05-05 13:33:15 -04:00
Artem Bilan
78142fc62e Gemfire testing: --add-opens for JDK management 2022-05-05 09:42:02 -04:00
Artem Bilan
0154618182 Fix configuration doc sections id ambiguity 2022-05-04 14:01:00 -04:00
Artem Bilan
517b9d9625 Upgrade Kotlin to 1.6.21 and use jvmTarget=17 2022-05-04 13:19:37 -04:00
Artem Bilan
e454f59180 GH-3785: Close stream for persistent collection (#3786)
* GH-3785: Close stream for persistent collection

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

* Fix `CollectionArgumentResolver` and `PayloadsArgumentResolver` to
close the `Stream` of message after its usage
* Rework `AbstractKeyValueMessageStore.removeMessagesFromGroup()`
to iterate input collection of messages not its stream to avoid
the mentioned problem

**Cherry-pick to `5.5.x`**

* * Add `JdbcMessageStoreTests.testMessageGroupStreamNoConnectionPoolLeak()`
to ensure that no leaks in the connection pool anymore.
* Improve `MessageGroupStore.streamMessagesForGroup()` JavaDocs about
requirements to close the `Stream` from persistent message store impls
2022-04-25 10:18:34 -04:00
Artem Bilan
860f9fea3f Fix MongoDb module for the latest Spring Data
The `MappingMongoConverter` now used different path when it
iterates documents form conversion from a DB cursor

* Fix `MongoDbMessageStore.MessageReadingMongoConverter` to override
a `read(TypeInformation<S>, Bson)` method to convert a `MessageWrapper` properly
* Upgrade to the latest MongoDb driver
2022-04-20 13:58:36 -04:00
Artem Bilan
55c5bef6fa Fix GraphQL tests for latest Spring GraphQL 2022-04-20 11:01:27 -04:00
Artem Bilan
97ab596841 GH-2708: Make messaging annotations as repeatable
Fixes https://github.com/spring-projects/spring-integration/issues/2708

There are some requests to use the same service method for different input channels

* Make all the messaging annotations as `@Repeatable` with their
respective container annotations
* Modify `MessagingAnnotationPostProcessor` logic to deal with the mentioned repeatable
requirements
2022-04-19 11:35:24 -04:00
Artem Bilan
f54d4b3d75 Move to SNAPSHOTs
* Downgrade to Micrometer-1.10.0
* Updates according compatibility with the latest SF changes
2022-04-14 12:27:46 -04:00
Artem Bilan
4b57363a05 GH-3733 Configure TxManager for DefLockRepository (#3782)
* GH-3733 Configure TxManager for DefLockRepository

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

The `@Transactional` resolves a primary `TransactionManager` bean
from the application context which might not be sufficient for all
the use-case.

To make it work with the custom (or specific) `TransactionManager`
we have to extend a `DefaultLockRepository` and override all those
`@Transactional` method

* Change the logic of the `DefaultLockRepository` from `@Transactional`
to the `TransactionTemplate` and use provided `TransactionManager`
or resolve one from the application context
* Adjust tests to use explicit `TransactionManager` and call
`afterSingletonsInstantiated()` to initialize a default `TransactionTemplate`
* Mention the change in the docs

* * Extracted all the `TransactionTemplate`s to the properties for caching
* Add `BeanInitializationException` for no-unique `PlatformTransactionManager`
bean in the `afterSingletonsInstantiated()`

* Fix language in the exception message

Co-authored-by: Gary Russell <grussell@vmware.com>

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-04-12 12:13:15 -04:00
Artem Bilan
cd84f1699a GH-3765 Resolve Lookup ctor lazily via reflection
Fixes https://github.com/spring-projects/spring-integration/issues/3765

The `DefaultMethodInvokingMethodInterceptor` has several strategies
for `default` method invocations in the messaging gateway.
One of them is based on the `Lookup` constructor which causes
a `WARNING: An illegal reflective access operation has occurred`.
This can be done lazily when there is no `MethodHandles.privateLookupIn`
in Java version used for the project.

* Fix `OPEN` enum value for the `Constructor<Lookup>` to be resolved in
a lazy manner via `Supplier` and `boolean` flag

**Cherry-pick to `5.5.x`**
2022-04-11 14:29:21 -04:00
Artem Bilan
6a435fbd77 Improve Mono gateway sample in the doc 2022-04-11 13:34:56 -04:00
Artem Bilan
799802c0d1 Clean up some JavaDocs; remove deprecated API 2022-04-08 16:05:43 -04:00
Artem Bilan
10ea577549 GH-3615: Make log() as non-terminal in DSL
Fixes https://github.com/spring-projects/spring-integration/issues/3615

The `log()` operator for Java DSL in the end of flow causes a confusion
for its different behavior and, therefore, inconsistency with expectations

* Populate a `bridge()` in the end of flow instead of `nullChannel` when
the current component is `WireTapSpec` (relevant to `wireTap()` and `log()`)
* Deprecate a `logAndReply()` operator since its behavior is now included into the `log()` in the end if flow
* Fix tests to use just `log()` in the end from now on
* Fix `dsl.adoc` for the new `log()` behaviour in the end of flow
2022-04-07 15:07:47 -04:00
Artem Bilan
802d217a9a Close mail folder if no messages to produce
Related to https://stackoverflow.com/questions/71667731/spring-integration-mimemessage-gmail-folder-is-not-open-exception

If no mail messages pulled from the folder or all of them are filtered out,
there is nothing to produce downstream.
Therefore, always close the folder in the end of `AbstractMailReceiver.receive()`
when no messages and even if `autoCloseFolder == false`

**Cherry-pick to `5.5.x`**
2022-04-07 14:16:01 -04:00
Artem Bilan
f013aa8c29 Change to Micrometer 2.0.0-SNAPSHOT 2022-03-30 16:36:13 -04:00
Artem Bilan
04a45c5134 Fix JAXB_PRESENT variable for the proper class
The `BaseHttpInboundEndpoint` has a `JAXB_PRESENT` variable
to check before including `Jaxb2RootElementHttpMessageConverter`
which has to do that against `jakarta.xml.bind.Binder` class from Jakarta EE
2022-03-30 14:46:42 -04:00
Artem Bilan
602d5fe40b Fix AMQP test for NPE from mocks
https://build.spring.io/browse/INT-MAIN-261/

**Cherry-pick to `5.5.x`**
2022-03-23 15:39:34 -04:00
Gary Russell
d23afa2203 RGH-1439: AMQP: Log Warn For Misconfigured Confirm
See https://github.com/spring-projects/spring-amqp/issues/1439

**cherry-pick to 5.5.x*
2022-03-23 15:01:07 -04:00
Spring Builds
f4a45cc4d0 [artifactory-release] Next development version 2022-03-22 22:13:38 +00:00