Commit Graph

190 Commits

Author SHA1 Message Date
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
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
Konstantin Yakimov
efef65c52f 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:05:53 +03:00
Artem Bilan
2bde14b742 INT-3661: Fix the eager BF access from BPPs (P I)
JIRA: https://jira.spring.io/browse/INT-3661

Previously there were a lot of noise from the `PostProcessorRegistrationDelegate$BeanPostProcessorChecker` for early access for beans.
That may produce some side-effects when some of `BeanFactoryPostProcessor`s won't adjust those beans.

The issue is based on two facts:
1. Loading beans from `BPP`, e.g. `IntegrationEvaluationContextAwareBeanPostProcessor` (or `ChannelSecurityInterceptorBeanPostProcessor` - https://jira.spring.io/browse/INT-3663)
2. Loading beans from `setBeanFactory()/setApplicationContext()` container methods

* Move all code from `setBeanFactory()` with access to the `BeanFactory` (e.g. `this.messageBuilderFactory = IntegrationUtils.getMessageBuilderFactory(this.beanFactory);`)
to some other lazy-load methods like `getMessageBuilderFactory()`
* Fix parser tests to remove `messageBuilderFactory` tests since there is no activity for target components to lazy-load them
* Polish some test according the new lazy-load logic
* Rework `IntegrationEvaluationContextAwareBeanPostProcessor` to the `SmartInitializingSingleton` and make it `Ordered`
* Populate `beanFactory` for the internal instance of `connectionFactory` in the `TcpSyslogReceivingChannelAdapter`
* Populate `beanFactory` for the internal `UnicastReceivingChannelAdapter` in the `UdpSyslogReceivingChannelAdapter`
* Add `log.info` that `UdpSyslogReceivingChannelAdapter` overrides `outputChannel` for the provided `UnicastReceivingChannelAdapter`
* Change the internal `MessageChannel` in the `UdpSyslogReceivingChannelAdapter` to the `FixedSubscriberChannel` for better performance

* Fix `AbstractExpressionEvaluator`
* Add JavaDocs for the `IntegrationEvaluationContextAware`

Fix `MongoDbMessageStoreClaimCheckIntegrationTests`

Addressing PR comments
2015-03-02 18:23:44 -05:00
Gary Russell
80a45715ac INT-3628: Use SchedulingAwareRunner for Long Tasks
JIRA: https://jira.spring.io/browse/INT-3628

Certain tasks in Spring Integration are long running. Indicate
so for the benefit of platforms such as WebLogic that can log warnings
for long running tasks otherwise.

Also fix conflicting versions of commons-io.
2015-02-28 15:16:07 +02:00
Gary Russell
09c203dc6d INT-3637: JMX Improvements Msg Sources/Handlers
JIRA: https://jira.spring.io/browse/INT-3637

- Message Sources
- Message Handlers

Polishing; Final Review and PR Comments

- avoid second call to System.currentTimeMillis()
- fix elapsed time in handler metrics
- expose TrackableComponent when available

INT-3637: Add @IntergrationManagedResource

Prevents beans (channels, etc), which were previously picked
up via a proxy, from being exported by a standard context
MBeanExporter.

I looked at completely eliminating the MBeanExporterHelper,
which suppresses o.s.integration beans from being exported by
a standard MBeanExporter when there is an IMBE present, but I feel
this is too much of a breaking change. There are a number of
standard beans (such as WireTap) that are @ManagedResources and
these would disappear for users that don't have an IMBE.

That said, such beans previously disappear completely when there
*is* an IMBE so now they are now annotated with both so that
they are exported by at most one of the exporters.

Polishing; Use MBE.addExludedBean instead of DFA

INT-3639: JMX (AMQP/JMS) Channel Stats

JIRA: https://jira.spring.io/browse/INT-3639

Module channels inherit `ChannelSendMetrics`; add
`PollableChannelManagement` for polled channels.

INT-3638: JMX Initial Stats/Counts Settings

JIRA: https://jira.spring.io/browse/INT-3638

Add the ability to specify the initial settings for
'enableStats' and 'enableCounts' for MBeans that
support those statistics.

Polishing; PR Comments; Add Handler Metrics Test

Also found a problem using an inner MessageSource bean in an
inbound-channel-adapter - a BeanComponentDefinition was returned
instead of a BeanDefinition.

Add @DirtiesContext to JMX Tests

The new MonitorTests failed with InstanceAlreadyExistsException for the
errorChannel.

Add @DirtiesContext to all tests using the Spring test runner to avoid caching any
contexts after the test class completes.

INT-3637: JMX Support Negated Name Match Patterns

Note: with negated matches, order matters.

Polishing for `MonitorTests`
Fix `EnableIntegrationMBeanExport` JavaDocs
2015-02-19 21:51:45 +02:00
Artem Bilan
f248394682 INT-3589: Upgrade Dependencies
JIRA: https://jira.spring.io/browse/INT-3589, https://jira.spring.io/browse/INT-3624

* SF - 4.2. Fix Breaking changes for the `ApplicationEventPublisher`
* AMQP 1.5. Without issues
* Reactor - 2.0. Fix for the new `Stream` foundation
* jsonPath - 1.2.0. Fix for new `Predicate` abstraction. Add 'fail-fast error' to the `IntegrationRegistrar`
* Sshd - 0.13.0. Fix for new `VirtualFileSystemFactory` usage
* Spring Data - Fowler
* And others without issues
* Get rid of `reactor.util.StringUtils` usage

INT-3589: Address PR comments

Polishing
2015-02-17 15:09:09 -05:00
Gary Russell
97c6726fdd 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-15 12:20:54 -05:00
Gary Russell
49b4957270 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-09 11:17:02 +02:00
Gary Russell
64207eca14 Fix RedisLockRegistry Copyright Dates 2015-01-23 13:02:07 -07:00
Gary Russell
15eb01169d INT-3581: Support selector-expression on WireTap
JIRA: https://jira.spring.io/browse/INT-3581

Move schemas to 4.2.

Add `selector-expression` to `<wire-tap/>`.

INT-3781: Fix What's New

Bump Namespace Version to 4.2
2015-01-13 15:32:06 -05:00
Gary Russell
8896d500ed 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 14:21:33 +02:00
Konstantin Yakimov
48f9801b5c 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:19:50 +02:00
Konstantin Yakimov
ad16ac51e9 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:03:06 -05:00
Artem Bilan
8ec4ab0355 INT-3576: Fix NPE in the RedisAvailableTests
JIRA: https://jira.spring.io/browse/INT-3576
2014-12-10 09:07:37 -05:00
Artem Bilan
cb50b1565c INT-3554: Add Expression Setters
JIRA: https://jira.spring.io/browse/INT-3554

**Cherry-pick to 4.0.x**

Polishing
2014-11-07 15:58:22 -05:00
David Liu
1d4785f3d2 INT-3341: Add Redis Queue Gateways
Add RedisQueueOutboundGateway and RedisQueueInboundGateway

JIRA: https://jira.spring.io/browse/INT-3341

add test

fix format issue

change expectmessage to extractpayload, fix test potential bug

fix copyright year

fix format and naming issue

fix as Artem's comments

fix as Artem's comments

change boolean condition judgement

INT-3341: Polishing

Minor Doc Polishing
2014-10-26 10:09:04 -04:00
Enrique Rodríguez
6f7a8e3002 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
2014-10-15 12:00:52 +03:00
Artem Bilan
f84e798272 INT-3370: Add BoonJsonObjectMapper
JIRA: https://jira.spring.io/browse/INT-3370

* Add `BoonJsonObjectMapper`
* Provide some tests
* Remove deprecations
* Polishing test according removed deprecations
* Change `JsonObjectMapper#populateJavaTypes` to get deal with `payload`, not its `class`,
since we can't (and Jackson's `TypeFactory`, too) determine generic type from `Collection`.
Use `iterators` instead to retrieve the type from the first item.

