Commit Graph

7944 Commits

Author SHA1 Message Date
Artem Bilan
fe98cbc4e0 Zookeeper: fix JavaDocs errors
https://build.spring.io/browse/INT-B41-314
2015-06-24 12:09:28 -04:00
Gary Russell
06ffc19b0b INT-3616: Zookeeper LockRegistry
JIRA: https://jira.spring.io/browse/INT-3616

Zookeeper implementation of `LockRegistry`, for example to support
clustered aggregators (when using external message group stores).

INT-3616: Polishing; PR Comments
2015-06-24 11:53:04 -04:00
Gary Russell
ec5230abc7 INT-3654: Rework TCP Connection Close
JIRA: https://jira.spring.io/browse/INT-3654

Previously, single-use `TcpConnections` self-closed when their use was complete.
This is unnatural and caused issues such as INT-3722.

Remove the self-closing behavior; connection close is now (properly) the responsibility
of the client using the connection:

- Client Side:
-- `TcpOutboundGateway` after the reply is received
-- `TcpSendingMessageHandler` after the send, when there is no collaborating inbound adapter
-- `TcpReceivingChannelAdapter` when it is collaborating (after receiving the reply)

- Server Side:
-- `TcpInboundGateway` after the reply is sent
-- `TcpReceivingChannelAdapter` after the receive, when there is no collaborating outbound adapter
-- `TcpSendingMessageHandler` when it is colllaborating (after sending the reply)

As before, the `CachingClientConnectionFactory` always sets single use on the target factory
to force it to create new connections on demand. It is always a single-use factory itself
so the clients return the connections to the pool (via `close()`).

__Needs a migration guide entry__

INT-3654: Fix Late Listener Registration

Timing failures in `TcpOutboundGatewayTests.testFailoverCached()` (null listener).

The `FailoverClientConnectionFactory` registers its listener with the actual
connections it retrieves from a delegate.

When nesting failover and cached connection factories, we need to propagate the
`enableManualListenerRegistration` to the delegate factories so the connection
will wait for its listener to be registered.
2015-06-23 15:35:10 -04:00
Justin Walsh
1dd17ad319 Fix minor typo in Docs 2015-06-23 15:33:48 -04:00
Gary Russell
f3d525a5e8 INT-3642: Improve MessageGroupStore Removal
JIRA: https://jira.spring.io/browse/INT-3642

Currently, `removeMessageFromGroup` rebuilds the group on every removal.

In every case where this method is used in the framework, the result is not used.

Add `removeMessagesFromGroup` that removes a collection of messages and returns no result.

INT-3642: Polishing - PR Comments

INT-3642: Polishing and Fix Group Metadata Size
2015-06-23 15:25:24 -04:00
Gary Russell
0065ed8c49 INT-3751: Fix Python Scripting
JIRA: https://jira.spring.io/browse/INT-3751

Result was null when `executeScript()` was invoked with non-null variables.

When variable are provided, the result variable is stored in the provided bindings.
2015-06-23 13:25:57 -04:00
Marius Bogoevici
54a0d0c26a Zookeeper: use a single ZK instance in tests 2015-06-23 13:24:03 -04:00
Marius Bogoevici
ec1154fb93 INT-3748: BridgeHandler: don't copy headers
JIRA: https://jira.spring.io/browse/INT-3748

- override `shouldCopyRequestHeaders` to return false;
- modify existing tests (not specific to `BridgeHandler`) that rely on the fact that `BridgeHandler` copies headers and creates a new message instance to use a custom test handler with the expected behaviour;

INT-3748 Polishing

- moved test RequestHeaderCopyingMessageHandler
- updated author tags and copyrights
2015-06-19 15:19:47 -04:00
Gary Russell
f4104c199a INT-3745: More TCP Events (Failed Correlation)
JIRA: https://jira.spring.io/browse/INT-3745

Emit events whenever a message is received that can't be correlated to
a connection (or request in the case of an outbound gateway).

Also, when sending messages, wrap the exception in a `MessagingException` so that
the `TcpConnectionExceptionEvent` provides access to the failed message.

INT-3745: Polishing - PR Comments

