Commit Graph

7684 Commits

Author SHA1 Message Date
Artem Bilan
bce22900aa 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

Conflicts:
	spring-integration-http/src/test/java/org/springframework/integration/http/config/OutboundResponseTypeTests.java

Resolved.
2015-04-16 15:32:36 +01:00
Spring Buildmaster
3880f01a47 [artifactory-release] Next development version 2015-04-03 04:59:32 -07:00
Spring Buildmaster
1d051d9773 [artifactory-release] Release version 4.0.7.RELEASE 2015-04-03 04:59:16 -07:00
Artem Bilan
ddf3919323 INT-3690: AMQP Content-Type Mapping for MimeType
JIRA: https://jira.spring.io/browse/INT-3690

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

Conflicts:
	spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java
	spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java

Resolved.
2015-04-02 17:50:42 +01:00
Andy Wilkinson
151431390d Upgrade to Spring Web Services 2.2.1.RELEASE
This commit updates the version of Spring Web Services to
2.2.1.RELEASE. The fix for SWS-892 means that in the event of an
interceptor failing to handle a request, the request is no longer
sent. The interceptor in UriVariableTests has been updated to return
true, indicating that the request has been handled and should be
sent.
2015-03-31 17:36:53 +03:00
Gavin Gray
aabd1018df INT-3684: Rebuild Tail Command on Restart
JIRA: https://jira.spring.io/browse/INT-3684

Conflicts:
	spring-integration-file/src/test/java/org/springframework/integration/file/tail/FileTailingMessageProducerTests.java

Conflicts:
	spring-integration-file/src/test/java/org/springframework/integration/file/config/FileTailInboundChannelAdapterParserTests-context.xml
	spring-integration-file/src/test/java/org/springframework/integration/file/config/FileTailInboundChannelAdapterParserTests.java
2015-03-31 16:07:04 +03:00
Konstantin Yakimov
0bf4af65fb INT-3667: Fix RedisLockRegistry memory leak
JIRA: https://jira.spring.io/browse/INT-3667

* fix `RedisLockRegistry.tryLock` memory leaks using 2 different thread local internal storages:
 hard references for locked locks and weak references (optional) for others, weak references are used for lock obtaining optimization -
thread will get same `RedisLock` object for certain key before locking and after unlocking (if variable still exists)
* add `RedisLockRegistry.useWeakReferences` property for enable thread local weak references storage for unlocked locks, disabled by default
* fix `RedisLockRegistry$RedisLock.obtainLock` improper expire time update (expire time was updated on every attempt to get lock)
* update `RedisLockRegistry` tests
2015-03-30 15:10:58 +03:00
Artem Bilan
903140ea21 INT-3669: Fix DelayHandler for the Date delay
JIRA: https://jira.spring.io/browse/INT-3669

Previously the `DelayHandler` incorrectly calculated a `delay` for values which are of the `Date` time.
It always used `new Date()` even for rescheduling for persisted messages.

* Fix `DelayHandler` to calculate `delays` against the `requestDate` of the delayed Message
* In addition fix the expression evaluation root object, when for rescheduling it was the message with `DelayedMessageWrapper` payload instead of original message.

**Cherry-pick to 3.0.x, 4.0.x, 4.1.x**
2015-03-03 10:51:29 -05:00
Gary Russell
44c3e325f9 Fix Redis Delayer Test
https://build.spring.io/browse/INT-MJATS41-JOB1-238/test/case/155714247

Perhaps a race in Redis; add delay.

Also add a delay between sends so the delays are scheduled in order.
2015-02-19 22:49:03 +02:00
Gary Russell
8cf1fbb533 Fix Redis Synchronization Tests
The "transaction" synchronization tests use a `QueueChannel`.

The payload is a live reference to the Redis object.

It is possible that the test for the returned size occurs after
the "transaction" commits.

Change the tests to extract the size() on the poller thread so
that the size is always captured before the "transaction" commits.
2015-02-19 22:48:46 +02:00
Gary Russell
9979f4eed6 INT-3652: Fix NPE: TCP Caching Connection Factory
JIRA: https://jira.spring.io/browse/INT-3652

Conflicts:
	spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactory.java
	spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactoryTests.java
2015-02-19 22:18:03 +02:00
Artem Bilan
f5a06129c8 INT-3614 Fix extractPayload for JMS i-c-adapter
JIRA: https://jira.spring.io/browse/INT-3614

