Commit Graph

9623 Commits

Author SHA1 Message Date
Gary Russell
70c166fbfd INT-4362: MMIH Catch Conversion Exception
JIRA: https://jira.spring.io/browse/INT-4362

INT-4312 added a JSON conversion when there is a single method with a non-String parameter.

Add more tests for parameters of type `Message`.

Catch conversion exceptions and use the message as-is if the conversion fails.
2017-11-13 16:53:40 -05:00
Gary Russell
4207f36a17 INT-4364 Deprecate SocketUtils and remove all use
JIRA: https://jira.spring.io/browse/INT-4364

Always let the OS choose the ports for tests.

Just one test remains (RMI) because there appears to be no way to obtain
the port after creating a registry with a 0 port.

This test has been switched to use the Spring utility.

Polishing - PR Comments
2017-11-13 16:47:42 -05:00
Artem Bilan
8c89d0ef98 Fix QueueChannelSpec.priority hook
* Since we already have `PriorityChannelSpec` that isn't
`QueueChannelSpec` responsibility to worry about `priority` option.
More over it has been done wrongly and `MessageGroupQueue.setPriority()`
has been called unconditionally by the provided `ChannelMessageStore` type

* Fix `PriorityChannelSpec` logic as well:
- set `this.messageGroupQueue.setPriority(true);` to check the state of
the provided `PriorityCapableChannelMessageStore`
- fix assert condition in the `doGet()`

* And simple compiled SpEL test-case for the JDK Proxy
2017-11-13 16:39:07 -05:00
Artem Bilan
a2d0ea5997 Optimise JmsInboundGatewayParserTests
Increase the test performance from 15 seconds to 4
2017-11-13 09:16:19 -05:00
Artem Bilan
f7e75223c7 INT-4361: Add a role() hook to Java DSL
JIRA: https://jira.spring.io/browse/INT-4361

* To get a gain of the method chain code flow and avoid extra annotation
parsing, add `.role(String)` hook to the `EndpointSpec`
* Delegate the provided `role` property to the `AbstractEndpoint`
* Register `AbstractEndpoint` as itself `SmartLifecycle` in the
`SmartLifecycleRoleController`
* Add `destroy()` to the `AbstractEndpoint` and remove it from the
`SmartLifecycleRoleController`
* Provide some Java 8 code style refactoring

* Rework XML parsers and Annotation processors to populate `role`
property on the `AbstractEndpoint`
* Wrap `roleController` bean extraction to the `NoSuchBeanDefinitionException` catch
* Fix several `AbstractEndpoint` implementation to properly call
`super.onInit()` which has been missed before
2017-11-10 13:58:28 -05:00
Artem Bilan
a61327766e GH-2207: Clarify RedisMetadataStore in cluster
Resolves: spring-projects/spring-integration#2207

* Since the `WATCH` command isn't supported on clustered connections,
the `RedisMetadataStore.replace()` operation can't be used there.
Document this limitation
2017-11-10 11:37:47 -05:00
Artem Bilan
6891d5a2e2 INT-4277: Add Java DSL chapter to the Docs
JIRA: https://jira.spring.io/browse/INT-4277

*Mostly migration from the https://github.com/spring-projects/spring-integration-java-dsl/wiki/Spring-Integration-Java-DSL-Reference
* Add cross links from some appropriate chapters
* Fix log message in the `WebSocketInboundChannelAdapter`

* Document `IntegrationFlowContext`
* Document gateways via `IntegrationFlow`
2017-11-10 11:31:48 -05:00
Artem Bilan
37daeae094 INT-4294: CorrelatingMHs: Improve JavaDocs
JIRA: https://jira.spring.io/browse/INT-4294

* Clarify the Aggregator and Resequencer behavior in the `afterRelease()`
implementation.
2017-11-10 11:24:52 -05:00
Artem Bilan
23137fd0cb GH-2275: Fix MqttMDCA for callbacks after stop
Resolves: spring-projects/spring-integration#2275

* Remove the `MqttPahoMessageDrivenChannelAdapter` as a callback from
the `IMqttClient` during `stop()`
* Check the `isRunning()` from the `connectionLost` callback to avoid
unexpected `scheduleReconnect()` when we are not running

**Cherry-pick to 4.3.x**
2017-11-10 10:50:50 -05:00
Artem Bilan
098e8bc58f INT-4291: Post-merge polishing
JIRA: https://jira.spring.io/browse/INT-4291