Fix JavaDocs errors
2015-06-19 13:49:10 -04:00
Gary Russell
65d2024937 INT-3737: (S)FTP Outbound Gateway Streaming GET
JIRA: https://jira.spring.io/browse/INT-3737

Support returning an `InputStream` from a GET operation.

This can be used in conjuction with a `<file:splitter/>` to stream a text file.

The user is responsible for releasing the session when the download is complete.

The session object is stored in the message header and `RemoteFileUtils.closeSession()` should be called
to clean up and close the session.

INT-3737: Polishing and Docs

Fix `CachedSession.close()` bug

Preventing `Caused by: java.io.IOException: Previous raw read was not finalized`
when `Session` is returned to the pool, but `readingRaw` hasn't been finalized
because the real `close()` isn't invoked in case of normal return to pool.
2015-06-19 13:39:36 -04:00
Gary Russell
5e9624f2cf INT-3724: Gateway - Support CompletableFuture
JIRA: https://jira.spring.io/browse/INT-3724

Add support for `CompletableFuture<?>` return types on gateway methods, if JDK8 is being used.

- If the return type is exactly `CompletableFuture` and an async executor is provided, use `CompletableFuture.supplyAsync()`
- If there is no return async executor, return types can be `CompletableFuture` or a subclass and the flow can return such a future.

- Also fixes a problem for return type `Future<Message<?>>` with no async executor; previously this caused a `ClassCastException`
   because the gateway returned the message - it assumed such return types would always run on an excutor.

We can consider back-porting this last part, but nobody has complained.

CompletableFuture Docs

Fix typos, polishing for JavaDocs and some code style polishing
2015-06-18 16:52:17 -04:00
Gary Russell
3d5f7db4b2 INT-4740: FileSplitter - Add Headers
JIRA: https://jira.spring.io/browse/INT-3740

For `File` and `String` payloads add `FileHeaders.ORIGINAL_FILE` and `FileHeaders.FILENAME` headers.

Reworked to create headers once only.

Fix typos and Java > 6  API usage
2015-06-18 13:55:52 -04:00
Gary Russell
6436aa6d32 INT-3600: FileSplitter Namespace and Docs
JIRA: https://jira.spring.io/browse/INT-3600

Add `<int-file:splitter/>` namespace component.
Add `FileSplitter` documentation.

Polishing
2015-06-18 13:45:16 -04:00
Gunnar Hillert
247232bdde INT-3659: InputStream support in FileWritingMH
https://jira.spring.io/browse/INT-3659

Add `InputStream` `payload` handling to the `FileWritingMessageHandler`
2015-06-17 20:57:37 -04:00
Gary Russell
da54a1262d INT-3739: FileSplitter - Add LineCount to EOF Mark
JIRA: https://jira.spring.io/browse/INT-3739

Since iterating splitters don't have a sequence size, it would be useful to
include a line count in the EOF marker, to facilitate some downstream process
knowing that all lines have been processed, in a multi-threaded situation.
2015-06-17 17:59:00 -04:00
Gary Russell
c278548216 INT-3738: Fix FileSplitter
JIRA: https://jira.spring.io/browse/INT-3738

Don't rely on `BufferedReader.ready()` to detect EOF.

Polishing FileSplitter Fix
2015-06-17 17:21:48 -04:00
Gary Russell
505bfac2f8 INT-3735: (S)FTP Fix Schema Expected Type
JIRA: https://jira.spring.io/browse/INT-3735
2015-06-17 16:12:06 -04:00
Gary Russell
58e99b01e1 INT-3744: Fix IMAPMessage receivedDate
JIRA: https://jira.spring.io/browse/INT-3744

MimeMessages are copied to eagerly fetch IMAP messages, this process loses
the `receivedDate` property.

Keep a reference to the source Message and delegate to its `receiveDate()`.

Cover more "void" getters
2015-06-17 16:07:18 -04:00
Gary Russell
f32fd1967b INT-3742: spring-data-gemfire 1.7 Compatibility
JIRA: https://jira.spring.io/browse/INT-3742

