Commit Graph

1570 Commits

Author SHA1 Message Date
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
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
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
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
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
Artem Bilan
18c704595a 4.0.x: Fix SF 4.1 compatibility 2014-09-04 14:22:03 +03:00
Artem Bilan
c010685d27 INT-3503 equals & hashCode for ToStringFriendlyJN
JIRA: https://jira.spring.io/browse/INT-3503

**Cherry-pick to 4.0.x**

PR Comments and test
2014-09-02 12:56:17 -04:00
Artem Bilan
dd5224cc58 INT-3486: Poller: Prevent Interrupt StackTrace
JIRA: https://jira.spring.io/browse/INT-3486

INT-3486a: PR comments
2014-08-20 10:47:09 -04:00
Artem Bilan
705be107ca 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**

Conflicts:
	spring-integration-amqp/src/test/java/org/springframework/integration/amqp/channel/DispatcherHasNoSubscribersTests.java
	spring-integration-core/src/test/java/org/springframework/integration/handler/advice/AdvisedMessageHandlerTests.java
2014-08-12 22:10:24 +03:00
Gary Russell
bd58077528 INT-3483 Fix Test Case for < 4.1
JIRA: https://jira.spring.io/browse/INT-3483
2014-07-25 10:48:37 -04:00
Artem Bilan
9b2fb8a07f INT-3483: Fix AbstractCorrelatingMH deadlock
JIRA: https://jira.spring.io/browse/INT-3483

**Cherry-pick to 4.0.x & 3.0.x**
2014-07-25 10:28:39 -04:00
Gary Russell
8dd6adab52 INT-3474 Suppress DEBUG StackTrace in MIMHelper
JIRA: https://jira.spring.io/browse/INT-3474

When the MethodInvokingMessageHandler skips ineligible methods while
searching it emits a stack trace under DEBUG logging. This is not
needed, a simple log message is enough to convey the information.

Some POJOs gain ineligible methods when wrapped in a proxy so this
is no fault of the developer.

Other reasons for skipping methods (improperly set annotations etc)
continue to emit a stack trace.

INT-3474: Polishing

Rethrow `IneligibleMethodException` as `IllegalArgumentException` in case of a single `method` for processor
2014-07-24 16:53:53 +03:00
Gary Russell
b2f07d0116 INT-651 Suppress Deprecation Warnings 2014-07-18 14:45:04 -04:00
Gary Russell
9858657953 INT-651 Use Local 'Function' Interface
Avoid adding a new dependency after backport.
2014-07-18 14:10:35 -04:00
Artem Bilan
3113b69a87 INT-651: Add Iterator Support for Splitter
JIRA: https://jira.spring.io/browse/INT-651

INT-651: Polishing according PR comments

INT-651: Polishing #2

Doc Polishing
2014-07-18 13:40:55 -04:00
Artem Bilan
f0eeb3b2b9 INT-3470: SF 4.1 Compatibility #2
JIRA: https://jira.spring.io/browse/INT-3470

* Apply the last `ChannelInterceptor` changes - just `extends ChannelInterceptorAdapter`
* Change some tests to check content according to the new changes to the `GenericMessage#toString()`

**Cherry-pick to 4.0.x**
2014-07-17 14:33:46 -04:00
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