Commit Graph

1472 Commits

Author SHA1 Message Date
Artem Bilan
5eb68866d9 INT-3448: Add @Async test for @Gateway
JIRA: https://jira.spring.io/browse/INT-3448

INT-3448: Addressing PR comments

Late Resolution of @Publisher.defaultChannel

Early resolution of the publisher default channel caused
`@ Configuration` factory beans to be instantiated before
Spring Integration bean post processors had been registered.

Use the channel name instead of channel reference and resolve
it when processing the first publish.

Merge branch 'INT-3448' of https://github.com/garyrussell/spring-integration into INT-3448

Conflicts:
	spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java

INT-3448: Polishing
2014-07-08 09:21:57 -04:00
Artem Bilan
fee6f6beed INT-3458: Compatibility with Spring Framework 4.1
JIRA: https://jira.spring.io/browse/INT-3458

* Change Spring AMQP to `1.3.5.RELEASE`
* `HttpRequestHandlingEndpointSupport`: remove `MappingJacksonHttpMessageConverter` registration
* `IntegrationRequestMappingHandlerMapping`: add 'fake' `name()` attribute to the inline `RequestMapping` annotation
* `StoredProcJmxManagedBeanTests`: remove `context.stop();` code, Since `MBeanExporter` deregister MBeans on `stop()` now
* `StoredProcPollingChannelAdapterParserTests`: change deprecated `ParameterizedSingleColumnRowMapper` to the `SingleColumnRowMapper`
* `Jms`: comment out the reflection code to check the value for the `recoveryInterval`, because it is removed already in favor of `backOff`
* `NotificationListeningMessageProducer`: move the start-up listener registration to the `onApplicationEvent`,
because `MBeanExporter` moved `registerBeans()` to the `start()` now.
The same `phase` might cause the issue, that MBeans aren't registered yet for `NotificationListeningMessageProducer`
* `JpaOutboundGatewayTests`: change `@TransactionConfiguration` to the `@Transactional`. Don't know why the first doesn't work now.

**Cherry-pick to 4.0.x**

INT-3458: Addressing PR comments

`NotificationListeningMessageProducer`: defer listener registration until `onApplicationEvent()`

Conflicts:
	build.gradle

Resolved.
2014-07-01 09:48:46 -04:00
Artem Bilan
d49fbbcf9c INT-3445: Fix PublisherRegistrar NPE
JIRA: https://jira.spring.io/browse/INT-3445
2014-06-21 11:34:11 -04:00
Artem Bilan
da6ef048e2 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:06:16 -04:00
Artem Bilan
638958213f INT-3431: Fix RecipientListRouter.onInit()
JIRA: https://jira.spring.io/browse/INT-3431

The introduced `late channel resolution by name` via https://jira.spring.io/browse/INT-3324
has lost `onInit()` propagation from `RecipientListRouter.onInit()`
2014-06-09 16:49:43 +03:00
Gary Russell
a5694cdc42 INT-3423 Fix Expression-Based Splitter
JIRA: https://jira.spring.io/browse/INT-3423

Consider a message containing "one one" and a splitter
with expression "payload.split(' ')", only one message
is emitted.

The default Collection created by SpEL is a HashSet.

Change the ExpressionEvaluatingSplitter to expect a
List instead of a Collection.
2014-05-29 12:11:07 -04:00
Gary Russell
1cc8d8c7f1 INT-3413 Emit Event When an Agg. Expires a Group
JIRA: https://jira.spring.io/browse/INT-3413

Add MessageGroupExpiredEvent with group metadata
such as message count, last modified, whether
the group was discarded or not.

Conflicts:
	spring-integration-core/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java

Polishing
2014-05-22 13:32:16 +03:00
Gary Russell
f396b2a4b4 INT-3386 Improve Aggregator Performance
JIRA: https://jira.spring.io/browse/INT-3386

Eliminate unnecessary group copy during retrieval in the
aggregator. This is expensive with large groups.

Ensure that the reaper uses a snapshot of the group at the
time it is considered for reaping.