Deprecate the message store ctor that takes a `Cache` argument.
2015-06-17 16:06:00 -04:00
Marius Bogoevici
8782d097cf INT-3691 Add ZookeeperMetadataStore
JIRA: https://jira.spring.io/browse/INT-3691

- create new core interfaces `ListenableMetadataStore` and `MessageStoreListener`;
- create new module `spring-integration-zookeeper`;
- add `ZookeeperMetadataStore` implementation

Polishing

Polishing

- moved classes into core/test where necessary, including conversion methods
- properly renamed `MetadataStoreListenerAdapter`
2015-06-17 13:54:35 -04:00
Gary Russell
51b52ea3a6 INT-3727: FileSplitter - add SOF/EOF Capability
JIRA: https://jira.spring.io/browse/INT-3727

Add a configuration option such that the `FileSplitter` can emit
Start/End messages when splitting.

Polishing according PR comments

Add toString to FileMarker
2015-06-08 13:52:48 -04:00
Gary Russell
7ed79c864d INT-3730: TCP Expose SSLSession for Header Mapping
JIRA: https://jira.spring.io/browse/INT-3730

Expose the `SSLSession` on `TcpConnection` to support custom header
mapping of properties from the session.
2015-06-08 12:15:51 -04:00
Artem Bilan
b7221938af INT-3729: Fix STOMP test sporadic failures
JIRA: https://jira.spring.io/browse/INT-3729
2015-06-07 20:17:01 -04:00
Gary Russell
9e1119b434 INT-3728: TCP: Fix Early Receive with Caching CCF
JIRA: https://jira.spring.io/browse/INT-3728

The `CachingClientConnectionFactory` uses a temporary (rejecting) listener until
the connection is established and then replaces the listener in the connection.

There is a race condition in that if the server starts sending messages before the
listener is replaced, the message is rejected.

Add a mechanism to delay `onMessage` calls until the real listener has been
registered.

Also fix `onMessage` in the cached connection so an `ErrorMessage` is propagated correctly.

To reproduce: revert src/main; add `Thread.sleep(1000)` before `registerListener(tcpListener);`
in `CachedConnection` ctor and run the new test.

To introduce a similar timing hole with the new code, add the sleep before
`this.theConnection.registerListener(this);` in `TcpConnectionInterceptorSupport`.

Summary of changes:

`CachingClientConnectionFactory`
- register the underlying connection's listener in the ctor, utilizing the
    `TcpConnectionInterceptorSupport.registerListener()` method.
- fix `ErrorMessage` propagation.

`AbstractClientConnectionFactory`
- propagate the `enableManualListenerRegistration` to connections.

`TcpConnectionSuport`
- implement delay when manual listener registration is enabled.

Add test case.

Fix Failover Tests

`FailoverClientConnectionFactory`
- propagate enable manual listener registration to underlying factories

Polishing
2015-06-05 21:05:36 -04:00
Gary Russell
7c78553609 JMX Doc Polishing 2015-06-02 19:56:04 -04:00
Gary Russell
bc8b946a9e Fix RedisInboundChannelAdapterTests Race Condition
Instead of waiting for a hard 1 second, intelligently wait
until the container is subscribed by sending/receiving a test message.

Also reduces the test run time from 20s to 200ms locally.
2015-06-01 14:14:32 -04:00
Artem Bilan
0fdc63007a INT-3723: Fix HTTP Module for Recent SF Changes
JIRA: https://jira.spring.io/browse/INT-3723

Since `RequestMappingHandlerMapping` has reverted to `@RequestMapping` parsing,
restore the previous logic with `@RequestMapping` generation in the `IntegrationRequestMappingHandlerMapping`

Use `AnnotationUtils.synthesizeAnnotation` instead of direct annotation creation through the inline impl
2015-06-01 12:43:18 -04:00
Spring Buildmaster
1f91d4b832 [artifactory-release] Next development version 2015-05-27 13:26:37 -07:00
Spring Buildmaster
0aee0dad04 [artifactory-release] Release version 4.2.0.M1 2015-05-27 13:26:32 -07:00
Artem Bilan
9b1aab0703 Fix STOMP subscription race condition
Even if we receive a SUBSCRIBE event, it doesn't that the subscription has been registered.
 So, fix the test to wait for the real subscription.