Conflicts:
	build.gradle
	spring-integration-amqp/src/test/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapperTests.java

INT-3370: Polishing according PR comments

* Apply Gary's polishing to the Docs
* Fix `RecipientListRouter` JavaDoc warn
* Fix typo in test name for `UdpUnicastEndToEndTests`
* Fix `RedisQueueOutboundChannelAdapterTests` do not use Jackson 1.x

Final Polish
2014-08-20 14:00:03 -04:00
Artem Bilan
edbbcef5b3 INT-3470: Fix SF 4.1 Compatibility
JIRA: https://jira.spring.io/browse/INT-3470

According to the commit https://github.com/spring-projects/spring-framework/commit/c06ac06,
the `MessagingException` is now `NestedRuntimeException` including nested StackTrace.
Hence test-cases have to be changed to the `Mathers.containsString` instead of `equals` for the `e.getMessage()`

**Cherry-pick to the 4.0.x**
2014-08-12 07:24:51 -04:00
Artem Bilan
7abefb08df INT-3475: Integer.MAX_VALUE / 2 Phase for MDEs
JIRA: https://jira.spring.io/browse/INT-3475

Change the phase for `SourcePollingChannelAdapterFactoryBean`, `AbstractPollingEndpoint`, `MessageProducerSupport`, `JmsMessageDrivenEndpoint`
to the `Integer.MAX_VALUE / 2`
2014-07-22 11:07:31 -04:00
Artem Bilan
58932dc31f INT-3426: Add <r-h-a-c> for all outbound-c-a
JIRA: https://jira.spring.io/browse/INT-3426

