Commit Graph

9623 Commits

Author SHA1 Message Date
Artem Bilan
4d87572afd Fix SFTP tests to use OS selection port
**Cherry-pick to 4.2.x**
2016-01-25 12:58:30 -05:00
Artem Bilan
e957f43477 Downgrade to ActiveMQ-5.12.2 for IO compatibility
**Cherry-pick to 4.2.x**
2016-01-23 10:14:21 -05:00
Artem Bilan
2d33495437 INT-3816: Superclass Mapping for EMExcTypeRouter
JIRA: https://jira.spring.io/browse/INT-3816

Add `cause` `supperclass` mapping ability to the `ErrorMessageExceptionTypeRouter`

Address PR comments:

Introduce `classNameMappings` to store exception classes on the mapping population.
Override all `@ManagedOperation` s to modify `classNameMappings` as well.

Address PR comments:

* Remove redundant local variable
* Fix concurrency access around `channelMapping`
* Add `ClassNotFoundException` test for the `ErrorMessageExceptionTypeRouter`
* Add `What's New` note about the `ClassNotFoundException` during init

Get rid of `synchronized`, use atomic changes

Additional polishing to avoid `ConcurrentModificationException `

Polishing
2016-01-22 13:14:26 -05:00
Artem Bilan
1760572c8b Change Reactor Assert to Spring Assert
`4.3` only
2016-01-21 17:18:53 -05:00
Artem Bilan
d4e9e25fdb Change Reactor Assert to Spring Assert
**Cherry pick to 4.2.x**
2016-01-21 17:15:46 -05:00
Artem Bilan
f4cb9e8e46 Fix HTTP test: provide URL for mock Request
The latest SF changes relies on the `request.getRequestURL()`.
We end up with the `NPE` if mock `ServletRequest`isn't supplied with `requestURL`.

 * Add the Mockito answer for the `request.getRequestURL()` in the `MultipartAsRawByteArrayTests`

  **Cherry-pick to 4.2.x**
2016-01-21 09:57:52 -05:00
Artem Bilan
2024b8a4b3 INT-3898: Fix <xsd:all> usage
JIRA: https://jira.spring.io/browse/INT-3898

Some XML validator like `xercesImpl` doesn't allow `minOccurs` and `maxOccurs` on the `<xsd:all`.

* Remove them in favor of `minOccurs`/`maxOccurs` on the nested elements.
* Add `<poller>` for the `<int-jmx:notification-publishing-channel-adapter>`
2016-01-20 12:26:44 -05:00
Gary Russell
62db308c22 INT-3935: Add Jsch Proxy Factory Bean
JIRA: https://jira.spring.io/browse/INT-3935
2016-01-19 17:27:55 -05:00
Artem Bilan
c0784bf6ef INT-3933: HTTP & WS Inbound Lifecycle Handling
JIRA: https://jira.spring.io/browse/INT-3933

Previously the HTTP and WS Inbound Endpoint haven't handled the `stopped` state properly.

* Add `lifecycle` parsing to the `HttpInboundEndpointParser`
* Handle `!isRunning()` state and throw an appropriate `503 Service Unavailable` HTTP response
* Expose `lifecycle` options for the `<int-ws:inbound-gateway>`
* Introduce `ServiceUnavailableException` `WebServiceException` to indicate `stopped` state for the WS Inbound Endpoint
* Fix tests for the new logic

INT-3933: PR comments: `OrderlyShutdownCapable` for `AbstractWebServiceInboundGateway`
2016-01-19 14:23:21 -05:00
Gary Russell
c97afe92fe INT-3934: HTTP Requests Without Content-Type
JIRA: https://jira.spring.io/browse/INT-3934

Coerce a missing Content-Type to `application/octet-stream`.
2016-01-18 11:28:05 -05:00
Gary Russell
22eaa649ca Fix Jsr223InboundChannelAdapterTests
Remove unnecessary assert for a null message.

Poller runs every 100ms; test asserts that no message is received in 10ms

