Commit Graph

9623 Commits

Author SHA1 Message Date
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
Karol Dowbecki
8059566b9b INT-3712: Syslog: fix pattern according RFC 3164
JIRA: https://jira.spring.io/browse/INT-3712

Add `@author Karol Dowbecki` to affected classes
2015-05-06 13:33:29 +03:00
Gary Russell
e5f03d4d4b Fix Aggregator Attribute Doc 2015-05-06 09:12:25 +01:00
Artem Bilan
8f09a88f3c INT-3713: Fix HTTP Inbound with the latest MVC
JIRA: https://jira.spring.io/browse/INT-3713
2015-05-05 15:02:18 +01:00
Gary Russell
d77e0a954e Remove Deleted Method: StubRabbitConnectionFactory 2015-05-01 15:17:15 +01:00
Gary Russell
af71cf99b1 INT-3711: Fix Incorrect Interface in Docs
JIRA: https://jira.spring.io/browse/INT-3711
2015-05-01 14:54:56 +01:00
Artem Bilan
135287994b INT-3582: Pub Confirms for AMQP Outbound Gateway
JIRA: https://jira.spring.io/browse/INT-3582
2015-04-28 16:12:58 +03:00
Artem Bilan
6302c86fb8 INT-3709: Fix HTTP module according SF changes
JIRA: https://jira.spring.io/browse/INT-3709
2015-04-27 09:42:17 +01:00
Artem Bilan
183941ec07 INT-3705: Improve Messaging Annotations handling
JIRA: https://jira.spring.io/browse/INT-3705

* Add validation for annotation attributes which must be populated directly on the `MessageHandler` `@Bean` using setters
* Add `sendTimeout()` annotation attribute for all Messaging Annotations
* Remove `DEFAULT_SEND_TIMEOUT = 1000L` from `AbstractCorrelatingMessageHandler` to make its component consistent with all other
`AbstractMessageProducingHandler` implementation.
* Fix XSD docs and Reference Manual to say that default `send-timeout` for `AbstractMessageProducingHandler` components is `-1`, not `one second`
* Make all Messaging Annotations attributes as `String` to allow to configure through the Property Placeholder options
* Fix a couple of typos

Polishing
2015-04-23 14:15:08 +01:00
Artem Bilan
5bf4d97b38 Fix StompIntegrationTests with the latest SF
https://build.spring.io/browse/INT-B41-266
2015-04-23 00:08:25 +03:00
Stephane Maldini
78a8d713a3 INT-3644 Un@Ignore testReactorPersistentQueue
JIRA: https://jira.spring.io/browse/INT-3644
Update reactor dependencies
2015-04-22 23:32:53 +03:00
Artem Bilan
b2e83a8792 Fix Generics usage in IdempotentReceiverIntTests 2015-04-20 14:04:37 +03:00
Artem Bilan
f410c4a21d INT-3704 Add Map ctor for SimpleMetadataStore
JIRA: https://jira.spring.io/browse/INT-3704

Some NoSQLs (e.g. Hazelcast) provide a distributed implementations for the `ConcurrentMap`,
so add `SimpleMetadataStore(ConcurrentMap<String, String> metadata)` to allow ot inject any `ConcurrentMap` implementation.
Demonstrate the support for Hazelcast in the `IdempotentReceiverIntegrationTests`

**Cherry-pick to 4.1.x**
2015-04-20 11:25:17 +01:00
Aaron Loes
a0fdf6f0dc INT-3700: Fix FeedEntryMS for correct lastTime
JIRA: https://jira.spring.io/browse/INT-3700

Change to calculate proper syndicate entry date for comparison when
adding feeds for processing.

I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.

unit test for recent changes to FeedEntryMessageSourceTests to verify
proper last seen date calculation.

updates for comments from code review

* newline at EOF on atom.xml
* removed question from code
* fetch files via classpath instead of file system
* 'else' on newline
* authorship on class

Polishing
2015-04-17 19:02:07 +03:00
Artem Bilan
aa43109009 INT-3702: Compatibility with Spring Security 4.0
JIRA: https://jira.spring.io/browse/INT-3702
2015-04-17 16:32:44 +01:00
Artem Bilan
b81b5ed74a EnableIntegrationTests: More tracing info 2015-04-17 16:32:09 +03:00
Artem Bilan
2aac4414df INT-3698: HTTP MH: Remove Internal Converters
JIRA: https://jira.spring.io/browse/INT-3698

The `HttpRequestExecutingMessageHandler` added two internal `Converters` to the `ConversionService` before.
In case of parent-child environment it causes memory leak: closing of child context doesn't release
`HttpRequestExecutingMessageHandler` instances, because those internal `Converters` aren't `static`, hence bounded to outer instance.

