Commit Graph

8252 Commits

Author SHA1 Message Date
Artem Bilan
ef40a939cf Add check header rule and fixHeaders task
Add "new line" in the header end

* Optimization for the `fixHeaders.gradle`
* Apply the `fixHeaders` for the affected classes
2016-03-07 15:08:51 -05:00
Gary Russell
5fe827a3dd Checkstyle - Phase I - Unused Imports
I copied the checkstyle config from spring-boot and commented
out most of the rules.

Over time, we should uncomment each rule and fix violations.
2016-03-04 15:50:08 -05:00
Artem Bilan
15026062ac INT-3958: Groovy Compiler Customization Support
JIRA: https://jira.spring.io/browse/INT-3958

* Introduce `compileStatic` and `compilerConfiguration` properties for the `GroovyScriptExecutingMessageProcessor`,
to allow to customize the Groovy Script compilation
* Introduce `compile-static` and `compiler-configuration` options on the `<int-groovy:script>` component
* Change `RefreshableResourceScriptSource.suggestedClassName()` to return the **full** file name together with the
extension. That may be useful during the filtering phase for Compiler customization
* Modify tests to demonstrate different Compiler customization tricks
* Since Spring Boot 1.4 is already based on the SF-4.3, make an appropriate upgrade, too

Doc Polishing

More Docs Polishing
2016-03-01 15:55:34 -05:00
Artem Bilan
82c2da8dc4 Move BigMGetTests out of the main
Even it isn't harmful, the one useless class in the `.file.test` package looks confusing.

Move it out to the `test` scope and change the dependant projects respectively.
2016-02-24 16:59:40 -05:00
Gary Russell
d4c6713e8a Fix HTTP Doc 2016-02-19 10:47:39 -05:00
Steve Swor
bfb31a1361 INT-3956: peekLast for timeSinceLastSend
JIRA: https://jira.spring.io/browse/INT-3956

Use reflection in tests to access private members

fix assertion imports

Polishing author rights.
Make tests `Threas.sleep()` free.
2016-02-18 17:46:12 -05:00
Artem Bilan
1f4dda011b Disable Gradle reference task on the Travis
* Use `NO_REFERENCE_TASK=true` ENV var to skip `reference` tasks
* To enable `reference` tasks directly even with `NO_REFERENCE_TASK=true` use `ignoreEnvToStopReference` project (`-P`) variable
2016-02-18 16:46:57 -05:00
Spring Buildmaster
0b0894d94e [artifactory-release] Next development version 2016-02-16 14:27:40 -08:00
Spring Buildmaster
b9e4a88734 [artifactory-release] Release version 4.3.0.M1 2016-02-16 14:27:37 -08:00
Gary Russell
d48597f41b Fix TCP Cache Race Condition
On a gateway remote timeout, there's a race between the reader and writer
thread to close the connection.

Change the `released` boolean to an `AtomicBoolean` to avoid the unexpected
exception when the other thread attempts to return a non-existent connection
to the pool.
2016-02-16 15:51:54 -05:00
Artem Bilan
96565cc716 Fix FTP Server test config for file separator 2016-02-16 15:18:27 -05:00
Artem Bilan
217d5395c0 Upgrade to ZooKeeper-3.4.7 2016-02-16 15:07:38 -05:00
Artem Bilan
7595e4f142 INT-3919: FTP: Allow null for Remote Directory
JIRA: https://jira.spring.io/browse/INT-3919

Since `FtpClient` supports `null` for the `LS` command, treating it as a current `working directory`,
there is no reason to forbid `null` from the FTP adapters end-user perspective.

* Allow `null` for the `FtpSession` `list()` and `listNames()` methods
* Allow `null` in the `remote-directory` for the `<int-ftp:inbound-channel-adapter>`
* Allow `null` in the `expression` for the `FtpOutboundGateway`

Polishing - send error if error on async output

Cover `onFailure()` from `onSuccess()` with the `errorChannel`

Address PR Comments

* Get rid of `null` population for the `remoteDirectoryExpression` in the `AbstractPollingInboundChannelAdapterParser`
* Populate `new LiteralExpression(null)` from the `FtpInboundFileSynchronizer` ctor
* Introduce `buildRemotePath(parent, child)` function in the `AbstractRemoteFileOutboundGateway` with the `null` logic for `parent`
* Rework `mGetWithoutRecursion()` to use `LS` command and allow `null` for the dir.
* Fix tests according the new `mGetWithoutRecursion()` logic

Polishing
2016-02-16 14:45:22 -05:00
Artem Bilan
2fad35d9b8 INT-3955: Upgrade to Spring Data Hopper
JIRA: https://jira.spring.io/browse/INT-3955

Tested like:
```
gradlew clean springIoCheck -PplatformVersion=2.1.0.BUILD-SNAPSHOT -PJDK8_HOME=d:\Java\jdk8\
```
2016-02-16 12:38:39 -05:00
Gary Russell
edb30efcd5 INT-3811: Support Negative Matches on Header Map
JIRA: https://jira.spring.io/browse/INT-3811

