Commit Graph

11217 Commits

Author SHA1 Message Date
abilan
30c0ea2791 Fix JPA test XML configs for latest Mockito 2022-12-20 17:52:41 -05:00
abilan
097d3e54b7 Fix mail test XML config for latest Mockito 2022-12-20 17:36:52 -05:00
abilan
5c926e84ba Add missed type="java.lang.Class" to IdRecTests 2022-12-20 17:19:25 -05:00
abilan
aa761b44b4 Fix more test XML configs for latest Mockito 2022-12-20 17:08:34 -05:00
abilan
80115d33b1 Fix more test XML configs for latest Mockito 2022-12-20 16:52:48 -05:00
abilan
cd0b44dff6 Fix ServiceActivatorOnMockitoMockTests-context 2022-12-20 16:47:11 -05:00
abilan
4a4ce22ec3 Fix Cassandra XML configs for latest Mockito 2022-12-20 16:35:33 -05:00
abilan
52d43ea8ed Upgrade dependencies; prepare for release
Fix XML configs for new `Mockito.mock()` factory method
2022-12-20 16:25:06 -05:00
Artem Bilan
49a9b7e314 Obtain observed timers in the Integration Graph (#3967)
* Obtain observed timers in the Integration Graph

The `Observation` populates slightly different Micrometer timer names and their tags

* Fix `MicrometerNodeEnhancer` to search timers in the registry according to the `Observation`
convention if the provided component is observed
* For that purpose expose an `IntegrationManagement.isObserved()` option to check
of component is instrumented with an `Observation`
* Improve the logic in the `IntegrationGraphServer` to delegate into a `Function`
to call `micrometerEnhancer.enhance()` instead of `static` property which might not
be OK in the environment where several integration applications are ran in the same JVM

* * Collect times into graph for inbound gateways & producers

* Fix language in javadoc of new `IntegrationManagement.isObserved()`

* Add `@Nullable` to `MicrometerNodeEnhancer.buildTimerStats()` param to satisfy this method contract

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-12-20 11:46:48 -05:00
Artem Bilan
d38e0d8720 GH-3962: Support SFTP < v5 for rename (#3964)
* GH-3962: Support SFTP < v5 for rename

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

Turns out the `SftpClient.CopyMode` options are supported only starting SFTP v5

* Check for the version from the client and fallback to the logic we had before with JSsch:
try to rename, delete existing file if such an exception status is thrown and retry to rename

* * Fix `SftpOutboundTests` with answering an explicit SFTP version for an `SftpClient` mock
2022-12-20 11:46:02 -05:00
abilan
3a743802c0 GH-3974: Fix SftpSession for absolute paths
Fixes https://github.com/spring-projects/spring-integration/issues/3974

* Treat a leading `/` as an indicator of absolute path request in the `SftpSession.doList()`
* Call `sftpClient.canonicalPath()` for path without a leading `/` to resolve it as relative path in the user home
* Add a note in docs for `LS` command
2022-12-16 12:59:07 -05:00
Otto Laitila
7adaaafd40 Replace javadoc mentions of JSch with MINA SSHD
JSch was replaced with MINA SSHD in v6 upgrade.
2022-12-16 10:57:18 -05:00
Artem Bilan
4cd0029579 GH-3954: Fix WebFlux XML config for ambiguity (#3973)
* GH-3954: Fix WebFlux XML config for ambiguity

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

When `web-client` attribute is provided for the WebFlux outbound components configuration via XML,
the `encoding-mode` is silently ignored

* Check for `encoding-mode` attribute presence in the `WebFluxOutboundChannelAdapterParser`
when `web-client` is provided and throw respective exception to reject such a config

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

* * Improve error messages in the `WebFluxOutboundChannelAdapterParser`
2022-12-15 13:05:35 -05:00
abilan
ab1254dcf8 GH-3966: Kafka XML config: Expose more attributes
Fixes https://github.com/spring-projects/spring-integration/issues/3966

Exposed setters in the `KafkaInboundGateway` and `KafkaMessageDrivenChannelAdapter`
as an XML attributes for `kafka` namespace

**Cherry-pick to `5.5.x`**
2022-12-12 16:00:40 -05:00
abilan
1c836f0698 GH-3969: SFTP: Bring back support for empty path
Fixes https://github.com/spring-projects/spring-integration/issues/3969

In previous version for SFTP client (Jsch), the empty path for `LS` command
has meant a `user home`.
Turns out the MINA `SftpClient` does not support automatic user home resolution
from the empty path.

* Fix `SftpSession` to resolve an empty path into a user home via `canicalPath()` operation
2022-12-12 11:43:01 -05:00
Artem Bilan
6fd4fd3dd9 GH-3959: MqttConFailedEvent for normal disconnect (#3961)
* GH-3959: MqttConFailedEvent for normal disconnect

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

The `MqttCallback.disconnected(MqttDisconnectResponse)` in Paho v5 client is also
called when server initiates a disconnection.
In this case that `MqttDisconnectResponse` does not have a `cause` value

* Modify `MqttConnectionFailedEvent` to make a `cause` property optional
* Fix `Mqttv5PahoMessageDrivenChannelAdapter` & `Mqttv5PahoMessageHandler`
to not check for `cause`, but emit an `MqttConnectionFailedEvent` for any `disconnected()` calls

Unfortunately current Paho v3 client does not call `connectionLost()` for normal disconnections
and we cannot react for this callback with an `MqttConnectionFailedEvent`

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

* Fix language in doc

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-12-07 08:56:40 -05:00
abilan
a1e4827bbe More percentages increase in DelayerUsageTests
Even `20` is not enough:
https://build.spring.io/browse/INT-MAIN-521/
2022-12-05 11:29:28 -05:00
abilan
03825c5625 Increase percentage in DelayerUsageTests
Turns out CI may be slow enough to catch in time, so increase percentage to `20`
for delays in async tasks
2022-12-05 10:37:35 -05:00
abilan
6888f96145 Some ZeroMQ tests clean up
* Destroy proxies in the end of tests initiating removal for their internal executors
* Use `@Qualifier("subPubZeroMqProxy")` in the `ZeroMqDslTests.ContextConfiguration` to avoid
warning about deprecated `LocalVariableTableParameterNameDiscoverer`
2022-12-01 16:21:17 -05:00
abilan
91c6e16945 Improve DelayerUsageTests
The time-based tests are very sensitive to an activity on the target machine.
So, strict test sometimes fail.

* Fix `DelayerUsageTests` to deal with approximate values to compare by some percentage
2022-12-01 14:46:09 -05:00
abilan
66ca0743ed Fix deprecation for RetryListenerSupport
Related to https://github.com/spring-projects/spring-retry/pull/326
2022-12-01 12:24:11 -05:00
mths1
4206c41a93 GH-3955: Mqtt adapter unsubscribe when cleanStart
Fixes https://github.com/spring-projects/spring-integration/issues/3955

`Mqttv5PahoMessageDrivenChannelAdapter` unsubscribes from all topics, even if `cleanStart/cleanSession` is set to `false`, thus not receiving offline messages after restart.

* unsubscribe `Mqttv5PahoMessageDrivenChannelAdapter` only when `cleanStart`
* add tests

**Cherry-pick to `5.5.x`**
2022-12-01 11:36:23 -05:00
abilan
532f323313 Move Spring dependencies to SNAPSHOTs
* Use a `DefaultParameterNameDiscoverer` instead of deprecated `LocalVariableTableParameterNameDiscoverer`
* Fix assertion error message for `@Header` without `name` and with no `-parameters` compiler flag.
* Remove redundant repos for Gradle plugins

Related to: https://stackoverflow.com/questions/74600681/warning-printed-after-migrating-to-spring-boot-3-0-spring-integration-6-0
2022-11-28 15:49:52 -05:00
abilan
dc6f5aa004 GH-3953: Use lazy-load for output channels
Fixes https://github.com/spring-projects/spring-integration/issues/3953

The replying `MessageHandler` can resolve the target output channel in on-demand manner.
A new messaging annotations on `@Bean` parsing algorithm is missing the lazy-load
opportunity and uses a `RuntimeBeanReference` for output channel options
loading its bean eagerly.

* Fix `AbstractMethodAnnotationPostProcessor` to use a `outputChannelName` and
`defaultOutputChannelName` target properties for channel names to set.
2022-11-28 14:48:54 -05:00
Chanhyeong Cho
90797aa969 Fix documentation in kafka.adoc
Remove copy/paste artifact from JavaDocs.
2022-11-28 12:17:32 -05:00
Spring Builds
88f6e39cf0 [artifactory-release] Next development version 2022-11-22 14:44:40 +00:00
Spring Builds
5b669da7ca [artifactory-release] Release version 6.0.0 2022-11-22 14:44:36 +00:00
Gary Russell
1c94eaaa41 Upgrade Versions; Prepare for Release 2022-11-22 08:31:30 -05:00
jatinsaxena
ddddd1d0a5 GH-3936: WebFluxMH: Add request attribute support
Fixes https://github.com/spring-projects/spring-integration/issues/3936

I am passing request attributes which is getting used in exchangefilter to influence the flow. This request attribute is of type String as Key and Value as a user defined object.

My expectation is to pass this information in request attributes so that it will eventually available in exchangefilter for further processing but i dont find a way to pass these request attribute in webflux integration.

* Add webclient request attributes into `WebFluxRequestExecutingMessageHandler`
* Improve code style and docs
2022-11-18 16:33:12 -05:00
abilan
91007e6745 Remove nohttp/allowlist.lines since all fixed 2022-11-18 16:10:09 -05:00
abilan
bfb2ca217f Upgrade dependencies including Gradle 2022-11-18 15:47:56 -05:00
Artem Bilan
3c40b01915 Expose more reflection hints (#3951)
* Expose more reflection hints

* Bring back `@Reflective` on `Pausable` - for possible end-user usage
* Add `ReactiveMessageHandler` hint since its method is used reflectively
in the `IntegrationRSocketMessageHandler`
* Add `@Reflective` on the `ServerRSocketMessageHandler.handleConnectionSetup()`
since it is used reflectively for a `registerHandlerMethod()`
* Add `KafkaRuntimeHints` to expose `Pausable` contract on Kafka inbound endpoints
for SpEL invocation via Control Bus
* Document native images support

* Fix language in docs

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-11-18 11:26:46 -05:00
abilan
18a87eaf2a Register Lifecycle methods for AbstractEndpoint
* Also register `Pausable` explicitly and remove its `@Reflective`.
This type is needed for Control Bus SpEL execution, but it might not
be available at runtime because not all endpoints implement it
2022-11-17 13:35:35 -05:00
abilan
264cc3c5f8 Add Lifecylce interface to reflection hints 2022-11-17 09:16:32 -05:00
abilan
7cbea7445d Fix new Sonar smell 2022-11-16 17:08:10 -05:00
abilan
a5f85968eb Add Pausable & ManageableSmartLifecycle for AOT
The `Pausable` & `ManageableSmartLifecycle` types are eligible to be used
from Control Bus.
This one is based on SpEL and therefore requires a reflection for those
types to be available in native image
2022-11-16 16:30:19 -05:00
Artem Bilan
508fb167df GH-3555: Change logger order for errorChannel (#3949)
* GH-3555: Change logger order for errorChannel

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

The default global `errorChannel` has a `LoggingHandler` as a subscriber.
It is subscribed without any `order` which may lose logging messages,
when another subscriber with re-throw is present.

* Set default `LoggingHandler` on the default `errorChannel` to `Ordered.LOWEST_PRECEDENCE - 100`
to give a room for custom subscribers without an `order` and still get error logged

* Add extra note in docs about an order for custom subcribers

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-11-16 15:10:26 -05:00
Artem Bilan
e9257958fe GH-3946: Revise Router channelKeyFallback option (#3948)
* GH-3946: Revise Router channelKeyFallback option

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

The `AbstractMappingMessageRouter` has both `resolutionRequired` and `channelKeyFallback`
as `true` by default.
End-users expects them to back off when they set a `defaultOutputChannel`.
They really want something similar to Java `switch` statement

* Change the logic in the `AbstractMappingMessageRouter` to reset `channelKeyFallback`
to `false` when `defaultOutputChannel` to avoid attempts to resolve channel from name,
but rather fallback to `defaultOutputChannel` as it states from th mentioned
Java `switch` statement experience
* Deprecate `RouterSpec.noChannelKeyFallback()` in favor of newly introduced `channelKeyFallback(boolean)`
* Call `channelKeyFallback(false)` from an overloaded `defaultOutputToParentFlow()`
to reflect the mentioned expected behavior in Java DSL as well.
* Respectively, deprecate `KotlinRouterSpec.noChannelKeyFallback()` wrapper
in favor of newly introduced `channelKeyFallback(channelKeyFallback: Boolean)`
* Remove redundant already `noChannelKeyFallback()` option in the `NoFallbackAllowedTests`
* Document the change and new behavior

* Fix `IntegrationGraphServerTests` to `setChannelKeyFallback(true)` explicitly

* Remove not relevant `default-output-channel` from the `DynamicRouterTests-context.xml`

* Reject an `AbstractMappingMessageRouter` configuration where `defaultOutputChannel` is provided
and both `channelKeyFallback` & `resolutionRequired` are set to `true`.
Such a state makes `defaultOutputChannel` as not reachable and may cause some confusions in target
applications.

* Remove `&` symbol from JavaDocs

* Fix `boolean` expression for `AbstractMappingMessageRouter` configuration check

* Fix `IntegrationGraphServerTests` for new router behavior

* Improve language in docs
2022-11-16 14:19:26 -05:00
abilan
60ba5444e7 GatewayProxyInitAotProcess: remove unused import 2022-11-16 12:05:44 -05:00
abilan
cece9afbf2 Fix GatewayProxyInitAotProcessor for proper type
The `GatewayProxyInitializationAotProcessor` uses mistakenly a `ProxyFactoryBean` type
instead of an expected `GatewayProxyFactoryBean`.
Looks like we don't need to scan for interfaces since they are properly transformed
to the `AnnotationGatewayProxyFactoryBean` bean definition during AOT phase
2022-11-16 11:51:11 -05:00
Artem Bilan
2f1c202c20 GH-3945: Fix not eligible for getting processed (#3947)
* GH-3945: Fix `not eligible for getting processed`

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

The `IntegrationManagementConfiguration` produces an `IntegrationManagementConfigurer` which is a `BeanPostProcessor`.
According to Spring recommendation this kind of infrastructure beans must be declared as `static`.
Due to an `implements ImportAware, EnvironmentAware` nature of the `IntegrationManagementConfiguration`,
we cannot use `static @Bean` method.
But since the `IntegrationManagementConfiguration` is not involved in any bean post-processing,
it is safe to follow recommendation and mark it as a `@Role(BeanDefinition.ROLE_INFRASTRUCTURE)`.

* Fix `MessagePublishingInterceptor` to initialize `MessagingTemplate` and `DestinationResolver` lazily
* Fix `AbstractMethodAnnotationPostProcessor` to initialize `DestinationResolver` lazily

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

* * Use `getChannelResolver()` internally in the `AbstractMethodAnnotationPostProcessor`
instead of direct property access which might not be initialized yet
* Use a plain `boolean` for `templateInitialized` in the `MessagePublishingInterceptor`
to avoid skips in other thread where and move on with still not initialized properties

* * Remove unused import

* * Fix `this.` prefix for `beanFactory` property reference
2022-11-15 14:47:46 -05:00
Gary Russell
77a752934d Improve Kafka Exception Message
- when we can't determine reply topic
2022-11-15 14:41:39 -05:00
Artem Bilan
88e259ccf2 Add observation for message channels (#3944)
* Add observation for message channels

* Add observation for message channels

The `MessageChannel.send()` is, essentially, only the point in Spring Integration where we produce a message
and can emit a `PRODUCER` kind span.

* Implement `IntegrationObservation.PRODUCER` infrastructure based on the `MessageSenderContext`
* Implement an observation emission in the `AbstractMessageChannel` based on the mentioned `IntegrationObservation.PRODUCER`
* Build a `MutableMessage.of(message)` to be able to modify message header in the `MessageSenderContext` via tracer `Propagator`
or other tracing injection instrument
* Document which components are instrumented with an `ObservationRegistry`

* Fix language in docs

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-11-15 14:11:12 -05:00
abilan
4d2a4cad76 Fix GatewayProxyInstPProc for AOT expectations
Turns out the AOT engine deals only with indexed constructor arguments for bean definition

* Rework `GatewayProxyInstantiationPostProcessor.processAheadOfTime()`
to populate a service interface type as an indexed ctor argument instead of generic one
2022-11-15 13:33:53 -05:00
Gary Russell
e19e6d4726 GH-3942: Fix Race in Kafka OB Gateway
Resolves https://github.com/spring-projects/spring-integration/issues/3942

When determining the default reply-to topic/partition, we need to wait for assignment.

Already covered by `KafkaDslTests` (a recent build failure exposed this problem).

**No back-port - 5.5.x uses 2.7.x by default, which does not support this.**

5.5.x users can call `waitForAssignment` on the `ReplyingKafkaTemplate` that is
supplied to the gateways before sending messages.
2022-11-15 08:39:54 -05:00
abilan
2895a1eda9 Revert Spring WS BOM 2022-11-15 08:36:17 -05:00
Artem Bilan
da9660a7ae GH-3846: Document Hazelcast module (#3941)
* GH-3846: Document Hazelcast module

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

* Fix language in docs

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

Co-authored-by: Gary Russell <grussell@vmware.com>
2022-11-14 16:28:51 -05:00
Gary Russell
73ba4485a1 Fix Author Typo 2022-11-14 15:19:31 -05:00
abilan
e3ec94b230 Optimize DefaultFileNameGenerator for expression
The default expression in the `DefaultFileNameGenerator`
is based on a message header which simply can be retrieved
with much faster `FunctionExpression`

* Some other code style refactoring in the `DefaultFileNameGenerator`
2022-11-14 12:26:35 -05:00
abilan
ece3198ee9 Upgrade to MongoDB driver 4.8.0-rc0 2022-11-14 11:15:07 -05:00