* Fix code style in the `ExpressionEvaluatingSqlParameterSourceFactory`
* Remove redundant
`ExpressionEvaluatingSqlParameterSourceFactory.registerSqlTypes` in
favor of the direct access to the `sqlParametersTypes` from the
`ExpressionEvaluatingSqlParameterSource` ctor
* Reformat code style in the `pollingWithSelectParameterSourceJdbcInboundChannelAdapterTest.xml`
* Fix code style in the `ExpressionEvaluatingSqlParameterSourceFactoryTests`
* Polishing `whats-new.adoc` for proper formatting and single link from
the section to the particular chapter
* Fix formatting and wording in the `jdbc.adoc`
2017-11-06 11:33:05 -05:00
Meherzad Lahewala
854dba1366 INT-4291 Add ExprEvalSqlPSF.setSqlParameterTypes
JIRA: https://jira.spring.io/browse/INT-4291

* Fix checkstyle trailing space
*Use correct way to constants in spring xml and fix test case

* Polishing - Update javadoc and rename method name to relate more to the behavior
2017-11-06 11:19:01 -05:00
Artem Bilan
d76af8c2aa Fix HTTP module for proper RFC date formats
* Copy data format algorithm from the Spring Web `HttpHeaders` into the
`DefaultHttpHeaderMapper`
* Fix `HttpProxyScenarioTests` for proper zoned date formatting
2017-11-02 10:01:35 -04:00
Spring Buildmaster
d9f7efe9c9 [artifactory-release] Next development version 2017-10-31 18:42:41 +00:00
Spring Buildmaster
77ad887a4d [artifactory-release] Release version 5.0.0.RC1 2017-10-31 18:42:33 +00:00
Artem Bilan
8766262399 INT-4360: Add ClientStompEncoder support
The `StompSubProtocolHandler` explicitly sets `stompCommand` header
to the `MESSAGE` value ignoring any client inputs.
In this case the message is treated as from the server and ignored on
the STOMP Broker side from the client session.

* Introduce `ClientStompEncoder` for the client side to be injected
into the `StompSubProtocolHandler` for the proper client side messages
encoding/decoding.
Override `stompCommand` header to the `SEND` value if it is `MESSAGE`
before encoding to the `byte[]` to send to the session

JIRA: https://jira.spring.io/browse/INT-4360

**Cherry-pick to 4.3.x**

Fix WebSocket test to rely on the proper client config class
and don't pick up the server config unconditionally in the test context
2017-10-31 09:25:52 -04:00
Artem Bilan
2712e28074 Upgrade to Spring Security 5.0.0.RC1
Remove usage of deprecated `NoOpPasswordEncoder` in favor of
`User.withDefaultPasswordEncoder()` in tests
2017-10-30 20:54:40 -04:00
Gary Russell
56de7149c3 INT-4314: MutableMessageBuilder Javadocs
JIRA: https://jira.spring.io/browse/INT-4314
2017-10-30 14:44:18 -04:00
Artem Bilan
f35aa13636 Upgrade to S-WS-3.0.0.RELEASE 2017-10-30 14:35:41 -04:00
Gary Russell
06aa45e91f INT-4279: Document UDP Java Configuration
JIRA: https://jira.spring.io/browse/INT-4279

Add documentation for Java configuration of UDP channel adapters.
Enhance DSL to support host/port for outbound adapters.
2017-10-30 13:49:44 -04:00
Artem Bilan
6d96914c1f INT-4350: Handle ResponseEntity in HTTP Inbounds
JIRA: https://jira.spring.io/browse/INT-4350

Spring MVC and Spring WebFlux handles `ResponseEntity` via appropriate
`ReturnValue` handlers.
This way all the headers and status code are fully up to end-user.
The body is handled by the appropriate converter/writer as before

* Add `ResponseEntity` handling to the `HttpRequestHandlingMessagingGateway`
and `WebFluxInboundEndpoint`.
The logic mostly compy/pasted from the `ResponseEntityResultHandler`
2017-10-30 12:05:25 -04:00
Artem Bilan
008a740fb0 Add option for MutableMB to not generate headers
Since `MutableMessage` can be mutated, the `ID` and `TIMESTAMP` headers
can be added lately.
Or there might be some scenarios which don't care about those headers at
all.
Plus we get a performance gain when we skip their generation

