Commit Graph

10949 Commits

Author SHA1 Message Date
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
Spring Builds
5e95b3a25d [artifactory-release] Release version 6.0.0-M2 2022-03-22 22:13:35 +00:00
Artem Bilan
d643123a41 Revert Derby upgrade: SF is not ready for it yet 2022-03-22 16:54:34 -04:00
Artem Bilan
ed20eb512c Upgrade dependencies; prepare for release 2022-03-22 16:35:49 -04:00
Artem Bilan
d5501d8273 GH-3734: Support MessageHistory on Kafka deser
Fixes https://github.com/spring-projects/spring-integration/issues/3734

The `MessageHistory` is not in the trusted packages of the `DefaultKafkaHeaderMapper`
therefore it fails when `MessageHistory.read()` is performed.

* Configure default `DefaultKafkaHeaderMapper` in the `SubscribableKafkaChannel`,
`KafkaInboundGateway`, `KafkaMessageDrivenChannelAdapter` and `KafkaMessageSource`
to also trust packages exposed via `JacksonJsonUtils.DEFAULT_TRUSTED_PACKAGES`
which include a `MessageHistory`, too.

* Verify in some integration Kafka tests to be sure that `MessageHistory` is
deserialized properly in the transferred headers
* Rework some tests to use `@EmbeddedKafka` instead of `@BeforeAll/@AfterAll`

**Cherry-pick to `5.5.x`**
2022-03-22 15:39:00 -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
Artem Bilan
eaa88cdaa0 Upgrade some dependencies from SNAPSHOT to M 2022-03-22 11:25:43 -04:00
Artem Bilan
7f501fabcb Remove usage of obsolete NestedIOException
Related to https://github.com/spring-projects/spring-framework/issues/28198

Replaces its usage with the standard `IOException`
which has supported a root cause since Java 6.
2022-03-18 17:00:55 -04:00
Mikhail Polivakha
c1d29ab385 GH-3732: Fix NPE in Mqttv5PahoMessageDrivenChA
Fixes https://github.com/spring-projects/spring-integration/issues/3732

The `Mqttv5PahoMessageDrivenChannelAdapter` unconditionally tries to (un)subscribe
to/from topics when the `mqqtClient` might not be initialized yet.

* Add `mqqtClient` initialization check before adding or removing topic.
Re-align logic with the `MqttPahoMessageDrivenChannelAdapter`

**Cherry-pick to `5.5.x`**
2022-03-18 14:55:18 -04:00
Artem Bilan
69efbd3585 More Redis fixes for latest Spring Data 2022-03-18 12:44:31 -04:00
Artem Bilan
50cf3b1aa4 Various fixes after upgrades 2022-03-18 12:05:04 -04:00
Artem Bilan
b081992910 Code clean up for XMPP module
* Ugrade to Checkstyle `10.0`
* Migrate XMPP test to JUnit `5`
2022-03-17 11:12:36 -04:00
Florian Schmaus
330dfd03f2 GH-3462: Upgrade to Smack 4.4.5
Fixes https://github.com/spring-projects/spring-integration/issues/3462
2022-03-17 10:22:22 -04:00
Artem Bilan
4484c4da75 Upgrade r2dbc-h2 to 0.9.1; spring retry to 1.3.2 2022-03-16 17:39:02 -04:00
Artem Bilan
50cf364cde Fix kafka tests according latest spring-kafka 2022-03-16 17:21:40 -04:00
Artem Bilan
e434a4625c Cancel subscription for MPS.subscribeToPublisher
The `Flux.takeWhile()` only works if there is data in the `Publisher`
to consume.
We still need to be able to cancel subscription and stop producing even if
there is no data at the moment.

* Change `takeWhile()` to the `doOnSubscribe()` and store `subscription`
in the `volatile` property of the `MessageProducerSupport`
* Cancel such a subscription in the `doStop()` impl
* Propagate `doStop()` to super in the `ZeroMqMessageProducer`
which is only one reactive channel adapter overriding `doStop()`
* Verify in the `ReactiveMessageProducerTests` that subscription is cancelled
for delayed data in the `Publisher`