AggregatorTests.testAggPerf() -  before:

    AggregatorTests [main] : Sent 0 in 0.0 (10k in 0ms)
    AggregatorTests [main] : Sent 10000 in 4.872 (10k in 4872ms)
    AggregatorTests [main] : Sent 20000 in 16.86 (10k in 11988ms)
    AggregatorTests [main] : Sent 30000 in 36.809 (10k in 19949ms)
    AggregatorTests [main] : Sent 40000 in 65.045 (10k in 28236ms)
    AggregatorTests [main] : Sent 50000 in 100.329 (10k in 35284ms)
    AggregatorTests [main] : Received 60000
    AggregatorTests [main] : Sent 60000 in 143.106 (10k in 42777ms)
    AggregatorTests [main] : Sent 70000 in 147.027 (10k in 3921ms)
    AggregatorTests [main] : Sent 80000 in 158.664 (10k in 11637ms)
    AggregatorTests [main] : Sent 90000 in 177.956 (10k in 19292ms)
    AggregatorTests [main] : Sent 100000 in 205.045 (10k in 27089ms)
    AggregatorTests [main] : Sent 110000 in 240.005 (10k in 34960ms)
    AggregatorTests [main] : Received 60000
    AggregatorTests [main] : Sent 120000 in 282.566 (10k in 42561ms)

After:

    AggregatorTests [main] : Sent 0 in 0.0 (10k in 0ms)
    AggregatorTests [main] : Sent 10000 in 0.612 (10k in 612ms)
    AggregatorTests [main] : Sent 20000 in 0.925 (10k in 313ms)
    AggregatorTests [main] : Sent 30000 in 1.131 (10k in 206ms)
    AggregatorTests [main] : Sent 40000 in 1.288 (10k in 157ms)
    AggregatorTests [main] : Sent 50000 in 1.361 (10k in 73ms)
    AggregatorTests [main] : Received 60000
    AggregatorTests [main] : Sent 60000 in 1.522 (10k in 161ms)
    AggregatorTests [main] : Sent 70000 in 1.619 (10k in 97ms)
    AggregatorTests [main] : Sent 80000 in 1.696 (10k in 77ms)
    AggregatorTests [main] : Sent 90000 in 1.75 (10k in 54ms)
    AggregatorTests [main] : Sent 100000 in 1.81 (10k in 60ms)
    AggregatorTests [main] : Sent 110000 in 1.851 (10k in 41ms)
    AggregatorTests [main] : Received 60000
    AggregatorTests [main] : Sent 120000 in 1.918 (10k in 67ms)
2014-05-20 18:19:45 -04:00
Artem Bilan
39ef91ff84 INT-3408: Fix IRHolder TX-sync Inconsistency
JIRA: https://jira.spring.io/browse/INT-3408

* Add `TransactionSynchronizationFactoryBean`
* Introduce `IntegrationResourceHolderSynchronization`
to get deal with `IntegrationResourceHolder` for custom `TransactionSynchronization`
* Encapsulate `IntegrationResourceHolder` in the `DefaultTransactionSynchronizationFactory`
* Get deal with `IntegrationResourceHolder` and bind it to the `TransactionSynchronizationManager`
only if `TransactionSynchronization` from `transactionSynchronizationFactory`
is `synchronization instanceof IntegrationResourceHolderSynchronization`

INT-3408: Encapsulate binding in the `DefTxSyncF`
2014-05-20 16:00:07 -04:00
Gary Russell
c5500a82fd INT-3410 TCP NIO Deadlock with Bound TE
JIRA: https://jira.spring.io/browse/INT-3410

When running a fixed thread pool with a bound queue,
and CALLER_RUNS execution rejection policy, it
was possible to deadlock the IO selector thread.

Add a `CompositeExecutor` to use different threads for
IO to those used for message assembly.

Add a `CallerBlocksPolicy` to block the invoking thread
(for a specified time) if the pool is exhausted.

Add documentation.

Polishing
2014-05-20 17:05:17 +03:00
Artem Bilan
157fc2a084 INT-3407: Fix TX-sync-processor potential NPE
JIRA: https://jira.spring.io/browse/INT-3407
2014-05-16 12:44:39 +03:00
Gary Russell
8a44d4da0b INT-3399 Update spring-retry to 1.1.0
JIRA: https://jira.spring.io/browse/INT-3399