Coerce the `null` cast to the proper target ctor
2017-10-30 11:57:23 -04:00
Artem Bilan
7eea071b4e Polishing for SearchReceivingMSWithRedisTests
* Add `Log4jLevelAdjuster` for future diagnostics

Rebase and fix unused imports
2017-10-30 11:44:08 -04:00
Artem Bilan
c65584a007 INT-4349: Allow Number type for int headers
JIRA: https://jira.spring.io/browse/INT-4349

When headers come from the external system there is no guarantee
that special headers (e.g. `sequenceNumber`, `priority` etc.) in the
expected (`Integer`) type.

* Widen `int` headers setting value to the `Number` type
* Return primitive `int` for the `sequenceNumber` and `sequenceSize`
headers since for them `IntegrationMessageHeaderAccessor` never return
null for them
* Remove `SequenceNumberComparator` in favor of `MessageSequenceComparator`
since they are essentially duplicate each other
* Fix tests to deal with primitive `int` already
2017-10-30 11:34:34 -04:00
Artem Bilan
e6225926c4 Some Java DSL improvements
* Register `BeanDefinition`s for DSL components.
That way we get a gain when the `BeanDefinition` is involved,
e.g. Spring Cloud Function uses this approach to determine the generics
of the target `Function` class
* This programmatic `BeanDefinition` registration approach
(available since SF-5.0) allows us to avoid some manual lifecycle processes:
bean initialization, autowiring, event listener registration etc.
* Rework `IntegrationFlowContext` to register and remove `BeanDefinition`s as well
* Remove unused `registerComponents`  flag from the `StandardIntegrationFlow`.
With the proper logic in the `IntegrationFlowContext` it does not make sense any more
* Remove redundant `AnnotationGatewayProxyFactoryBean` in the `IntegrationFlows`;
populate `defaultRequestChannel` directly to the `GatewayProxyFactoryBean` instance
* Add an overloaded `IntegrationFlows.from(Class, String)` to allow to specify an
explicit bean name for the target gateway proxy
* Extract and populate bean name from the `@MessagingGateway.name()` in the
`AnnotationGatewayProxyFactoryBean`
* Stop lifecycles in the `AmqpTests` after using for proper test suit shutdown
2017-10-30 11:27:59 -04:00
Artem Bilan
b69bbdc43b INT-4358: Avoid blocking WebFlux response parsing
JIRA: https://jira.spring.io/browse/INT-4358

* Parse response in the `WebFluxRequestExecutingMessageHandler`
in reactive, on demand manner.
* Add protected for empty response body in case of error
2017-10-25 14:21:11 -04:00
Artem Bilan
efb8f04465 Some upgrades and fixes
* Upgrade to SF-5.0.1, Reactor-3.1.1, some other minor upgrades
* Fix `HttpDslTests` and `WebFluxDslTests` for the latest SS compatibility
* Fix JavaDoc in the `ChannelMessageStorePreparedStatementSetter`
2017-10-25 10:52:47 -04:00
Artem Bilan
df109410c3 Fix AbstractStompSessionManager race condition
https://build.spring.io/browse/INT-MJATS41-1150

When we add `addHandler()` to the `CompositeStompSessionHandler`,
there is no guarantee that we will have `session` atomically during
this method invocation or after it relying on the later call to the
`this.delegates`.
In other words the session may be populated in between and, therefore,
our `delegate` loses `afterConnected()` event.
We need to synchronize on the barrier and block the concurrent
`afterConnected()` or wait for it.
This way we atomically ensure that our `delegate` is added to the
existing `session` or will be performed afterwards in the `afterConnected()`

**Cherry-pick to 4.3.x**
2017-10-23 13:45:05 -04:00
Artem Bilan
d7d56a0444 INT-4081: Post-merge polishing and improvements
JIRA: https://jira.spring.io/browse/INT-4081

* Rename `MessageGroupPreparedStatementSetter` to `ChannelMessageStorePreparedStatementSetter`
* Add JavaDocs to the `ChannelMessageStorePreparedStatementSetter`
* Polishing `JdbcChannelMessageStore` JavaDocs; remove unused `BeanFactory`
* Polishing Docs for typos and proper text flow
2017-10-23 11:48:35 -04:00
Meherzad Lahewala
34d0859515 INT-4081: Custom PreparedStSetter for JdbcMChStore
JIRA: https://jira.spring.io/browse/INT-4081