Provide other fixes for XSD. E.g. not all adapter have had `<poller>`
2014-07-02 16:02:55 +03:00
Artem Bilan
4b1eed27e3 INT-3442 RedisQMDE Delay stop Until Last Read
JIRA: https://jira.spring.io/browse/INT-3442

Previously `RedisQueueMessageDrivenEndpoint.stop()` returned immediately.
It caused an issue when one more `message` might be read and processed to stopped app.

* Introduce `AbstractEndpoint#lifecycleCondition` and wait on it from `RedisQueueMessageDrivenEndpoint.doStop()`
and `signal()` it from `ListenerTask`.
* Since everything is done around `lifecycleLock` the `RedisQueueMessageDrivenEndpoint.stop()` waits for the proper
'last' message process.
* Add tiny `Thread.sleep(1)` to the `popMessageAndSend` cycle to free `lifecycleLock` for other Threads, e.g. `stop()`

INT-3442: Get rid of `lock` from listener cycle

* Introduce `stopTimeout` to minimize the `stop` thread blocking
* If the message is returned after that timeout it moved back to Redis List using `RPUSH`

INT-3442: Addressing PR comments
2014-06-20 19:05:16 -04:00
Artem Bilan
f5145f531b INT-3418: Final Phase: Cleanup
INT-3418: use versioned XSDs for XSD import
2014-06-09 10:08:30 -04:00
Artem Bilan
77b31f58fd INT-3418: xsd-4.0 -> 4.1 2014-06-05 13:34:52 +03:00
Artem Bilan
c0ab912c49 INT-3418: xsd-3.0 -> 4.0 2014-06-05 13:34:41 +03:00
Artem Bilan
9e5e7514e0 INT-3418: xsd-2.2 -> 3.0 2014-06-05 13:34:30 +03:00
Artem Bilan
9bd441c8d0 INT-3418: xsd-2.1 -> 2.2 2014-06-05 13:34:19 +03:00
Artem Bilan
cedbf6edc2 INT-3418: Prepare 4.1 VERSION
JIRA: https://jira.spring.io/browse/INT-3418

* Create 4.1 XSD
* Clean up Docs for 4.1
* Prepare WebSocket module
* Add Reactor dependency
* Remove Eclipse and SNV artifacts

Phase #1: prepare

Conflicts:
	gradle.properties
2014-05-30 21:14:21 +03:00
Artem Bilan
4c89d21195 INT-3403: Upgrade Spring IO Dependencies
JIRA: https://jira.spring.io/browse/INT-3403

* Upgrade to Gradle 1.12
* Make `schemaZip` Windows compatible

INT-3403: Fix the `replaceAll` logic

INT-3403: Apply SS & SWS releases
2014-05-22 08:35:38 -04:00
Andy Wilkinson
11b87034c5 Add the Spring IO Platform plugin
INT-3396: Polishing

JIRA: https://jira.spring.io/browse/INT-3396

Updates for latest snapshots of the Spring IO plugin