2015-05-27 14:23:48 -04:00
Gary Russell
3339313ba7 INT-3722: Additional Fix: TCP OG with Caching CF
JIRA: https://jira.spring.io/browse/INT-3722

While the initial fix solved the reported problem, it caused a memory leak when
the gateway completed its work before the reader thread "closed" the connection,
releasing it to the pool. This left the connection in the deferred close state.

Handle the condition where the gateway signals it has completed its work
before the connection is released to the pool.
2015-05-27 12:30:05 -04:00
Gary Russell
d17785db12 Fix TCP Gateway Integration Test
Definitively wait for the connection to be returned instead of a simple sleep.
2015-05-27 10:19:38 -04:00
Gary Russell
22fb524515 INT-3722: Fix Timing Issue TCP OG and Cached CF
JIRA: https://jira.spring.io/browse/INT-3722

The TCP outbound gateway correlates replies based on the connection id.

When a `CachingClientConnectionFactory` is being used, the connection is
returned to the pool too early, and can be reused. It is possible that
the current thread then removes the "next" pending reply from the correlation map.

Add code to the `CachingClientConnectionFactory` so that the "self" close from the
connection (called after `onMessage`) is deferred and the actual close (return to cache)
is controlled by the gateway itself.

This mechanism will no longer be needed when INT-3654 is resolved (removal of the "self"
closing by connections). At that time, connection users (such as the gateway) will be
in complete control.
2015-05-26 17:46:14 -04:00
Gary Russell
9a5062b510 Upgrade Spring Framework, Security Versions 2015-05-26 15:27:24 -04:00
Artem Bilan
9e4c7e00db INT-3685: Introduce STOMP Adapters
JIRA: https://jira.spring.io/browse/INT-3685

* Add `StompInboundChannelAdapter` to subscribe to STOMP destination and receive messages from them.
Destinations can be added/removed (hence subscribed/unsubscribed) at runtime.
* Add `stompMessageHandler` to the send messages to STOMP destinations.
* `destination` can be extracted from `MessageHeaders`, the `destination` and `destinationExpression` are also supported.
* `RECEIPT` Frame is also supported and emitted as `StompReceiptEvent`
* `StompExceptionEvent` is emitted when we have a `failure` for `CONNECT` Frame or as a reaction to the `ERROR` Frame.
* Introduce `StompSessionManager` abstraction to manage the single `StompSession` and allow to share it between different adapters.
* Add `WebSocketStompSessionManager` implementation over `WebSocketStompClient`
* Add `Reactor2TcpStompSessionManager` implementation for target Broker connections
* Add `StompHeaderMapper`

Address PR comments and JavaDocs

Polishing according PR comments

Polishing
2015-05-26 14:10:52 -04:00
Gunnar Hillert
a0160e50d4 INT-3718: Add ignore-hidden to int-file:i-c-a
JIRA: https://jira.spring.io/browse/INT-3718

* If not set to `false` explicitly, add `IgnoreHiddenFileListFilter` as a default in `FileListFilterFactoryBean`
* Update XML Schema XSD and add `ignore-hidden` attribute
* Update + Add tests
* Add documentation
* Add default `IgnoreHiddenFileListFilter` also to `DefaultDirectoryScanner`
2015-05-25 22:08:12 -04:00
Gary Russell
5b0b3fc159 INT-3721: Add Flush Support to Persistent Filters
JIRA: https://jira.spring.io/browse/INT-3721

Support flushing metadata after each update.

Polishing JavaDocs
2015-05-25 21:13:41 -04:00
Gunnar Hillert
510bea55cd INT-3716: Add IgnoreHiddenFileListFilter
JIRA: https://jira.spring.io/browse/INT-3716

**Cherry-pick to 4.1.x**
2015-05-19 20:26:25 +03:00
Gary Russell
98d191cba1 INT-3719: AbstractMessageChannel Optimizations
JIRA: https://jira.spring.io/browse/INT-3719

YourKit profiling for a lightweight XD stream indicates a large
amount of time in `AMC.send()`.