* Add `MessageGroupPreparedStatementSetter` to let end-user to override
the message insertion logic
* Add tests and Docs
2017-10-23 11:48:34 -04:00
Artem Bilan
bf1fef39db INT-4345: ServerWebSocketContainer: Fix Lifecycle
JIRA: https://jira.spring.io/browse/INT-4345

Resolves https://github.com/spring-projects/spring-integration/issues/2238

The `DefaultHandshakeHandler` doesn't implement `SmartLifecycle`
(just `Lifecycle`) there it doesn't delegate its `start()` to the
`RequestUpgradeStrategy`, e.g. `JettyRequestUpgradeStrategy`.
On the other hand `DefaultHandshakeHandler` can be started as a dependant
`Lifecycle` from some other `SmartLifecycle`, like it happens with the
`WebSocketHandlerMapping`

* Implement `SmartLifecycle` for the `ServerWebSocketContainer` and
delegate its lifecycle to the provided `HandshakeHandler`
* Fix `WebSocketInboundChannelAdapter` to properly implement `doStop()`
with the propagation to the provided `webSocketContainer`
* Fix deprecation warning in the `StompMessageHandlerWebSocketIntegrationTests`

**Cherry-pick to 4.3.x**
2017-10-16 17:28:55 -04:00
Artem Bilan
077b5ffffc INT-4344: AbstRemoteFileOutGw: Add assert for NPE
JIRA: https://jira.spring.io/browse/INT-4344

The `FtpOutboundGateway` provides ctors without expression for remote path.
In this case it is treated as a `working directory` but only for the
`LS`, `NLST`, `PUT` and `MPUT` commands.

* Add assertion in the `AbstractRemoteFileOutboundGateway` to discard
configuration for all other commands when `expression` is `null`

**Cherry-pick to 4.3.x**
2017-10-16 17:04:22 -04:00
Artem Bilan
bc4337ffa8 GH-2071: Upgrade to S-WS-3.0 and Smack-4.2.1
Fixes: spring-projects/spring-integration#2071

* Clean up `build.gradle` for redundant excludes
* Add `javax.mail` dependency to WS module to avoid WARN about missed providers
* Refactoring for the XMPP module according changes in the latest Smack
* Polishing for the `BackToBackAdapterTests` to avoid extra wait for `null`
on the channel and some race conditions when client is closed during by the
`stop()` during publishing

Polishing `UriVariableTests` according the latest S-WS B-S

Revert excludes removal
2017-10-16 16:25:01 -04:00
Artem Bilan
1f88e2de7b INT-4354: Add beanClassLoader support to RedisMS
JIRA: https://jira.spring.io/browse/INT-4354

It's hard to test different ClassLoader in unit tests, so the fix
comes without them

**Cherry-pick to 4.3.x**
2017-10-16 16:10:32 -04:00
Artem Bilan
bf63ef5491 GH-2253: Revert (S)FTP Source to DefaultDirScann
Fixes spring-projects/spring-integration#2253

For backward compatibility and use-cases when processed files are stored
in sub-directories in the `localDirectory` revert the
`AbstractInboundFileSynchronizingMessageSource` logic back to the
`DefaultDirectoryScanner`.
The `RecursiveDirectoryScanner` can be injected via `scanner` option
2017-10-16 16:05:44 -04:00
Artem Bilan
1fa73a9728 INT-4356: FileTransferMH: Add string SpEL setters
JIRA: https://jira.spring.io/browse/INT-4356

**Cherry-pick to 4.3.x**

Address PR comments:
* Remove unused variable in the test case
* Add string-based SpEL setters to the `AbstractInboundFileSynchronizer`
* Fix `@since` in the `FileTransferringMessageHandler` to the proper version
2017-10-16 15:51:12 -04:00
Artem Bilan
a5d30b9f66 Some polishing for test-support module
* Remove `TypeSafeMatcher` in favor of the same class in Hamcrest
* Resolve `serial` warning with `OnFailedToAcquireMutexEvent`
2017-10-13 20:38:31 -04:00
Glenn Renfro
1979f91cf5 INT-4357: LeaderInit: Add failed to lock event
JIRA: https://jira.spring.io/browse/INT-4357

Updated based on code review.

Updated adocs