The `extractPayload` is present in the namespace support for `<int-jms:inbound-channel-adapter>`,
but nor `JmsInboundChannelAdapterParser`, neither `JmsDestinationPollingSource` take care of that value.

To be consistent with `<int-jms:message-driven-channel-adapter>` and documentation, introduce that option for
`JmsDestinationPollingSource` and populate it from the `JmsInboundChannelAdapterParser`.
2015-02-18 18:19:31 -05:00
Gary Russell
c45a050e2b INT-3646: Add TCP Server Exception Events
JIRA: https://jira.spring.io/browse/INT-3646

Publish `TcpConnectionServerExceptionEvent`s when unexpected
exceptions occur on server sockets.

INT-3646: Polishing
Fix Reactor tests

Conflicts:
	spring-integration-core/src/test/java/org/springframework/integration/gateway/AsyncGatewayTests.java
	spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/ConnectionEventTests.java
	src/reference/docbook/whats-new.xml
2015-02-18 22:01:51 +02:00
Tony Falabella
6854cb8227 INT-3620: add appendNewLine to the FileWritingMH
JIRA: https://jira.spring.io/browse/INT-3620

Add `setShouldAppendNewLine(boolean shouldAppendNewLine)` method to the
`FileWritingMessageHandler` class.  Added similar test methods to the
`FileWritingMessageHandlerTests` class.

INT-3620: `appendNewLine` just only for `FileExistsMode.APPEND`

Also add `appendNewLine` for `File` payload

INT-3620: `appendNewLine` for any `fileExistsMode`
2015-02-02 17:30:01 +02:00
Gary Russell
651ac2d3df Fix Unreliable Redis Test
https://build.spring.io/browse/INT-B41-JOB1-187/test/case/155732315

Purge the list before testing.

Force `listening` to `false` so `rightPush` is called reliably.
2015-01-13 15:57:18 -05:00
Gary Russell
bdfa658e23 Update Copyright to 2015 2015-01-13 14:22:28 -05:00
Gary Russell
d54b27dd0d INT-3607 Fix <transactional/> Docs
JIRA: https://jira.spring.io/browse/INT-3607
2015-01-13 21:18:07 +02:00
Konstantin Yakimov
1bc3cfd35e INT-3604: Add transactionsfor RedisLockRegistry
JIRA: https://jira.spring.io/browse/INT-3604

There is no test-case to cover the issue, because it isn't so easy to emulate the network glitch between `setIfAbsent` and `expire`
2015-01-13 14:28:38 +02:00
Gary Russell
2231f1d68f INT-3598: Disambiguate MQTT Namespace Constructor
JIRA: https://jira.spring.io/browse/INT-3598

- Force the first two constructor args to be of type `String`.
- When no client factory, add one in the parser rather than selecing an alternate ctor.

Conflicts:
	spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/config/xml/MqttParserUtils.java
	spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests-context.xml
	spring-integration-mqtt/src/test/java/org/springframework/integration/mqtt/config/xml/MqttMessageDrivenChannelAdapterParserTests.java

Remove test for unsupported `empty topics` functionality
2015-01-09 13:50:14 +02:00
Gary Russell
3fbd863fcb INT-3592: Fix (S)FTP Gateway CTOR Visibility
JIRA: https://jira.spring.io/browse/INT-3592

CTORs were incorrectly `private` which is ok for XML
configuration, but not for DSL/Java Config.
2015-01-05 14:23:17 +02:00
Gary Russell
38c05ec796 INT-3590: Fix Router Documentation
JIRA: https://jira.spring.io/browse/INT-3590
2015-01-05 14:23:16 +02:00
Konstantin Yakimov
1ec5df7c3a Add the ability to point own local LockRegistry.
JIRA: https://jira.spring.io/browse/INT-3587

There is no ability to use own local LockRegistry to avoid overlapping of produced ReentrantLock objects, it can happens if used unique keys have same masked value for DefaultLockRegistry.