- Only call `logger.isDebugEnabled()` once
- Eliminate the need to create an `UnmodifiableList` and calling `size()` to get the size of the interceptor list.

Polishing

INT-3719: Fix (PR Comment)
2015-05-19 19:45:46 +03:00
Artem Bilan
5cf66df775 INT-3717: Fix QueueChannelTests Race Condition
JIRA: https://jira.spring.io/browse/INT-3717

**Cherry-pick to 4.1.x and 4.0.x**
2015-05-18 16:21:57 +03:00
Artem Bilan
acaf357d72 INT-3687: Fix CORS & upgrade to IO 2.0
JIRA: https://jira.spring.io/browse/INT-3687

* Change `master` to use IO 2.0 BOM for versions
* Upgrade `jsonPath` to `2.0.0`
* Fix `IntegrationRequestMappingHandlerMapping` according the latest MVC changes around CORS:
https://jira.spring.io/browse/SPR-12933.
* No yet any tests for `Global CORS`: waiting for Namespace support in MVC

Test this with:
```
./gradlew clean springIoCheck -PplatformVersion=2.0.0.BUILD-SNAPSHOT -PJDK8_HOME=<jdk8-home>
```
2015-05-18 08:58:22 +03:00
Gary Russell
974fbce911 INT-3715: Fix Thread Safety in SyslogTransformer
JIRA: https://jira.spring.io/browse/INT-3715

`SimpleDateFormat` is not thread-safe.
2015-05-12 18:28:11 +01:00
Gary Russell
5cbb2848a1 INT-3692: Example TCP Annotation Config
JIRA: https://jira.spring.io/browse/INT-3692

Polishing indents in the Docs.
2015-05-12 14:57:40 +03:00
Gary Russell
093ab7924b INT-3677: Support PPH and SpEL for Container Class
JIRA: https://jira.spring.io/browse/INT-3677

Previously, you could not use a property placeholder or SpEL when
defining the `container-class` attribute on message-driven endpoints.

Register the container with bean name `adapterId.container`.

Also add an alias for the container message listener `adapterId.listener`.

Add tests for JMS-backed channels - no code changes needed because a factory bean is used.
2015-05-12 14:55:45 +03:00
Gary Russell
123b38a008 INT-3706: Support FileExistModes in (S)FTP Gateway
JIRA: https://jira.spring.io/browse/INT-3706

Previously, the `mode` attribute on the (S)FTP outbound gateways was ignored.

Take account of the mode on (M)GET and (M)PUT commands.
2015-05-12 13:21:26 +03:00
Gary Russell
c2ee93f9e1 INT-3696: Use StringBuilder in FtpFileInfo
JIRA: https://jira.spring.io/browse/INT-3696
2015-05-11 09:45:03 +01:00
Artem Bilan
580ecddcc0 INT-3714: Add HTTP CORS Support
JIRA: https://jira.spring.io/browse/INT-3714

Docs and change Reactor dependency to `RELEASE`

AMQP -> `1.5.0.M1` and rebase

Doc Polishing
2015-05-08 11:31:41 +01:00
Artem Bilan
5065a5a1d5 INT-3645/INT-3612: Upgrade JSch and Paho deps
JIRA: https://jira.spring.io/browse/INT-3645,
https://jira.spring.io/browse/INT-3612

**Cherry-pick to 4.1.x**
2015-05-08 00:01:19 +03:00
Artem Bilan
79db6e6c3f INT-3712: Remove StringUtils.isNotEmpty usage
JIRA: https://jira.spring.io/browse/INT-3712

According to the commit b90085500d
`StringUtils.isNotEmpty` doesn't exist anymore. `StringUtils.hasLength` is way to go ahead.
2015-05-07 23:27:29 +03:00
Artem Bilan
256ff4c46f INT-3599/INT-2042: Improve XPathMessageSplitter
JIRA: https://jira.spring.io/browse/INT-2042,
https://jira.spring.io/browse/INT-3599

* Expose `outputProperties` for the `XPathMessageSplitter`
* Add `iterator` mode for the `XPathMessageSplitter`

Address PR comments

Doc Polishing
2015-05-06 15:25:35 +01:00