**Cherry-pick to `5.5.x`**
2022-03-16 14:51:47 -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
Artem Bilan
11c3acdf2c Remove usage of isOnlyLogRecordMetadata
The `ConsumerProperties.isOnlyLogRecordMetadata` has been removed
in Spring for Apache Kafka in favor of `KafkaUtils.setConsumerRecordFormatter()`
2022-03-15 13:48:07 -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
Artem Bilan
ecb9ac3fc3 Fix flaky TcpNioConnectionTests.testCleanup() 2022-03-10 14:04:30 -05:00
Artem Bilan
e3a06e3388 Upgrade to Gradle 7.4.1 2022-03-10 09:47:14 -05:00
Sorie
fdc47684c2 GH-3744: Fix ServerWebSocketContainer.stop()
Fixes https://github.com/spring-projects/spring-integration/issues/3744

The `ServerWebSocketContainer.stop()` accidentally calls `this.handshakeHandler.start()`

**Cherry-pick to `5.5.x`**
2022-03-09 09:54:42 -05:00
Chris Bono
ba8a26f616 GH-3737: Add serialVersionUID to MessageHistory
Fixes https://github.com/spring-projects/spring-integration/issues/3737

* Add an explicit `serialVersionUID` to `MessageHistory` to avoid class version conflicts in the future.

See related GH issue for the workaround

**Cherry-pick to `5.5.x`**
2022-03-08 16:27:20 -05:00
Artem Bilan
5c912b1315 Fix KafkaMessageSource for the latest SK
* Add `mockito-inline` dep to be able to mock `final` classes, e.g. `record`
2022-03-08 16:24:30 -05:00
hogah97323
488831d433 Fix javadoc typo in JdbcMessageHandler 2022-03-08 15:06:58 -05:00
Gary Russell
12f2084ae8 Switch to spring-kafka 3.0.0-SNAPSHOT
- deprecations are temporarily restored there
 - fix deprecation warnings
 - re-enable tests for Windows
2022-03-08 10:10:27 -05:00
Artem Bilan
70587f5e2f Upgrade some deps; fix compatibility with them
* Upgrade to the latest Spring portfolio stack;
fix tests and effected classes
* The move to the latest Micrometer does not affect code base
2022-03-08 10:08:36 -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
Artem Bilan
f6bb91c3dc Fix race conditions in JdbcLockRegDifClientTests
The default `TTL` in the `DefaultLockRepository` is 10 seconds which mislead us
when other client instance has just 100 millis.
So, not-adjusted client spins for expired lock wastefully leading to the
synchronization barriers to fail

**Cherry-pick to `5.4.x`**
2022-02-14 09:55:51 -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
Unseok Kim
291fe34610 GH-3716 Fix wait for init redisMsgListenContainer
Fixes https://github.com/spring-projects/spring-integration/issues/3716

If the `redisMessageListenerContainer` is starting, waiting for it to complete without doing `subscribeUnlock()`

* Introduce `isRunningRedisMessageListenerContainer` state since the `running` in the `RedisMessageListenerContainer` is set in the beginning of the `start()` misleading on the concurrent calls to the `RedisLockRegistry`

**Cherry-pick to `5.5.x`**
2022-02-08 10:08:23 -05:00
Gary Russell
055eadc61f Add TCP Test Diagnostics 2022-02-07 11:25:34 -05:00
Artem Bilan
09ab0af252 Clean up of RMI in the docs 2022-02-04 15:14:49 -05:00
Gary Russell
05e31b9903 Fix @Poller Javadoc
* Fix @Poller Javadoc - `receiveTimeout` was added as a property in 5.1.
* More javadoc polishing.

**cherry-pick to 5.5.x**
2022-02-03 15:29:55 -05:00
Artem Bilan
4799c3b717 GH-3711: Fix HTTP handler for content type header
Fixes https://github.com/spring-projects/spring-integration/issues/3711

The `contentType` header may come with parameter in its media type.

* Fix `AbstractHttpRequestExecutingMessageHandler` to use `equalsTypeAndSubtype()`
ignoring params
* Some other code clean up in the `AbstractHttpRequestExecutingMessageHandler`
* Ensure in the `HttpRequestExecutingMessageHandlerTests.simpleStringKeyStringValueFormData()`
that provided `contentType` header is handled properly
* Fix `HttpProxyScenarioTests.testHttpMultipartProxyScenario()` for mislead multi-part form
handling

**Cherry-pick to `5.5.x`**
2022-02-03 09:41:35 -05:00
Gary Russell
64d5b25a7f GH-3713: Fix Race In Test 2022-02-03 09:22:33 -05:00