Add a constructor to allow the configuration of a lock registry with a differnt number of locks than the default.
2014-12-23 09:14:06 -05:00
Spring Buildmaster
c0722733bc [artifactory-release] Next development version 2014-12-12 10:57:17 -08:00
Spring Buildmaster
5e3ca4ed8a [artifactory-release] Release version 4.0.6.RELEASE 2014-12-12 10:57:02 -08:00
Artem Bilan
6bfb8b02d6 Upgrade to AMQP 1.3.7 and SF 4.0.8 2014-12-12 19:58:30 +02:00
Artem Bilan
c68a55fc88 INT-3576: Fix NPE in the RedisAvailableTests
JIRA: https://jira.spring.io/browse/INT-3576
2014-12-10 09:48:05 -05:00
Gary Russell
8e934b9125 INT-3560 Fix DelayHandlerTests for Pre Java 8 2014-12-09 19:08:34 -05:00
Artem Bilan
87a8a5752c INT-3560: Fix DelayHandler for Duplicate Messages
JIRA: https://jira.spring.io/browse/INT-3560

Previously, messages arriving at the delayer before the
the context was initialized would be emitted twice after
the context `refresh()` or a JMX invocation of `reschedulePersistedMessages()`.

When using a `SimpleMessageStore`, the "re" scheduled
message from the context refreshed event (or a JMX invocation)
would be re-handled unconditionally.

This was due to incorrect logic to handle the way the `SMS` stores messages.

Change the logic to correctly handle (ignore)  duplicate scheduled
releases when using `SMS`.
2014-12-09 18:34:20 -05:00
Artem Bilan
2ca698854f INT-3573: Fix EEvalSplitter for Iterator
JIRA: https://jira.spring.io/browse/INT-3573

Fix `seen` `Queue` `NPE` for `(S)FtpInboundRemoteFileSystemSynchronizerTests`:
https://build.spring.io/browse/INT-B41-JOB1-164/test/case/155357717

**Cherry-pick to 4.0.x**
2014-12-09 17:20:50 -05:00
Gary Russell
e714a5a2a8 INT-3572: Improve Accept Once Filter Performance
JIRA: https://jira.spring.io/browse/INT-3572

Previously, a blocking queue was used to hold seen files; this was used to enable
FIFO when a max capacity is set.

When used with no capacity, a queue is not needed; also the `contains` operation
on a queue requires a linear search which does not scale well for a large number
of files.

Use a `HashSet` instead to significantly improve the `contains` performance.

Only maintain a queue if a max capacity is set.

Fix `AcceptOnceFileListFilterTests` to be compatible with Java < 8
2014-12-09 19:01:05 +02:00
Artem Bilan
1f23bf8f0b INT-3563: Add router's id to the MDException
JIRA: https://jira.spring.io/browse/INT-3563
2014-12-08 12:27:22 -05:00
Artem Bilan
f41e9141a6 INT-3571: Propagate Lifecycle from SPCA to MS
JIRA: https://jira.spring.io/browse/INT-3571

**Cherry-pick to 4.0.x**

Introduce `LifecycleMessageSource` for `maint` versions to avoid undesired side-effects with already existing `... implements MessageSource<T>, Lifecycle`.
2014-12-05 13:43:40 -05:00
Gary Russell
26259e4626 INT-3564 Update Javadoc URLs to spring.io
JIRA: https://jira.spring.io/browse/INT-3564
2014-11-21 13:14:53 +02:00
Gary Russell
f73e920696 INT-3565 Inject Advice Chain to Direct Handlers
JIRA: https://jira.spring.io/browse/INT-3565

Cast to `IntegrationObjectSupport` fails if the handler is
already proxied in `AbstractSimpleMessageHandlerFactoryBean`.

Conflicts:
	spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java

Resolved.

INT-3565 Polishing

- Fix test.
- enhance test to show that directly bound message handler beans are not advised if already proxied.
2014-11-20 13:40:27 -05:00
Spring Buildmaster
2c7c5bb3b0 [artifactory-release] Next development version 2014-11-11 11:41:08 -08:00
Spring Buildmaster
12ec9b7361 [artifactory-release] Release version 4.0.5.RELEASE 2014-11-11 11:41:02 -08:00
Gary Russell
16a081044c INT-3545: Don't AutoStart HeaderChannelRegistry
JIRA: https://jira.spring.io/browse/INT-3545

Previously, the `DefaultHeaderChannelRegistry` was auto-started.
This caused the reaper to run and eventually start all the
`taskScheduler` threads, even if the registry was not being used.

- Defer the `start()` until the first channel is stored.
- Do not start the reaper if the bean has been explicitly stopped.
- Deprecate the implementation of `SmartLifecycle`.

Conflicts:
	spring-integration-core/src/main/java/org/springframework/integration/channel/DefaultHeaderChannelRegistry.java

Resolved.