Eliminate stderr: `include_class is deprecated. Use java_import.`
2016-01-15 14:00:10 -05:00
Artem Bilan
2dc443022b INT-3928 Ensure WS Adapters work when @EnableWS
JIRA: https://jira.spring.io/browse/INT-3928

The `@EnableWS` provides the `DelegatingWsConfiguration` which registers only `DefaultMethodEndpointAdapter`
overriding the default strategies including required for the SI `MessageEndpoint` implementations `MessageEndpointAdapter`.
That prevents the normal behavior for the SI gateways.

Implement `IntegrationConfigurationInitializer` for the WS module and register `MessageEndpointAdapter` bean for SI WS support.
2016-01-15 13:17:25 -05:00
Artem Bilan
b1a09f5b0d INT-3881: MQTT: add XML recovery-intervalattr
JIRA: https://jira.spring.io/browse/INT-3881

Also fix a couple typos in the WS xsd
2016-01-15 13:12:36 -05:00
Rainer Frey
84c5b7b193 INT-3932: Redis: add rightPop and leftPush
JIRA: https://jira.spring.io/browse/INT-3932

PR review:

* remove unnecessary spaces

* fix code and doc style

* use property name rightPop/right-pop (default true)

* add reversed feature to the outbound adapter

* add new options to reference manual

* Polishing according PR comments
2016-01-15 12:08:26 -05:00
Gary Russell
baa8fdc4f5 INT-3574: Polishing
Synchronize state clearance when message received while stopped.

Make `DefaultFlushPredicate` `static`.
2016-01-15 11:04:37 -05:00
Gary Russell
c7724c340c INT-3574: File Outbound - Don't Flush File
JIRA: https://jira.spring.io/browse/INT-3574

Initial commit.

Polishing

Prevent the flusher task from closing while a write is in process.

Add MessageTriggerAction

Flush file(s) on demand.

Polishing - PR Comments

Add FlushPredicate

Polishing - PR Comments

Polishing - More PR Comments and Schema

Polish and Namespace

Docs

flushIfNeeded Must be Synchronized

Fix Race on Stop

Flush immediately after the write if the handler has been stopped.

Remove states from the internal store if handler is stopped.
2016-01-14 17:48:14 -05:00
Gary Russell
884aebcb07 JIRA: INT-3856 HeaderFilter pattern-match
JIRA: https://jira.spring.io/browse/INT-3856

Allow a property placeholder in the header filter `pattern-match` attribute.

See https://github.com/spring-projects/spring-xd/issues/1804#issuecomment-148845883

Remove versions from spring XSD references
2016-01-12 18:01:08 -05:00
Gary Russell
ce594d437e INT-3920: Handler Factory Bean Subclassing
JIRA: https://jira.spring.io/browse/INT-3920

Remove package and private protection from the message handler `FactoryBean` hierarchy.

Ease the creation of subclasses, for example, it was impossible to subclass
the `SplitterFactoryBean` to support default, expression, or file splitter here:

43c8c041d7 (diff-bb5468e093538789dcde1b222fe90693R62)

* Fix JavaDocs for published methods.
2016-01-12 16:42:15 -05:00
Gary Russell
d8ad38d8ea INT-3869: Fix MBeanServer Detection
JIRA: https://jira.spring.io/browse/INT-3869

When using `@EnableIntegrationMBeanExport` with no `server` property,
the `IntegrationMBeanExportConfiguration` incorrectly created a new
`MBeanServer` instead of attempting to locate an existing one.

Use the `SpecificPlatform` logic from `MBeanExportConfiguration` to locate
a specific server on `WebSphere` and `WebLogic`; otherwise defer to
`JmxUtils.locateMBeanServer()` in the exporter's initialization method.

Add a test to verify the same server is used in multiple contexts.

* Fix `ConnectionFactoryTests` regarding new `MessageProducerSupport` logic
2016-01-12 15:58:21 -05:00
Gary Russell
996e6bb969 INT-3910: MessageProducerSupport.outputChannelName
JIRA: https://jira.spring.io/browse/INT-3910