*Polishing code style, typos
* Add protection from NPE when `LockRegistryLeaderInitiator` isn't
supplied with the `leaderEventPublisher`
* Add `What's New` note
2017-10-13 13:15:12 -04:00
Jorge
a7eebed252 Typo at FTPs example
Use DefaultFtpsSessionFactory instead of DefaultFtpsClientFactory
2017-10-12 15:14:42 -04:00
Abdul Zaheer
f202b25775 GH-2261: Fix ScatterGatherHandler.stop()
Fixes: spring-projects/spring-integration#2261

* Fix `ScatterGatherHandler.stop()` to call `GatherEndpoint.stop()` instead of `start()`

Adding unit test as per artembilan's suggestion

Replacing asterisk import with specific namespaces

Fixing formatting/codestyle errors shown by travis

Creating separate bean for new unit test

* Some simple polishing
* Merge the assertions for the fix into an existing test

**Cherry-pick to 4.3.x**
2017-10-12 11:40:55 -04:00
Artem Bilan
00807d47e2 Upgrade to Spring Security 5.0 M5
* Rename tests in WebFlux module to have `WebFlux` prefix instead of `Http`
2017-10-10 16:50:23 -04:00
Artem Bilan
5092d482b5 INT-4355: Add support for DomPOX WS communication
JIRA: https://jira.spring.io/browse/INT-4355

**Cherry-pick to 4.3.x**
2017-10-09 15:09:52 -04:00
Björn Häuser
7e071c0839 Make configureContainer public for AdapterSpecs
configureContainer is already public in the GatewaySpec, therefore
making it also public in the AdapterSpecs.

We came across this problem when we were testing M7.
2017-10-07 22:05:47 -04:00
Artem Bilan
cfc698447e Upgrades for some dependencies 2017-10-04 16:22:33 -04:00
Glenn Renfro
e515a0d643 INT-4353: Let to set id for DefaultLockRepository
JIRA: https://jira.spring.io/browse/INT-4353

Updated based on code review

* Polishing according PR comments

**Cherry-pick to 4.3.x**
2017-09-29 09:57:59 -04:00
Artem Bilan
e52bf8e8a4 Upgrade to SF-5.0 GA
Staying with BUILD-SNAPSHOT isn't reliable any more:
```
 > Could not resolve org.springframework:spring-context:5.0.0.BUILD-SNAPSHOT.
         > Unable to load Maven meta-data from https://repo.spring.io/libs-snapshot/org/springframework/spring-context/5.0.0.BUILD-SNAPSHOT/maven-metadata.xml.
            > Could not get resource 'https://repo.spring.io/libs-snapshot/org/springframework/spring-context/5.0.0.BUILD-SNAPSHOT/maven-metadata.xml'.
               > Could not GET 'https://repo.spring.io/libs-snapshot/org/springframework/spring-context/5.0.0.BUILD-SNAPSHOT/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
```
2017-09-28 16:55:29 -04:00
Artem Bilan
59a68b9453 Fix AmqpChannParserTests to use connFactory mock
https://build.spring.io/browse/INT-FATS5IC-279

The parser test should not attempt to make connection at all.
* Remove `StubRabbitConnectionFactory` in favor of plain
`mock(ConnectionFacory.class)` for the `AmqpChannelParserTests-context.xml`
* Mark all the channel definition with `auto-startup="false"`
2017-09-27 19:59:55 +01:00
Gary Russell
cb810fbb43 INT-4346: Add Module Name to Manifest
JIRA: https://jira.spring.io/browse/INT-4346
2017-09-26 14:25:59 -04:00
Venil Noronha
797e5045bf INT-4334: Adds a DirectoryScanner to RemoteFileMS
JIRA: https://jira.springsource.org/browse/INT-4334

* Add a `DirectoryScanner` setter named `setScanner` in
`AbstractInboundFileSynchronizingMessageSource` to set the
`FileReadingMessageSource`'s scanner.
* Add tests to `AbstractRemoteFileSynchronizerTests`.

Polish.

Updates xsd, tests and documentation.

Fix xsd formatting.

Addresses review comments.

* Some code style polishing
2017-09-25 21:08:51 -04:00
Gary Russell
2427a7d426 Upgrade to Reactor GA 2017-09-25 16:26:40 -04:00
Gary Russell
59781e6386 Use Explicit Module Exclusions 2017-09-25 11:57:12 -04:00