Commit Graph

1260 Commits

Author SHA1 Message Date
Artem Bilan
e0f137905a Fix compatibility with the latest SF
* Mostly changes are related to the `TaskScheduler` and `Trigger` APIs
* Migrate to `micrometer-tracing` dependency
* Rework `SocketTestUtils` to use a `InetAddress.getLocalHost()`
for more stability and performance on Windows
* Fix docs for new `PeriodicTrigger` API
2022-07-08 17:36:15 -04:00
Artem Bilan
bb91fd3cb3 Some documentations clean up 2022-07-05 16:12:16 -04:00
Artem Vozhdayenko
53dd050c5b GH-3623: Deprecarte an IntegrationFlows
Fixes https://github.com/spring-projects/spring-integration/issues/3623

* `IntegrationFlow` refactoring
* Apply several code style improvements and good practices
* Code style: no empty lines for methods javadocs
* make deprecated implementation reuse actual one instead of the copy-paste approach
* add whats-new comments
* Fix whats-new page according to standards
2022-07-05 15:47:30 -04:00
Artem Bilan
04c7a87bd9 Use lookupHost = false by default for TCP & UDP (#3825)
* Use `lookupHost = false` by default for TCP & UDP

The applications these days more and more are deployed and managed in the containers
where DNS is not configured by default.
Having `lookupHost = true` by default leads to a bad experience when some delays happen
for reverse host lookups.

* Use `lookupHost = false` by default for both TCP & UDP to have a reliable behavior
independently of the environment.
The `hostName` is used for `connectionId` and as a header in the message -
semantically it doesn't matter for the application logic what value is present over there.

* * Fix language in docs

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-06-22 13:23:03 -04:00
Lucas Bowler
8cf5f9083b GH-3822: Reconnection for MQTTv5 channel adapters
Fixes: https://github.com/spring-projects/spring-integration/issues/3822

* Apply spring-framework code style on modified class
* Remove unwanted formatting
* Take pull request comments into account
* Code and JavaDocs clean up
* Improve `Mqttv5BackToBackAutomaticReconnectTests` removing non-related code
* Improve `mqtt.adoc` for this new manual reconnection feature

**Cherry-pick to `5.5.x`**
2022-06-17 14:06:04 -04:00
unseok kim
cf6ce961a2 GH-3805: Introduce RedisLockRegistry.RedisLockType mode
Fixes https://github.com/spring-projects/spring-integration/issues/3805

The Redis Pub-Sub doesn't work in all the environment, therefore there has to
be a choice to use old busy-spin algorithm

* Change to select between spinLock method and pub-sub method
* Make spinLock as a default one to let the `RedisLockRegistry` work everywhere
* Fix javadoc, convention, lazy init
* Fix javadoc, convention
* Code clean up and docs for `RedisLockType` feature

**Cherry-pick to 5.5.x**
2022-06-08 13:15:30 -04:00
Artem Bilan
e855f13d8e GH-3797: Improve batch processing in the framework (#3820)
* GH-3797: Improve batch processing in the framework

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

* Handle `Message` items of the `Iterable` payload properly in the `JdbcMessageHandler`.
Otherwise, they've been wrapped into an extra `Message`
* Produce a single message with a `Collection<Message<?>>` payload in the `AggregatingMessageHandler`
when the `getOutputProcessor()` is not an instance of `SimpleMessageGroupProcessor`
* Mention these changes in docs
* Point to the error handling sample from docs

* * Fix language in docs

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-06-07 10:14:53 -04:00
Gregory Bragg
7174e8840b Add XSD for new SMB components
* Add namespace handler support for new XSD configs
* Add JUnit tests for outbound gateway XML config
* Add JUnit tests for streaming inbound adapter XML config
* Add Javadoc to new parser classes as per PR feedback
* Some code clean up
2022-05-31 13:32:44 -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
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
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
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
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
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
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
0154618182 Fix configuration doc sections id ambiguity 2022-05-04 14:01:00 -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
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
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
bba83c7231 GH-3735: Don't mutate FeedEntryMS metadataKey
Fixes https://github.com/spring-projects/spring-integration/issues/3735

The `FeedEntryMessageSource` adds an url to the provided `metadataKey`
making it incompatible when we provide a `Resource`-based configuration.

* Remove adding of the url to the `metadataKey` making it rely only
on the provided value
* Remove internal `Comparator` for entries in favor of `Comparator.comparing()`
feature
* Improve some internal logic of the `PropertiesPersistingMetadataStore`
when it emits a false warning: cannot create dirs, but they are present
* Improve `feed.adoc`
2022-03-22 15:06:19 -04:00
Artem Bilan
67e0599a26 Add documentation for GraphQL support (#3756)
* Add documentation for GraphQL support

* * Fix to the latest Spring for GraphQL
* Mention in the doc an `ExecutionGraphQlRequest` as a request message payload
2022-03-22 15:05:39 -04:00
Gary Russell
0550380704 GH-3661: Resolve Spring Apache Kafka Deprecations
Resolves https://github.com/spring-projects/spring-integration/issues/3661

* Don't allow existing listener; remove unnecessary try/catch; add what's new.
* Fix link in whats-new.adoc
2022-03-16 14:46:10 -04:00
Chris Bono
f3d3694836 GH-3506: No array for poller messaging anns attr
Fixes https://github.com/spring-projects/spring-integration/issues/3506

Revise the `@Poller` usage in the messaging annotations from an array value
to a single entry with a `ValueConstants.DEFAULT_NONE` for default value

Code review feedback

- Make annotation utils check for NONE more generic
- Move docs to whats-new.adoc
- Polish javadoc

Code review feedback
- simplify docs
- simplify isProvided checks
2022-03-10 14:07:55 -05:00
Daniel Frey
f09c665db4 GH-3501: Add GraphQL support
Fixes https://github.com/spring-projects/spring-integration/issues/3501

* make current with latest changes in 'spring-graphql'
* fix checkstyle issues
* implement reactive endpoint for GraphQL Query
* refactor to handle GraphQL Query and Mutation requests
* refactor to handle GraphQL Subscription requests
* implement expressions to handle for various RequestInput parameters
* convert classes to records in tests, remove unneeded datatype modifiers on channels
* replace executionId with idExpression SpEL evaluator
* adjust name and default expression for executionId
* rename for consistency, remove unneeded null check
* Clean up code style
* Remove redundant variables
* Add `What's New` entry
* Add `package-info.java`
2022-02-17 15:41:30 -05:00
Artem Bilan
c661d7925e Remove SocketUtils usage
* Remove usage of non-stable `org.springframework.util.SocketUtils`
* Replace it with `0` for those tests where it is possible to select OS port
* Remove the mentioning of the `SocketUtils` from the `testing.adoc`
* Use `TransportConstants.DEFAULT_STOMP_PORT` for `StompServerIntegrationTests`.
We may disable this test in the future for CI if it is not going to be stable
* Introduce `Supplier<String> connectUrl` variants for `ZeroMqMessageHandler`
to let it defer connection evaluation until subscription to the socket `Mono`
in the `ZeroMqMessageHandler`.
* Move connection logic in the `ZeroMqMessageHandler` to `Lifecycle.start()`

Related to https://github.com/spring-projects/spring-framework/issues/28054

**Cherry-pick to `5.4.x`**
2022-02-16 09:10:08 -05:00
Artem Bilan
9ac0b65c77 Fix some typos and language in docs
* Mostly driver by suggestions from IDEA language plugin
* Add Maven-Gradle code switch for dependency in the modules
2022-02-15 13:00:24 -05:00
Dominic Stew
285c380ffa Add example to Spring Integration with Reactive Streams
* Add outbound channel adapter example

* Add an example for the `CustomReactiveMessageHandler` usage

* Emphasize that the examples are for Reactive Streams

* Fix a missing letter that caused the text to get inside the code block

* Emphasize that the first example is an event driven inbound channel adapter

* Fix a redundant question mark from the example code
2022-02-14 17:09:46 -05:00
Toshiaki Maki
b3822c298c Fix applySequence example in the doc 2022-02-10 14:40:56 -05:00
Almog Tavor
cd0d03ef81 Fix sentence error in the overview.adoc
Fix a mistake in a sentence about EIP components and `BeanPostProcessor`
2022-02-08 19:06:45 -05:00
Artem Bilan
09ab0af252 Clean up of RMI in the docs 2022-02-04 15:14:49 -05:00
Artem Bilan
b3ae24eac6 Fixes according latest upgrades
* Add `--add-opens` to `asciidoctor` Gradle task to avoid compilation warning
* Upgrade to Kotlin `1.6.10` and modify its Gradle task respective
* Add empty impl for new `AnnotationMetadataAdapter.getDeclaredMethods()`
* Parse HTTP methods to new `String methodNames` property of the `RequestMapping`
since `HttpMethod` is not an `enum` anymore.
* Ignore JDBC tests which rely on a map property resolution: the `[]` placeholder
is not handled in the latest SF anymore.
* Fix `WebFluxInboundEndpoint` for deprecations
2022-01-18 14:38:53 -05:00
Artem Bilan
a80b22638d Start 6.0 version
* Upgrade to Java 17, SF-6.0, Gradle 7.2
* Upgrade to Jakarta dependencies and respective namespaces
* Fix some tests for Java 17 compatibility
* Fix wrong Javadocs
* Add some missed Javadocs
* Fix more `jakarta` namespace
* Fix WS & XML modules to use Jakarta EE
* `--add-opens` in some modules for their reflection-based tests
* Disable Kafka tests which does not work on Windows; see Apache Kafka `3.0.1`
* Upgrade to JUnit `5.8.1`
* Migrate JMS tests to Artemis
* Remove RMI module as it was deprecated before
* Fix `pr-build-workflow.yml` for Java 17
* Fix JavaDocs warnings using `Xdoclint:syntax` per module, not in the top-level `api` task
* Move docs for version `6.0`
2022-01-18 14:38:50 -05:00
Mini256
9ff2707b75 Fix variable name typo in the redis.adoc 2022-01-03 09:50:45 -05:00
Artem Bilan
8c57cb7869 GH-3697: Various lifecycle fixed for MQTT v5 CAs
Fixes https://github.com/spring-projects/spring-integration/issues/3697
SO: https://stackoverflow.com/questions/70374046/spring-integration-mqtt-failed-to-start-app-when-the-network-is-disconnected

* Add `mqttClient.disconnect()` to `Mqttv5PahoMessageDrivenChannelAdapter.doStop()` - the `doStart()` does `connect()`
* Add `Mqttv5PahoMessageDrivenChannelAdapter.destroy()` impl to close `mqttClient`
* Fix `Mqttv5PahoMessageHandler.doStart()` to not re-throw an exception on connection.
Emit an `MqttConnectionFailedEvent` and log error instead
* Fix `Mqttv5PahoMessageHandler.destroy()` to call `mqttClient.close(true)` for better resources clean up
* Improve MQTT v5 components Javadocs and add a reconnect note into `mqtt.adoc`
2021-12-16 13:36:02 -05:00
Artem Bilan
de0f91b777 GH-3677: Doc for URL conn customization in FeedCA (#3678)
* GH-3677: Doc for URL conn customization in FeedCA

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

If there is need to have a `URLConnection` customized, the `UrlResource`
has to be used instead of plain `URL` injection into the `FeedEntryMessageSource`

* * Add a sample to docs for connection customization
2021-11-16 12:21:17 -05:00
Artem Bilan
3dabf7aec1 Fix Checkstyle violations
* Make version block for dependencies as code-switcher in the XML, ZeroMQ and Zookeeper docs
2021-11-15 12:21:52 -05:00
Artem Bilan
6f3fdc76c1 Some docs clean up 2021-11-15 10:00:14 -05:00
Unseok Kim
db611028da GH-3672: Clean up Jdbc & ZK LockRegistry caches
Fixes https://github.com/spring-projects/spring-integration/issues/3672

* Clean up `JdbcLockRegistry`, `ZookeeperLockRegistry` cache automatically 
* setCapacity(int capacity) to cacheCapacity(int capacity)
* field rename `capacity`to `cacheCapacity`, add static
2021-11-11 16:36:27 -05:00
unseok kim
e51513230a GH-3655: Add automatically delete for Redis Locks
Fixes https://github.com/spring-projects/spring-integration/issues/3655

* support automatically clean up cache
* RedisLockRegistry.capacity desc
2021-11-10 14:24:53 -05:00
Artem Bilan
eb4d583a17 Add toReactivePublisher(autoStartOnSubscribe) (#3657)
* Add `toReactivePublisher(autoStartOnSubscribe)`

The `IntegrationFlowBuilder.toReactivePublisher()` returns a `Publisher<Message<?>>`
which may be subscribed somewhere late in the application logic, e.g.
when WebSocket (or RSocket) subscription is initiated by the external client.
In between application context startup and that subscription moment, the `IntegrationFlow`
must not try to produce messages since there is nothing to consumer them from the
`Publisher<Message<?>>` side.
One of the way is to have a source endpoint not started automatically and control its
lifecycle from the point fo reactive subscription

* Introduce an `IntegrationFlowBuilder.toReactivePublisher(boolean autoStartOnSubscribe)`
to let the framework do a job for an `IntegrationFlow` lifecycle control.
This way end-user doesn't need to know autowire a starting endpoint and use `doOnSubscribe()`
and similar callbacks
* Change `ConsumerEndpointFactoryBean` log message about a `FixedSubscriberChannel`
to `INFO` since an `autoStartup = false` really does not have any effect and there is nothing
for end-user to worry about.
The `IntegrationFlow` knows nothing about each endpoint internals and cannot control which
mark as `autoStartup = false` and which not

* Fix languge in JavaDocs

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2021-11-01 16:49:59 -04:00
Artem Bilan
7d29cf7f02 Fix double the typo in docs 2021-10-21 14:17:35 -04:00
Artem Bilan
78366e7b00 GH-3647: Use remoteDirExpression in MV command (#3651)
* GH-3647: Use remoteDirExpression in MV command

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

To simplify a source and renameTo remote file expressions, the `remoteDirectoryExpression`
is consulted now, when they are not full paths.
This is useful when we want just to rename a remote file in some dir

* * Add JavaDoc for `getDirectoryExpressionProcessor()`
* Fix language in docs
2021-10-21 14:12:50 -04:00
Gary Russell
e84bab6e0a GH-3648: Fix @Gateway.payloadExpression
Resolves https://github.com/spring-projects/spring-integration/issues/3648

When configuring a gateway proxy with XML, but specifying the payload expression
on the method `@Gateway` annotation, the expression was ignored, even though it
had been parsed.

`@Payload` worked.

With this change, if both `@Payload` and `@Gateway` are defined on a gateway method,
`@Gateway.payloadExpression` wins.

* Fix doc links.
2021-10-20 15:09:29 -04:00