Polishing - PR Comments
2016-02-16 12:09:47 -05:00
Alexander Derkach
583371007a Fix missing spaces in doc 2016-02-16 10:24:33 -05:00
Gary Russell
408b8ca5f3 INT-3954: Nested Exception in SFTP remove()
JIRA: https://jira.spring.io/browse/INT-3954

Left `e.toString` in the message for now; to avoid a breaking change.
2016-02-16 10:14:46 -05:00
Gary Russell
51a16b2f45 INT-3953: AMQP Delay Header Mapping
JIRA: https://jira.spring.io/browse/INT-3953

Polishing

Doc Polish
2016-02-12 20:53:27 -05:00
Gary Russell
ae2e1b0a8d INT-3947: Support Async Message Handlers
JIRA: https://jira.spring.io/browse/INT-3947

Async Message Handler

If `asyncReplySupported` and the handler returns a `ListenableFuture<?>`,
defer the send to the reply channel until the future is satisfied.

First candidate would be the `AmqpOutboundGateway` wired with an
`AsyncRabbitTemplate`.

Polishing - Use errorChannel Header for Exceptions

Add more tests.

Polishing - ListenableFuture Callback Exceptions

Polishing - send error if error on async output

Cover `onFailure()` from `onSuccess()` with the `errorChannel`
2016-02-11 17:12:00 -05:00
Artem Bilan
51f319bd4f INT-3949: FileWritingMH: use Files.move()
JIRA: https://jira.spring.io/browse/INT-3949
2016-02-11 15:48:19 -05:00
Gary Russell
91387147c9 INT-3952: Local IP Address Header and SocketInfo
JIRA: https://jira.spring.io/browse/INT-3952
2016-02-11 11:43:28 -05:00
Gary Russell
188bb8555e Fix Amqp Header Mapper MimeType
Remove unnecessary class name comparison; `MediaType` is a subclass of `MimeType`.
2016-02-10 15:23:17 -05:00
Artem Bilan
7628cc5439 INT-3950: Fix Aggregator documentation
JIRA: https://jira.spring.io/browse/INT-3950

Previously there was a mention of the `MessageGroupStore.expireMessageGroup(groupId)` which just doesn't existing
in the Framework and never has been there.

* Fix the documentation for the existing `MessageGroupStore.expireMessageGroups(timeout)`.
Although the mention there of `Control Bus` requires to have `@ManagedOperation` on the method.

* Add `@ManagedOperation` for the `MessageGroupStore.expireMessageGroups(timeout)` and confirm with the test-case: `AggregatorWithMessageStoreParserTests`
* Fix the same docs in the XSD for `<aggregator>`
* Fix other typos in the `aggregator.adoc` and `resequencer.adoc`
2016-02-05 11:08:14 -05:00
Artem Bilan
6d4bc8eefa INT-3917: Gemfire tests polishing
JIRA: https://jira.spring.io/browse/INT-3917

* Add `@DirtiesContext` to tests with application contexts
* Add `cache.close()`
* Add NPE check around `cache` in the `@After` methods
* Change a parser test to use mocks, not real Gemfire objects

**Cherry-pick to 4.2.x**
2016-02-02 10:57:10 -05:00
Artem Bilan
760e030c56 Protect JmsOutboundGateway against NPE
https://build.spring.io/browse/INT-MJATS41-532
2016-02-02 09:30:09 -05:00
Gary Russell
d91a6fd467 Add Contributor Covenant
Also convert CONTRIBUTING from markdown to asciidoc.
2016-02-01 17:54:33 -05:00
Artem Bilan
d2eba0927d INT-3939: Consistency for Redis Queue Gateways
JIRA: https://jira.spring.io/browse/INT-3939

Previously `RedisQueueInboundGateway` and `RedisQueueOutboundGateway` used different `RedisSerializer`s
for non-String objects.

* Change the default to the `JdkSerializationRedisSerializer` for the consistency in case of client/server scenarios.

The previous behavior with the `StringRedisSerializer` can be reinstated with `serializer` injection.

Doc Polishing.
2016-01-28 15:49:29 -05:00
Artem Bilan
f762f2c3f0 Fix JDBC test for the HSQLDB Dead Lock
https://build.spring.io/browse/INT-B43-86
https://sourceforge.net/p/hsqldb/bugs/1432
2016-01-25 18:07:00 -05:00
Artem Bilan
c66632a3a0 Fix CrossOriginTestsfor SF-4.3 compatibility
https://build.spring.io/browse/INT-MJATS41-524

Since SF-4.3 (see https://jira.spring.io/browse/SPR-13130) the
`OPTIONS` request, which isn't CORS one (without `HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD`),
is handled by new internal `HttpOptionsHandler`, which just responds with `Allow` header.
2016-01-25 15:00:54 -05:00
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