Commit Graph

10916 Commits

Author SHA1 Message Date
Artem Bilan
81f5b6bbbd Fix JacksonJsonUtils for Java 8 compatibility 2022-03-24 13:08:27 -04:00
Artem Bilan
dfaf5001fe 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:40:00 -04:00
Gary Russell
343be47c04 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:52 -04:00
Spring Builds
f9dada39b7 [artifactory-release] Next development version 2022-03-22 21:08:42 +00:00
Spring Builds
e14ac321b9 [artifactory-release] Release version 5.5.10 2022-03-22 21:08:39 +00:00
Artem Bilan
eec3e956fe 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 16:02:08 -04:00
Artem Bilan
675b3b4930 Upgrade dependencies; prepare for release 2022-03-22 14:52:15 -04:00
Mikhail Polivakha
4bf606a085 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:56:25 -04:00
Artem Bilan
575584d2aa Fix Checkstyle violation from the previous commit 2022-03-16 15:25:10 -04:00
Artem Bilan
5e0e620351 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:52:33 -04:00
Gary Russell
30a2f18551 GH-2750: Deprecate container spec errorHandler
Resolves https://github.com/spring-projects/spring-integration/issues/3750

**5.5.x only; removed in 6.0**
2022-03-16 14:50:44 -04:00
Sorie
bbc4e1e9c0 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:55:19 -05:00
Chris Bono
e80c0ab919 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:58 -05:00
Spring Builds
963c05ada3 [artifactory-release] Next development version 2022-02-22 17:51:59 +00:00
Spring Builds
c6f0e1984a [artifactory-release] Release version 5.5.9 2022-02-22 17:51:54 +00:00
Artem Bilan
d79c9fdeda Revert JavaDoc options for Java 11 on CI 2022-02-22 11:43:44 -05:00
Artem Bilan
fb05c73969 Upgrade dependencies; prepare for release
* Rework `FeedInboundChannelAdapterParserTests` for Java 17 compatibility
2022-02-22 10:54:23 -05:00
Artem Bilan
b443605ec6 Upgrade to Gradle 7.3.3 for Java 17 compatibility
To simplify project support, it is better to let
this `5.5.x` branch to be build with Java 17
while keeping the old code style and bytecode
for Java 8 compatibility.
2022-02-16 10:07:46 -05:00
Artem Bilan
9b27fbee89 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.5.x`**

# Conflicts:
#	spring-integration-stomp/src/test/java/org/springframework/integration/stomp/client/StompServerIntegrationTests.java
2022-02-16 10:02:32 -05:00
Artem Bilan
f8c22dd357 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:56:43 -05:00
Almog Tavor
5c23c702e4 Fix sentence error in the overview.adoc
Fix a mistake in a sentence about EIP components and `BeanPostProcessor`
2022-02-08 19:07:39 -05:00
Unseok Kim
6f91929da3 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:09:11 -05:00
Gary Russell
724f335750 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:30:34 -05:00
Artem Bilan
f1407544a2 Don't use pattern matching in instanceof
The pattern matching for `instanceof` is available since Java 16
2022-02-03 10:13:59 -05:00
Artem Bilan
25e763d683 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:42:13 -05:00
Gary Russell
413d66018e GH-3713: Fix Race In Test 2022-02-03 09:24:08 -05:00
Artem Bilan
b9bc10558a ConcurrentHashMap for JdbcMessageStore.queryCache
To avoid a possible `ConcurrentModificationException` it is better to use a
`ConcurrentHashMap` for that `computeIfAbsent()` operation on the cache
2022-02-02 13:00:26 -05:00
Gary Russell
c1aa9b7958 GH-3713: TCP: Fix Intercepted Sender List
Resolves https://github.com/spring-projects/spring-integration/issues/3713

https://github.com/spring-projects/spring-integration/issues/3326 added support
for multiple `TcpSenders`. However, when connections are intercepted, the sender
list was not properly chained through the interceptors.

- override `registerSenders` and properly capture the real senders in the last
  interceptor and intermediate interceptors
- this ensures that `addNewConnection` is called on each interceptor
- when removing dead connections, use the connection sender list insted of the
  factory's raw sender list; detect if the connection is an interceptor and
  call its remove method instead.

**cherry-pick to 5.5.x**
2022-02-02 12:11:54 -05:00
Spring Builds
4423e43cd8 [artifactory-release] Next development version 2022-01-18 18:38:40 +00:00
Spring Builds
182b1cb158 [artifactory-release] Release version 5.5.8 2022-01-18 18:38:37 +00:00
Artem Bilan
6ae6f343c8 Fix typo in the build.gradle 2022-01-18 12:15:54 -05:00
Artem Bilan
b2586241f8 Upgrade dependencies; prepare for release 2022-01-18 12:12:56 -05:00
Artem Bilan
efd073c9e0 Fix typo in StompInboundChannelAdapter JavaDocs
Fixes https://github.com/spring-projects/spring-integration/issues/3710
2022-01-12 09:21:37 -05:00
shvo123
0b38b8df60 GH-3705: Close TcpNioConn.ChannelOutStr.selector
Fixes https://github.com/spring-projects/spring-integration/issues/3705

Closing/destroying `ChannelOutputStream` object does not close the selector therefore it retains redundant pipes/FD that cen be seen using lsof command or ls /proc/

* Close `TcpNioConnection.ChannelOutputStream.selector` in the `ChannelOutputStream`
* Close `TcpNioConnection.ChannelOutputStream` when connection is closed
* Code style clean up

**Cherry-pick to `5.3.x` & `5.4.x`**
2022-01-05 17:02:06 -05:00
Unseok Kim
6c769cab37 GH-3700: Fix Redis lock retry until expiration
Fixes https://github.com/spring-projects/spring-integration/issues/3700

Fixed a case where lock acquisition attempt was abandoned earlier than expected time.
If a vm uses `tryLock()` and another vm unlock it, it will wake up with an unlock message and try to acquire the lock, 
but if it fails(the other vm obtain lock), vm will return false.
2022-01-04 09:16:10 -05:00
Artem Bilan
97a5ea4aca Move IntegrationDsl from .kt to .java
Turns out Eclipse Kotlin plugin is not perfect at the moment,
and it causes some code parsing problems in the editor.

* Move Kotlin annotation to Java to mitigate normal source code flow:
 Java to Kotlin, not opposite
2022-01-03 12:52:05 -05:00
Gary Russell
b47727765d GH-3701: Fix Possible TCP Memory Leak
Resolves https://github.com/spring-projects/spring-integration/issues/3701

Ensure `TcpSender.removeDeadConnection` is always called, for example when
intercepted and closed via `factory.closeConnectionId` or when closed
connections are harvested from the `connections` map.

**Cherry-pick to 5.4.x, 5.3.x**
2022-01-03 12:35:29 -05:00
Mini256
9ff2707b75 Fix variable name typo in the redis.adoc 2022-01-03 09:50:45 -05:00
Artem Bilan
5eb95f6cca More Kotlin DSL improvements 2022-01-03 09:49:22 -05:00
Artem Bilan
9759950d35 GH-3699: Fix typos in the IntegrationFlow javadoc
Fixes https://github.com/spring-projects/spring-integration/issues/3699
2021-12-22 10:16:07 -05:00
Artem Bilan
30622b285c Improve Kotlin DSL
* Add missed factories, introduced recently into Java DSL
* Add `@IntegrationDsl` - a Kotlin-specific `@DslMarker` annotation
to mark classes (including Java) which are used in Kotlin DSL as a builder pattern.
This way the scope of the builder is honored and IDE does not suggest functions from
higher lambda for builder
* Fix `element-list` reference for Dokka plugin configuration from the respective module
2021-12-21 17:21:31 -05:00
Spring Builds
cb8787b724 [artifactory-release] Next development version 2021-12-21 15:30:28 +00:00
Artem Bilan
9741f7fc5f Upgrade dependencies including Gradle
* Fix warnings about doc tasks
2021-12-20 15:02:39 -05:00
Artem Bilan
bb9dd89286 Fix RedisLockRegistry Sonar smells
* Remove redundant `subscribeLock()` method
* Rework `lock()` and `lockInterruptibly()` logic in favor of `while (true) {`
to avoid "empty `while()`" smell
2021-12-16 13:49:15 -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
30bb8467b4 Fix Checkstyle violation 2021-12-14 21:12:41 -05:00
Artem Bilan
2d752894cd Fix UNLINK/DEL logic in the RedisLockRegistry
See review: https://github.com/spring-projects/spring-integration/pull/3691#issuecomment-994124360
2021-12-14 19:50:49 -05:00
Artem Bilan
50fa345402 Fix new Sonar smell 2021-12-14 16:46:58 -05:00
Artem Bilan
c36b7598a7 Add distributionSha256Sum prop for Gradle wrapper 2021-12-14 16:20:48 -05:00
Artem Bilan
9b5ebaad8b Fix MySqlContainerTest for compatibility
* Upgrade Gradle to `7.3.1`
* Upgrade Log4j to `2.16.0`
2021-12-14 14:42:11 -05:00