__cherry-pick to 3.0.x__
2014-11-05 15:19:51 -05:00
Artem Bilan
39a1c3ce30 INT-3543: Remove context.close() from tests
JIRA: https://jira.spring.io/browse/INT-3543

Quoting Sam Brannen:

> However, one should *never* programmatically close the injected application context in a test,
since the Spring TestContext Framework caches all contexts across the entire JVM process.
If you need to close a context after a test method or test class for some reason,
the only supported and reliable mechanism is `@DirtiesContext`.

**Cherry-pick to 4.0.x**
2014-11-03 08:45:58 -05:00
Artem Bilan
c588288c49 INT-3539: Fix ChannelSecurityInterceptorBPP
JIRA: https://jira.spring.io/browse/INT-3539

Previously the `ChannelSecurityInterceptorBeanPostProcessor` eagerly loaded all beans from its `afterPropertiesSet`
to retrieve the `ChannelSecurityInterceptor`s. According to the `BeanPostProcessor` nature the `afterPropertiesSet` hook isn't legitimate.
It may cause some bad side-effects for other beans, which might not been initialized yet.

Rework `ChannelSecurityInterceptorBeanPostProcessor` to accept `Collection<ChannelSecurityInterceptor>` in the ctor.
Rework `SecurityIntegrationConfigurationInitializer` to iterate over `BeanDefinition`s to determine those of them, which
are `ChannelSecurityInterceptor` or `ChannelSecurityInterceptorFactoryBean`.

**Cherry-pick to 4.0.x**
2014-10-29 10:23:46 -04:00
Gary Russell
e7a64b8ef5 Speed Up Mongo Build When No Mongo
@Rule used a 10 second connection timeout.

Polishing
2014-10-22 16:14:58 +03:00
Gary Russell
064ec921bb INT-3537 RemoteFileTemplate Close Stream
JIRA: https://jira.spring.io/browse/INT-3537

Stream not closed if session cannot be created.

Add `try {} finally {}`.

__cherry-pick to 4.0.x, 3.0.x__

Conflicts:
	spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileTemplate.java
	spring-integration-ftp/src/test/java/org/springframework/integration/ftp/session/FtpRemoteFileTemplateTests.java
2014-10-22 12:35:41 +03:00
Gary Russell
55a0b4324f INT-3536 Fix Mail Receiver Regression Issue
JIRA: https://jira.spring.io/browse/INT-3536

The fix for opening multiple IMAP connections in the idle
adapter inadvertently removed the check for the store being
open.

Add `connectStoreIfNecessary()` and test case.
2014-10-21 16:58:42 +03:00
Enrique Rodríguez
ca39d91465 INT-3528 Use Collections min and max methods where appropriate
JIRA: https://jira.spring.io/browse/INT-3528

Use `min` and `max` methods instead of sorting an entire collection to get the minimum or maximum element.

Change other inline `Comparator<?>`s to the `final` fields

Conflicts:
	spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java
2014-10-15 12:07:32 +03:00
Gary Russell
9bb2e5abed INT-3526 Used Expanded URI In Exception Message
JIRA: https://jira.spring.io/browse/INT-3526

Previously, the URI in the exception message is the raw
URI with placeholders, if present.

Use the expanded URI in the message instead.
(cherry picked from commit 113716e)
2014-10-04 17:25:37 +03:00
Gary Russell
d0a125e794 INT-3524 Fix Tooling MessageChannel References
JIRA: https://jira.spring.io/browse/INT-3524

Backport to 4.0 schemas.

A number of references (expected-type) still referred to
the Spring Integration 3.0 MessageChanel.
2014-10-03 08:00:11 +01:00
Artem Bilan
3b40d8c063 INT-3517: Fix HTTP Rome Dep. Logic for SF in CP
JIRA: https://jira.spring.io/browse/INT-3517
2014-09-26 09:23:47 +01:00
王小冋
a46da286db INT-3522: MQTT XSD: Fix client-factory attr type
JIRA: https://jira.spring.io/browse/INT-3522
2014-09-26 11:15:44 +03:00
Spring Buildmaster
507b84021e [artifactory-release] Next development version 2014-09-05 01:27:40 -07:00
Spring Buildmaster
a5df485e91 [artifactory-release] Release version 4.0.4.RELEASE 2014-09-05 01:27:32 -07:00
Artem Bilan
f5fc061ee6 Upgrade to SF 4.0.7, AMQP 1.3.6 and Retry 1.1.1 2014-09-05 10:37:16 +03:00