Fix `MessagingTemplate` javadoc warn
2014-05-14 09:23:55 +03:00
Gary Russell
d369103815 INT-3395 Restore MessagingTemplate Constructor
JIRA: https://jira.spring.io/browse/INT-3395
2014-04-29 11:00:59 -04:00
Artem Bilan
81aa7eabd3 INT-3393: Move Boot AutoConfig to Boot
JIRA: https://jira.spring.io/browse/INT-3393
2014-04-29 10:30:41 -04:00
Artem Bilan
34cc492942 INT-3381: Messaging Annotations on @Bean Method
JIRA: https://jira.spring.io/browse/INT-3381

* Add support to mark `@Bean` methods with `Messaging Annotations`
* Addition attributes for `Messaging Annotations`
* Some refactoring and fixing
* Fix `AbstractMappingMessageRouter#onInit()` propagation
* Fix `GemfireGroupStoreTests` (https://build.spring.io/browse/INT-MASTERSPRING40-JOB1-246/test/case/135235772)

There is still some side effect: we need define `MessageChannel` beans explicitly. Since methods are processed within `BPP`,
not all beans with `Messaging Annotations` might be processed.

INT-3381: PR comments and other fixes

INT-3381 Polishing

INT-3381: Revert `RouterFB` & `SplitterFB`
2014-04-29 09:16:11 -04:00
Artem Bilan
38f9cb8500 INT-3380 Add @Bean's @BridgeTo, @BridgeFrom
JIRA: https://jira.spring.io/browse/INT-3380

INT-3380: Polishing

INT-3380: Refactoring

Minor JavaDoc Polishing
2014-04-25 14:31:11 -04:00
Gary Russell
5522b99741 INT-3382 Support Easier Aggregator Extensions
JIRA: https://jira.spring.io/browse/INT-3382

- Make private methods protected; add protected getters
- Support obtaining just metadata from stores
- Support just fetching the first message from a group
- add metaSize() to message group

INT-3382: Polishing
2014-04-25 19:32:28 +03:00
Gary Russell
24f176c897 INT-3376 Support Meta-Annotation Att. Override
JIRA: https://jira.spring.io/browse/INT-3376

Allow user annotations with Messaging Meta-Annotations
override/supplement attributes set on the meta-Annotation.

PR Comments and More

- Do not create a bean definition for the annotation (interface)
when `MessagingGateway` is used as a meta-Annotation.
- For a `MessagingGateway` restore attributes overridden with empty values
- Other PR comments.

Fully support meta-Annotation hierarchy.

Polishing:

* Upgrade JRuby to 1.7.12
* Replace `AnnotationFinder` with moving its methods to `MessagingAnnotationUtils`
* Refactor aggregator classes to use `MessagingAnnotationUtils` to determine the method for annotation
* Fix `IntegrationComponentScanRegistrar` to skip annotation classes
* Fix `MessagingGatewayRegistrar#replaceEmptyOverrides`
* Improve `MessagingAnnotationPostProcessor` to use `ReflectionUtils.USER_DECLARED_METHODS` `MethodFilter`
* Change the `MethodAnnotationPostProcessor` hierarchy to use just list of annotations to process attributes
2014-04-24 21:56:58 +03: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
17c6f8a350 INT-3372 Add NamedComponent to Remaining MsgSrcs
JIRA: https://jira.spring.io/browse/INT-3372
2014-04-16 21:23:45 +03: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
7dabf749c6 INT-3374 Fix Package Tangle; Part I
JIRA: https://jira.spring.io/browse/INT-3374

`DefaultDatatypeChannelMessageConverter`

Move `getConversionService()` from `IntegrationContextUtils`
to `IntegrationUtils` in `support.utils`.
2014-04-15 13:33:24 -04:00
Artem Bilan
18920851d3 INT-3373: Make Messaging Annotations as Meta
JIRA: https://jira.spring.io/browse/INT-3373

Allow messaging annotations to be used as
meta annotations.
2014-04-15 12:42:47 -04:00
Gary Russell
66fe1c74be INT-2352 Support Control-Bus Atomic Router Updates
JIRA: https://jira.spring.io/browse/INT-2352

Add `replaceChannelMappings()` to the `AMMR`.

INT-2352 Polishing - PR Comments

Consolidate tests.
Fix up `@ManagedAttribute` Vs `@ManagedOperation`
Expose `setChannelMappings` over JMX
2014-04-15 18:56:23 +03:00
Artem Bilan
466af8a2f5 INT-2975: Add ValueExpression for Typed SpEL
JIRA: https://jira.spring.io/browse/INT-2975

INT-2975: Add `type` attr. for enricher property

INT-2975: Check for `type`, polishing, docs

Enricher: deprecate property expression type attr
2014-04-15 11:13:37 -04:00
Artem Bilan
2ee179a891 INT-3338: MongoMS: Add priority and sequence
JIRA: https://jira.spring.io/browse/INT-3338

INT-3338: Add Docs

INT-3338: Make `priority` 'smart'

Add `Sort` for all group queries dependently of `priorityEnabled`.
Avoids the need to configure separate collections for different type of `MessageStore`

INT-3338: Add `MongoDbChannelMessageStore`

INT-3338: Polishing, Fixes, Improvements

Doc Polishing

Fix stream test.
2014-04-14 11:44:59 -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
85b16f0f6d Reduce MBF Warning Logs to DEBUG
When the bean factory is not provided a WARN log was issued
because the message builder factory cannot be found.

Reduce the logs to DEBUG.
2014-04-11 17:37:48 -04:00
Artem Bilan
96dc725539 INT-3368: SyslogToMapTrans: Make TAG Optional
JIRA: https://jira.spring.io/browse/INT-3368

INT-3368: PR comments
2014-04-11 12:55:52 -04:00
Artem Bilan
64a7a7e021 INT-3339: Add priority to the JdbcChannelMS
JIRA: https://jira.spring.io/browse/INT-3339

INT-3339: Improve `priority` logic

INT-3339: Add `MESSAGE_SEQUENCE` stuff

INT-3339: Docs

INT-3339: Polishing and PR comments

INT-3339 Polishing

Fix Oracle Test Case.
Doc polishing.
2014-04-10 16:28:07 -04:00
Artem Bilan
3f40c40641 INT-3365: Add SmartLifecycle for Annotations
JIRA: https://jira.spring.io/browse/INT-3365

INT-3365 Polishing
2014-04-10 12:50:44 -04:00
Artem Bilan
55c4e26619 INT-3356: Add InboundChannelAdapter Annotation
JIRA: https://jira.spring.io/browse/INT-3356

INT-3356 Polishing

Long lines and doc polish.
2014-04-09 14:56:12 -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
Artem Bilan
8ffc86f3d2 INT-3351: Add @Poller for Messaging Annotations
JIRA: https://jira.spring.io/browse/INT-3351

INT-3351: Polishing according PR comments

* Add `property-placeholder` support for `@Poller`
* Change `ref` to `value`
* Add JavaDoc for `array` workaround
* Add docs

INT-3351: Polishing and fixes

INT-3351 More Tests

INT-3351: PR comments

INT-3351 Final Polishing
2014-04-08 10:09:32 -04: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
Artem Bilan
eb0d1ddc84 INT-2595: Add Time-Based ReleaseStrategy Option
JIRA: https://jira.spring.io/browse/INT-2595

* Add `group-timeout` and `group-timeout-expression` to the Correlation Endpoint
* Add logic to the `AbstractCorrelatingMessageHandler` to schedule group for `forceComplete`,
when the target `ReleaseStrategy` returns `false`

INT-2595: Polishing according PR comments

INT-2595: Expose `lock-registry` and further docs

INT-2595 Doc and Test Polishing

INT-2595: Fix typos

INT-2595 More Minor Doc Polish
2014-04-05 10:49:20 -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
969310b453 INT-3327: Add IntegrationConverter Annotation
JIRA: https://jira.spring.io/browse/INT-3327

INT-3327: Addressing PR comments

Polishing
2014-03-31 13:02:47 -04:00
Artem Bilan
c11e3ba3b5 INT-3337: MongoDbMessageStore Refactoring
JIRA: https://jira.spring.io/browse/INT-3337

INT-3337: Addressing PR comments

INT-3337: Add support to store/read Messages

* Add support to store/read `ErrorMessage`. As a trick for `Throwable` is selected (de)serializing converter

INT-3337: Add converters for `Message<?>` impls

INT-3337: Make `MDbMS.MessageWrapper` AuditAware

Add `_id` persistence field

Addressing PR comments

Polishing

- Docs
- Check for null ApplicationContext
- Add afterPropertiesSet() to tests
2014-03-28 16:46:48 -04:00
Artem Bilan
6d6bef58b2 INT-3326 Add GlobalChannelInterceptor Annotation
JIRA: https://jira.spring.io/browse/INT-3326

INT-3326: Add parent-child test

INT-3326: Fix `ClassCastException` for `GCII`

INT-3326: Rebase and Polishing

INT-3326: Fix `GCII` for `getBeanNamesForType`

INT-3326: Add `GlobalChannelInterceptor` annotation

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

INT-3326: Add parent-child test

INT-3326: Fix `ClassCastException` for `GCII`

INT-3326: Rebase and Polishing

INT-3326: Fix `GCII` for `getBeanNamesForType`

INT-3326 Polishing Doc, JavaDocs

Also fix a typo in the bean name for the CI processor.

INT-3326: Polishing

Doc Polishing
2014-03-28 14:04:22 -04:00
Artem Bilan
42a13c830d INT-2743: Improve <header-enricher>.<priority>
JIRA: https://jira.spring.io/browse/INT-2743
2014-03-28 13:06:49 -04:00
Artem Bilan
97c270c0e2 INT-3330 EnableIntegrationMBeanExport Annotation
JIRA: https://jira.spring.io/browse/INT-3330

INT-3330: Enable SpEL evaluation

INT-3330: Polishing for `MBeanExporterHelper`

INT-3330: Fix `errorChannel` early access

INT-3330: Polishing according PR comments

Polishing - copyrights, author, docs
2014-03-27 12:53:20 -04:00
Gary Russell
1d6e80ecd0 INT-3342 Allow Custom TypeLocator for SpEL
JIRA: https://jira.spring.io/browse/INT-3342

Allow customization of the `TypeLocator` used by SpEL
`EvaluationContext`s throughout the framework.
2014-03-27 10:23:38 +02:00
Gary Russell
70c43c8eed Test, Javadoc Cleanup
* Remove an unnecessary test.
* Fix timing in header channel registry test.
* Fix Javadocs in VetoCapableInterceptor
2014-03-26 10:09:32 -04:00
Gary Russell
b92134fae7 INT-3332 GlobalChannelInterceptorBeanPostProcessor
Implicit channel declaration for items downstream
of a `ChannelInterceptor` were not created.

The `BPP` eagerly fetched the interceptors during its
own creation; this caused the context initialization to fail
because the channel initializer hasn't run yet.

Defer creation of the interceptor beans until they are
actually needed.

Also, when using `@Configuration`, the channelInitializer
is no longer the first bean in the bean factory.

INT-3332 Use SmartLifeCycle to Apply Interceptors

Instead of using a bean post processor, the interceptor
processor now performs the channel interception when beans
in phase Integer.MIN_VALUE are started - after all beans
have been instantiated.

Polishing
2014-03-19 15:33:32 +02:00
Artem Bilan
23a26ca38e INT-3328: Add EnablePublisher Annotation
JIRA: https://jira.spring.io/browse/INT-3328

INT-3328: Polishing
2014-03-18 16:30:41 -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
a9faa5836f Fix Typo in DEBUG Message
Also add another control-bus test.
2014-03-14 15:24:00 -04:00
Artem Bilan
f1cd5ede66 INT-3324: Simple refactoring to Routers
JIRA: https://jira.spring.io/browse/INT-3324

* Move `private` `ExpressionControlBusFactoryBean$ControlBusMethodFilter` class
to the `org.springframework.integration.expression.ControlBusMethodFilter`
to make it as convenient to use from JavaConfig
2014-03-13 14:41:00 -04:00