Update the configuration to use the renamed plugin. Add a dependency in
the springIoVersions configuration that points to the versions published
by Spring IO.

Upgrade to 0.0.3.RELEASE

Upgrade the plugin version to 0.0.3.RELEASE. Only apply the plugin if
the platformVersion property has been set.

Polishing following upgrade to 0.0.3.RELEASE

- Remove reference to snapshot plugins repository
- Remove unnessary use of the springIoVersions configuration

Improve configuration of snapshot repository

Upgrade to latest SD to be consistent with IO
2014-05-15 15:13:23 +03:00
Artem Bilan
faf104e608 INT-3394: Use Jedis Client in Tests
JIRA: https://jira.spring.io/browse/INT-3394

INT-3394: Restore `awaitContainerSubscribed`
2014-05-12 10:20:33 -04:00
Gary Russell
aeeb9db4f6 INT-3379 - Allow Placeholders for Enums
JIRA: https://jira.spring.io/browse/INT-3379

Change enumerated attributes to a union with xsd:string
to allow placeholders.

JMS and XML deferred to 4.1 due to the amount of
changes needed to the parsers. See INT-3384.
2014-04-23 13:58:00 -04:00
Gary Russell
8d6aa0fb1e INT-3374 Fix Package Tangle; Part II
JIRA: https://jira.spring.io/browse/INT-3374

Move `getMessageBuilderFactory` from `IntegrationContexUtils`
to `IntegrationUtils`.

Change DOS Newlines to Unix

`AbstractMessageGroupStore`.
2014-04-15 14:08:14 -04:00
Gary Russell
a7489909d7 INT-2738 Add Missing getComponentType() Methods
JIRA: https://jira.spring.io/browse/INT-2738

Add a `getComponentType()` method for all handlers,
message producers, and message sources that implement
`NamedComponent` (see `SPCA.getComponentType()`).

Add rome as an optional dependency - STS complained
because AtomFeedHttpMessageConverter has a dependency
on it.
2014-04-14 16:45:47 +03:00
Gary Russell
ea41e12303 INT-3355 Redis Tests Minor Polishing
JIRA: https://jira.spring.io/browse/INT-3355

Minor issues/typos noticed while back porting.
2014-04-08 13:18:18 -04:00
Gary Russell
89a7743640 INT-3360 Fix Package Tangle
JIRA: https://jira.spring.io/browse/INT-3360

Move LockRegistry from util to support.
2014-04-08 12:01:51 -04:00
Gary Russell
8a0d3803d9 INT-3355 Improve Redis Tests, RedisLockReg.list()
JIRA: https://jira.spring.io/browse/INT-3355