Actually after introduction since `4.0` version to the `HttpRequestExecutingMessageHandler` the code like:

```
Assert.isTrue(expectedResponseType instanceof Class<?>
					|| expectedResponseType instanceof String
					|| expectedResponseType instanceof ParameterizedTypeReference,
					"'expectedResponseType' can be an instance of 'Class<?>', 'String' or 'ParameterizedTypeReference<?>'.");
if (expectedResponseType instanceof String && StringUtils.hasText((String) expectedResponseType)){
				expectedResponseType = ClassUtils.forName((String) expectedResponseType, ClassUtils.getDefaultClassLoader());
}
```

These converters are redundant.

In addition remove the `expected type` for the `uriVariablesExpression` evaluation to avoid `MapToMapConverter`.

**Cherry-pick to 4.1.x, 4.0.x**

INT-3698: Provide robust logic for the `uriExpression` and `httpMethodExpression`

Make some polishing around `Assert`s, when `IllegalStateException` must be presented instead of `IllegalArgumentException`
for the expression evaluation results.

Polishing
2015-04-16 15:26:23 +01:00
Gary Russell
73522d2aae INT-3664: Fix Javadoc 2015-04-16 14:36:32 +01:00
Artem Bilan
b6cfd4fa76 INT-3663: Fix Early BF Access for Security Module
JIRA: https://jira.spring.io/browse/INT-3663

Previously the `ChannelSecurityInterceptorBeanPostProcessor` was populated with direct `BeanDefinition`s for `ChannelSecurityInterceptor`s.
It caused an `early access to BeanFactory`.
The issue has been introduced by the `ChannelSecurityInterceptorFactoryBean`

* Rework `SecurityIntegrationConfigurationInitializer` do not populate `BeanDefinition`s to the `ChannelSecurityInterceptorBeanPostProcessor`, but just `bean names`
* Redesign `ChannelSecurityInterceptorBeanPostProcessor` to the `AbstractAutoProxyCreator`
* Introduce `SecuredChannel` annotation to be used on the `@Bean` level for `MessageChannel` definition
* Move `access policy` mapping to the `SecuredChannel` annotation

Address PR comments

Document `@SecuredChannel` annotation
2015-04-16 14:24:35 +01:00
Andy Wilkinson
2653ce9aed INT-3701: Assist Boot with GPFB Type Determination
JIRA: https://jira.spring.io/browse/INT-3701

Allow Spring Boot to determine type created by GatewayProxyFactoryBean

Spring Boot's @ConditionalOnBean can be used to activate some
configuration when a bean of a particular type is present in the
application context. To avoid early initialization, the search for
beans is performed without instantiating them, i.e. it relies on the
information that's available from the bean's class and its bean
definition. This causes a problem with GatewayProxyFactoryBean as its
a FactoryBean<Object> so Boot's best guess is that the bean that's
produced by the factory will be an Object. For cases where the bean's
type signiture does not contain enougn information to determine its
type,  Boot looks at an attribute, factoryBeanObjectType, on the
factory bean's definition. The value of this attribute can be a Class
or a String class name.

This commit updates MessagingGatewayRegistrar to set the
value of factoryBeanObjectType attribute to be the configured
service interface for the gateway.
2015-04-16 13:40:57 +01:00
Gary Russell
15150ac499 INT-3699: RemoteFileTemplate Javadocs
JIRA: https://jira.spring.io/browse/INT-3699

Also javadocs for related classes.

INT-3699: Polishing - PR Comments
2015-04-15 12:49:41 +03:00
Artem Bilan
3e851d2e1b INT-3697: Map contentType to HTTP Response
JIRA: https://jira.spring.io/browse/INT-3697

Since Spring Integration 4.0 the `MessageHeaders` had been moved to the Spring Messaging module
and `MessageHeaders.CONTENT_TYPE` had been changed from `content-type` name to the `contentType`.

Previously the automatic mapping of `contentType` to the HTTP Request `Content-Type` has been introduced
for the `HttpRequestExecutingMessageHandler`.

This fix do the same for the HTTP Response in case of HTTP Inbound Endpoint.
This allows to transfer HTTP headers automatically from underlying HTTP Outbound Endpoint for HTTP Proxy scenario.
The response from that external HTTP service maybe changed during a downstream flow before sending HTTP Response from the HTTP Inbound Endpoint.
Before this we was forced to map `contentType` to `Content-Type` manually or just rely on the `HttpMessageConverter`s.

**Cherry-pick to 4.1.x**
2015-04-13 13:58:26 +03:00