- Support channel name on `MessageProducerSupport`.
- Defer validation until the endpoint is `start()`ed.
2016-01-12 12:29:20 -05:00
Ryan Barker
201f0fc2b1 INT-3846: SimpleMessageStore Improvements
JIRAs:
https://jira.spring.io/browse/INT-3830
https://jira.spring.io/browse/INT-3523
https://jira.spring.io/browse/INT-3846

* Fix the OOM condition, when we `release()` `UpperBound` independently of the previous `remove` result (https://jira.spring.io/browse/INT-3846)
* Fix "confuse" around `groupCapacity`, when we really didn't care about individual groups (https://jira.spring.io/browse/INT-3523)
* Add `upperBoundTimeout` to have a hook to wait some time for the empty slot in the store (https://jira.spring.io/browse/INT-3830)
* Fix some JavaDocs warnings
* Fix some typos

* Fix inconsistency in the `DelayHandler` around `removeMessageFromGroup` when `MS` is `SimpleMessageStore`
 * Remove `UpperBound.release()` operation from `SimpleMessageStore.removeGroup()`.
 The waiting process should worry about the new `UpperBound` instance.

Some other polishing

`tryAcquire` outside of the `lock`

Move `tryAcquire` within the `addMessageToGroup` outside of `lock`.
But do that only for groups which already exist.
For the new groups we have a fresh `UpperBound`, so no need to worry about dead lock and
 we can obtain  a permit immediately.

SimpleMessageGroup: BlockingQueue -> LinkedHashSet

`SimpleMessageStore`: use "unsynchonized" `SimpleMessageGroup`

Make some synchronization fixes according to the migration to the `LinkedHashSet`

Avoid extra `Collection`

`ResequencingMessageHandler`: compare `size()` of collections instead of `containsAll()`

Fix `ConcurrentModificationException` in the `AbstractKeyValueMessageStore`

Add `SimpleMessageStore.clearMessageGroup()`

Accept polishing and fix `RedisChannelMessageStoreTests`

`@Deprecated` `MessageGroupStore.removeMessageFromGroup()`

Fix some typos

Introduce `SimpleMessageGroupFactory`

Extract `MessageGroupFactory` and address PR comments

Polishing after rebase

JavaDocs and Reference Manual

Fix JavaDocs
2016-01-12 11:51:05 -05:00
Gary Russell
5d5fa86e6e Gemfire Tests: Increase Fork Timeout 2016-01-12 10:10:53 -05:00
Gary Russell
5edc910a7f MQTT: Increase Test Timeouts 2016-01-12 09:42:53 -05:00
Artem Bilan
6beaa2e89a Fix JMS tests for ActiveMQ-5.13.0 2016-01-07 18:40:40 -05:00
Artem Bilan
ada3f00aa9 Upgrade to ActiveMQ-5.13.0 2016-01-07 15:15:23 -05:00
Gary Russell
b8b7c1ec1c INT-3929: MessagingGateway Annotation Detection
JIRA: https://jira.spring.io/browse/INT-3929
2016-01-07 14:11:06 -05:00
Gary Russell
d684dc4d0e INT-3902: XML: SmartLifecycle, Order Attributes
JIRA: https://jira.spring.io/browse/INT-3902

Polishing

Polishing - PR Comments

Introduce `RouterFactoryBean.setSendTimeout` and deprecate `setTimeout`
2016-01-07 14:08:32 -05:00
Artem Bilan
74cbc58698 INT-3926: Add <poller> for all outbound tags
JIRA: https://jira.spring.io/browse/INT-3926

* Add `<poller>` for all `<outbound-adapter(gateway)>`
* Add/modify tests for `<queue>` as an input channel and particular `<poller>`
* Move XSD from the `xml` package to the `config` level to achieve the consistency throughout the project.
2016-01-07 12:16:40 -05:00
Artem Bilan
afc286a66a INT-3927: Docs for IntegrationComponentScan
JIRA: https://jira.spring.io/browse/INT-3927

PR Comments
2016-01-07 11:59:15 -05:00
Artem Bilan
5b7c5b4b72 Merge branch 'INT-3922' 2016-01-06 17:05:05 -05:00
Gary Russell
019470c769 INT-3922: Router FB - outputChannelName
JIRA: https://jira.spring.io/browse/INT-3922
2016-01-06 17:04:36 -05:00
Gary Russell
11ba07e3e3 INT-3890: AMQP: Content-Type Conversion Outbound
JIRA: https://jira.spring.io/browse/INT-3890
2016-01-06 12:31:09 -05:00
Artem Bilan
fec2a36f42 INT-3916: Don't Use CTOR Injection in FactoryBean
JIRA: https://jira.spring.io/browse/INT-3916

The `JpaOutboundGatewayFactoryBean` used CTOR injection for the `JpaExecutor`.
That one, in turn, uses CTOR injection for the `EntityManagerFactory`.

Such a dependency may cause the `early bean instantiating` in case of `AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()`.
And we end up with the `BeanCurrentlyInCreationException`.

Therefore no one `FactoryBean` should use CTOR injection if there is a potential hierarchical dependency.

NOTE: there is no tests on the matter, since we don't change the components behavior.
The `JPA` sample application will be changed to the Boot to track this fix.

**Cherry-pick to 4.2.x**

Address PR comments and fix other `FactoryBean`s for the same issue, when it is reasonable

Polishing

Address PR comments

Make setter `setSockJsTaskScheduler` as `public`
2016-01-06 12:02:26 -05:00
Artem Bilan
2be12160e9 INT-3726: Support Path for FileHeaders.FILENAME
JIRA: https://jira.spring.io/browse/INT-3726

Since the `FileHeaders.FILENAME` header is relaxed String, we can use any value there.
For example some use-cases (e.g. unzipping) would like to use the relative path together with the file name
to restore the original directory structure in the target directory using `FileWritingMessageHandler`.

Use `resultFile.getParentFile().mkdirs()` in the `FileWritingMessageHandler` to recreate the directory hierarchy before the target file manipulating.

Add Documentation

Address PR comments
2016-01-05 17:08:03 -05:00
Gary Russell
2f56bb1329 INT-3899: Defer Poller Creation Until start()
JIRA: https://jira.spring.io/browse/INT-3899

Previously, within `AbstractPollingEndpoint`, the `Poller` object was
created from `afterPropertiesSet()` as well as `start()` if previously `stopped()`
(`this.initialized == false`).

This precluded modification of the advice chain (e.g. in tests when using
`autoStartup == false`).

Move the poller creation to `start()` so that it is always created then, and does
not require a previous `stop()` to change the advice chain.
2016-01-05 14:43:28 -05:00
Gary Russell
eb34d5c9e6 Reference Copyright -> 2016 2016-01-05 12:10:11 -05:00
Artem Bilan
2546ac3d52 INT-3924: Fix RedisQueueInboundGateway
JIRA: https://jira.spring.io/browse/INT-3924

* The `RedisQueueInboundGateway` and `RedisQueueMessageDrivenEndpoint` used `MICROSECONDS` for the wait for stop condition.
  - Change to `MILLISECONDS`
* Both of them may pick up data from the Redis List even after the `stop()`.
  - Add `rightPush()` to the `RedisQueueInboundGateway` to emulate `rollback`.
  - Even if we have `rollback` there we may "steal" messages after the `context.stop()` causing unexpected race condition.
     So change the logic between `stopTimeout` and `receiveTimeout` to `max`, thus we wait for stop more than for `rightPop`.
* Some attributes have been missed for the XML configuration.
  - add `stop-timeout` and `recovery-interval` attributes to the XSD and parsers code.
  - adjust `RedisQueueGatewayIntegrationTests` to use those new attributes.
* Some tests needed polishing:
  - Rework `RedisStoreOutboundChannelAdapterIntegrationTests` to be based on `@ContextConfiguration` for better performance
  - `RedisChannelParserTests` used to `mock` channels for the same Redis topic. Change of of them to different name to avoid `Dispatcher has no subscribers`
    from the `testPubSubChannelUsage()` when the second `SubscribableRedisChannel` doesn't have subscribers.
* Polishing for `redis.adoc`

Address PR comments

* Rework logic to the `Math.min(this.stopTimeout, this.receiveTimeout)` on the adapter/gateway `stop()`
* Fix JavaDocs and `redis.adoc` to describe `stopTimeout` properly.
* Rework `RedisQueueGatewayIntegrationTests` to be based on the `randomUUID` for the queue name to send and receive.

Address PR comments.
2016-01-04 16:43:45 -05:00
Artem Bilan
f5781bfff8 INT-3918: Use MockMvc instead of Sun HttpServer
JIRA: https://jira.spring.io/browse/INT-3918
2016-01-04 15:21:03 -05:00
Marcin Pilaczynski
8bf8caa22e INT-3883: UDP: destination and socket expressions
JIRA: https://jira.spring.io/browse/INT-3883

UDP Outbound Channel Adapter is able to use given UDP Inbound Adapters
server socket (outgoing packets will have source port same as incoming
packets destination port).

* Introduce `destinationExpression` instead of hard-coded `host/port` logic in the `DatagramPacketMessageMapper`
* Make `UnicastSendingMessageHandler.destinationExpression` mutually exclusive with `host/port` pair
* Move `socketExpression` to the setter as it is absolutely different option from the `destination`
* Make `UnicastSendingMessageHandler` expressions logic based on the `requestMessage`

INT-3883 Code review fixes.

Further polishing

Polishing according PR comments

Rework the String socket address logic just to the expected `URI` style.
Accept `2016` for changed classes.
2016-01-04 14:31:40 -05:00
Gary Russell
41c48548f1 Fix AsciiDoctor Conversion Problems 2016-01-01 11:25:42 -05:00
Artem Bilan
1bd955bef0 @Publisher and @Gateway JavaDocs
PR Comments

Additional info

Polishing
2015-12-30 13:13:01 -05:00
Artem Bilan
f7e04918c5 SocketUtils: Fix the multi port function for 0
https://build.spring.io/browse/INT-B43-47
2015-12-28 18:49:27 -05:00
Artem Bilan
287173bc67 Fix TCP tests to use 0 port
https://build.spring.io/browse/INT-MJATS41-495
https://build.spring.io/browse/INT-AT42SIO-16

Can be backported to `4.2.x` on demand
2015-12-28 18:22:07 -05:00
Gary Russell
d71236ee76 (S)FTP Doc Polishing 2015-12-25 10:46:42 -05:00
Artem Bilan
66d02a6b95 Fix compatibility with IO Platform
https://build.spring.io/browse/INT-MJATS41-492

The SI-4.3 has been upgraded to openJpa-2.4.0 for Class Transformation on Java 8 support.
 The Spring IO is still on openJpa-2.3.0.
 Using version in the agent pattern isn't good idea to distinguish the proper jar, because IO does version re-mapping at runtime.
 Change the pattern to consider version as is, but don't match other openJpa jars (transitive required dependencies) in the classpath, e.g. `openjpa-persistence-jdbc` .
2015-12-24 11:13:03 -05:00
Artem Bilan
6e32deb60f Upgrade some dependencies for 4.3 2015-12-23 09:47:14 -05:00
Artem Bilan
59eb565296 Fix handler-advice.adoc
Cherry-pick to `4.2.x`
2015-12-22 18:16:25 -05:00
Gary Russell
6bc619dc22 INT-3921: SimplePollSkipAdvice
JIRA: https://jira.spring.io/browse/INT-3921

Polishing - PR Comments

Also increased some timeouts in JsonPathTests (and fixed a loop counter).
2015-12-21 14:37:23 -05:00
Gary Russell
ed874ea84a TCP ConnectionFactoryTests Race Condition
Wait for events.
2015-12-21 11:38:55 -05:00
Gary Russell
0458220756 TCP ConnectionFactoryTests Diagnostics
https://build.spring.io/browse/INT-SONAR-1582/
2015-12-20 16:07:01 -05:00