Previously, the RedisAvailableTests unconditionally
flushed Redis; this is not appropriate and could affect
other builds on the CI server (as well as wiping out the
developer's Redis DB).

Change the tests to clean up their own redis data.

Also, improve `RedisLockRegistry.listLocks()` to use mget.
2014-04-08 13:51:45 +03:00
Artem Bilan
9754d59f62 INT-3358: Make MutableMessage package protected
JIRA: https://jira.spring.io/browse/INT-3358
2014-04-07 19:19:49 +03:00
Gary Russell
4dee2a224b INT-3353 Concurrent RedisMetadataStore
JIRA: https://jira.spring.io/browse/INT-3353

Shared metadata for PersistentAcceptOnceFileListFilters.

INT-3353 Polishing; PR Comments
2014-04-07 17:38:33 +03:00
Gary Russell
40a535b140 INT-3352 RedisLockRegistry
JIRA: https://jira.spring.io/browse/INT-3352

Provid a global lock registry, initially for the correlating
message handlers.

INT-3252 Polishing

- Use a discrete key for each lock and use Redis EXPIRE
- Use an internal DefaultLockRegistry to improve latency
    when threads are using the same registry instance.

INT-3352 More Polish

- Put localLock.unlock() in a finally block.
- Unlock localLock if acquiring the RedisLock fails.

INT-3352 Polishing - PR Comments

- PR Comments
- Improve equals()

INT-3352 Add Aggregator Integration Test

- move lock registry to the `util` package
- Add an aggregator integration test

INT-3352 Add Distributed Aggregator Test

- Simulates a distributed environment with a shared message
    store and distinct lock registries.

INT-3352 More PR Comments

INT-3352 Add Multiple Registry Tests

- Add tests to verify expected behavior when different registries are used.
- Polish javadocs.
2014-04-06 07:48:31 +03:00
Gary Russell
882da62ba0 INT-3354 Fix Priority Order in RedisPCMS
JIRA: https://jira.spring.io/browse/INT-3354

Wrong sort order; was treating priority 0 as highest.
2014-04-04 16:47:55 -04:00
Gary Russell
9dee131e3c INT-3349 BeanFactory Propagation
JIRA: https://jira.spring.io/browse/INT-3349

Several FactoryBeans did not propagate the BeanFactory
to their created object(s). Beans that create messages
must have access to a bean factory to get the
message builder factory.

Fix the FactoryBeans and add a mock FB to all tests that
need one.

Add a runtime environment variable to make any infractions
fatal. This should be set to `true` on CI builds and on
framework developer environments.
2014-04-02 14:15:48 -04:00
Artem Bilan
d74b4dba73 INT-2918: Fix 'Redis available' for ROGTests 2014-03-31 11:59:42 -04:00
Artem Bilan
945455f360 INT-2918: Add Redis Outbound Command Gateway
JIRA: https://jira.springsource.org/browse/INT-2918

INT-2918: Improvement according PR comments

INT-2918: Polishing according PR comments

Minor Doc Polishing

INT-2918: Change `notNull` message

Polishing
2014-03-31 10:51:25 -04:00
Gary Russell
a8c8a4fed5 INT-3325 Add Redis Channel Message Group Store
JIRA: https://jira.spring.io/browse/INT-3325
JIRA: https://jira.spring.io/browse/INT-1870

Optimized MGS for QueueChannel - uses a LIST for
each channel and LPUSH, RPOP.

* Also fix MutableMessage to be Serializable

INT-1870 Priority Redis Channel Message Store

Supports priorities 0-9 (+ no priority).

Priorities out of that range are treated as no priority.

Polishing - Add Marker Interfaces

* Emit a `WARN` log if a channel is used with a regular MessageGroupStore
* Allow message-store on namespace when defining a priority channel

INT-3325 Polishing; PR Comments

Fix some typos in JavaDocs and Docs
2014-03-18 12:34:06 +02:00
Gary Russell
75af72a77c INT-3319 Fix BeanFactory Propagation
JIRA: https://jira.spring.io/browse/INT-3319

The `MessageBuilderFactory` abstraction relies on the bean factory
being propagated to all classes that create messages.

Some classes were missed in the initial PR.
2014-03-12 12:03:31 +02:00
Gary Russell
ff845b5069 INT-3309 Pluggable MessageBuilder
This is still a work in process.

There are a bunch of TODOs in classes
that are not managed by Spring and so
need to have the MessageBuilderFactory
injected.

But I am looking for feedback on the
approach.

INT-3309 Resolve TODOs

Provide access to the MessageBuilderFactory in all classes.

INT-3309 Polishing + Tests

* Fallback to 'fromMessage()' if mutating and inbound message is not MutableMessage
* Add 'alwaysMutate' boolean to MutableMessageBuilderFactory - coerces 'fromMessage' calls to 'mutateMessage'
* Add tests

INT-3309 Polishing; PR Comments

Also add tests to parent/child contexts where the parent has the
default message builder and the child has a mutable message builder.

INT-3309 More Polish; PR Comments

Also fix removeHeader in MMB.
2014-03-06 19:51:12 +02:00
Artem Bilan
e6d6bf04e2 INT-3244 Fix RedisMEssageStoreTest Race Condition
JIRA: https://jira.springsource.org/browse/INT-3244
2014-01-21 09:48:51 -05:00
Gary Russell
c45b708341 INT-3262 JDK8 Javadoc Commit
Increase receive timeout for `Jsr223TransformerTests#testInt3162ScriptExecutorThreadSafety`.

JIRA: https://jira.springsource.org/browse/INT-3262
JIRA: https://jira.springsource.org/browse/INT-3263
2014-01-15 19:16:37 +02:00