Commit Graph

10905 Commits

Author SHA1 Message Date
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
Artem Bilan
2a3dac7ff3 GH-3694: Resolve circular dep in PublisherAnnBPP (#3695)
* GH-3694: Resolve circular dep in PublisherAnnBPP

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

* Move check for `PublisherAnnotationBeanPostProcessor` bean into the
`SmartInitializingSingleton.afterSingletonsInstantiated()` to break a circular dependency revealed
in the `InitializingBean.afterPropertiesSet()`

* * Fix unused import
2021-12-14 14:41:58 -05:00
Artem Bilan
b424cbe171 Quote CONDITION whenever necessary for JDBC
SO: https://stackoverflow.com/questions/70286480/how-can-spring-integration-5-5-x-use-mysql-as-message-store

Turns out the condition word is reserved in many SQL DB vendors, e.g.:
https://dev.mysql.com/doc/refman/8.0/en/keywords.html

* Fix SQL scripts for quoting `CONDITION` column name for
those vendors which have it as a reserved word
* Fix `JdbcMessageStore` to have a `CONDITION` quoted to `""` by default and
replaced to "`" for MySQL
* Add `MySqlContainerTest` to test against MySQL Docker container
* Looks like quoted identifiers work well even if they are not reserved words in the SQL vendor
2021-12-14 14:17:44 -05:00
unseok kim
3c32daa25a GH-3690: Use pub-sub in RedisLockReg for unlocks
Fixes https://github.com/spring-projects/spring-integration/issues/3690

Replace spinLock with pub-sub

rename and add comment

* change remove timing for 'notifyMap'
* use unlink
* remove DUMMY_CALLABLE

* Clean up code style
2021-12-14 12:05:57 -05:00
Artem Bilan
db14faddd1 GH-3688: Fix WS DSL for proper values propagation
Fixes https://github.com/spring-projects/spring-integration/issues/3688

The `WebServiceTemplate` is populated with some defaults from its ctor.
We should rely on the target default template values as much as possible
and don't override them to `null` if end-user doesn't ask about that explicitly

* Fix `BaseWsOutboundGatewaySpec` extensions to populate values to the target gateway
only if they are not null - therefore provided by end-user
* If end-user wants them explicitly `null`, it is better to do that via
externally configured template.
See overloaded variants for DSL: `Ws.marshallingOutboundGateway(WebServiceTemplate)`
and `Ws.simpleOutboundGateway(WebServiceTemplate)`

**Cherry-pick to `5.4.x` & `5.3.x`**
2021-12-13 14:25:11 -05:00
Ruslan Stelmachenko
ad34310707 GH-3683: Always new TX in DefaultLockRepository
Fixes https://github.com/spring-projects/spring-integration/issues/3683

If a transaction is already active while `JdbcLockRegistry` uses
`DefaultLockRepository` to acquire/release a lock, the repository
must execute SQL queries in a separate transaction to prevent
problems with blocking, deadlocking etc.

It also allows to properly follow transaction isolation level that
is set on some methods of `DefaultLockRepository`.

Previously all methods of DefaultLockRepository supported the current
transaction if there are any. Now all methods will always create new
transaction on each call.

* Change tests to be more unit-ish
* Change `@since` for the `DefaultLockRepositoryTests` to `5.3.10`

**Cherry-pick to `5.4.x` & `5.3.x`**
2021-12-07 11:32:25 -05:00
Artem Bilan
8c85fc9957 Add MessageHandlerMethodFactoryCreatingFactoryBean
Rework the logic around `ManagedList` in the `DefaultConfiguringBeanFactoryPostProcessor`
when it registers a `IntegrationContextUtils.MESSAGE_HANDLER_FACTORY_BEAN_NAME` and
`IntegrationContextUtils.LIST_MESSAGE_HANDLER_FACTORY_BEAN_NAME` into a dedicated
`MessageHandlerMethodFactoryCreatingFactoryBean` with pure Java code instead of
`BeanDefinition` burden

* Deprecate `IntegrationContextUtils.DISPOSABLES_BEAN_NAME` constant for
already removed internal bean
* Align JVM args for Gradle with Java 17 on the `6.0` branch
2021-11-29 12:49:29 -05:00
Artem Bilan
a843dae151 Remove Disposables abstraction
* Remove `Disposables` since it is a package protected therefore could not be used outside
* Remove the logic relevant ot the `Disposables` in the `MessagingAnnotationPostProcessor` logic
* Replace a `registerSingleton()` and `initializeBean()` with the proper `registerBeanDefinition()`
and `getBean()` usage.
This way bean are going to be destroyed properly
* Remove `MessagingAnnotationPostProcessorChannelCreationTests` since its mocking logic is too vague
and really covered with many other real tests.
2021-11-22 14:29:43 -05:00
Artem Bilan
d7f925896f Check for Disposables bean before registration
The `MessagingAnnotationPostProcessor` registers a `Disposables` unconditionally.
The `afterPropertiesSet()` maybe called several times, so `IntegrationContextUtils.DISPOSABLES_BEAN_NAME`
registration has to be idempotent.

* Add `if (!this.beanFactory.containsBeanDefinition(IntegrationContextUtils.DISPOSABLES_BEAN_NAME))`
before trying to register `Disposables` bean
2021-11-22 10:20:34 -05:00
Artem Bilan
adb52baa95 Upgrade Dokka plugin to 1.5.30 for Gradle 7.3 2021-11-17 14:43:04 -05:00
Artem Bilan
0ebd076637 Add duplicatesStrategy to prepAsciidocBuild task 2021-11-17 14:19:19 -05:00
Artem Bilan
f298191d94 Fix checksum for Gradle wrapper 2021-11-17 14:10:33 -05:00