Commit Graph

9623 Commits

Author SHA1 Message Date
Gary Russell
266af04bb6 Add BF Required to Test Builds
Previously, the environment variable that ensures all message creators have
a `BeanFactory` required setting the `SI_FATAL_WHEN_NO_BEANFACTORY` environment
variable to `true`.

Add this variable to `build.gradle`, enforcing the test for all builds.
2014-11-17 14:23:59 -05:00
Gary Russell
ab522557c1 ChannelAdapterParserTests - Increase Receive Times
Fix occasional CI build plan failures.
2014-11-12 10:47:06 -05:00
Spring Buildmaster
789a048cbb [artifactory-release] Next development version 2014-11-11 08:50:07 -08:00
Spring Buildmaster
5af0335ded [artifactory-release] Release version 4.1.0.RELEASE 2014-11-11 08:49:52 -08:00
Gary Russell
84b182162f INT-3531 Update to Spring Framework 4.1.2
JIRA: https://jira.spring.io/browse/INT-3531

INT-3531 Fix Stub AMQP Channel

Compatibility with 3.4.x amqp-client.
2014-11-11 17:47:40 +02:00
Artem Bilan
5e0c7a1f19 Fix Docs issue
https://build.spring.io/browse/INT-B41-152
2014-11-11 12:53:39 +02:00
Gary Russell
0f568c0526 INT-3557 Clarify MessageHeaders Constants
JIRA: https://jira.spring.io/browse/INT-3557

Add class names and code tags.

Add missing header constants.

Polishing for `timestamp` header doc.

Fix JavaDocs issues: https://build.spring.io/browse/INT-EIGHTAPI-296
2014-11-10 21:18:48 +02:00
Artem Bilan
0cc9273a2e INT-3551: Idempotent Receiver: Add value-strategy
JIRA: https://jira.spring.io/browse/INT-3551

* Rename `MetadataKeyStrategy` -> `MetadataEntryStrategy`
* Add `valueStrategy` to the `MetadataStoreSelector`
* Add `value-strategy` and `value-expression` to the `<idempotent-receiver>`

INT-3551: Add `@IR` support on service methods

Rework `MetadataKeyStrategy` just to the `MessageProcessor`
Fix Docs

Minor Doc Polishing.
2014-11-10 14:01:10 -05:00
Gary Russell
1018fcf361 INT-3556: Payload Conversion Documentation
JIRA: https://jira.spring.io/browse/INT-3556

Clarify when a `GenericConverter` might be needed rather
than a simple `Converter`.
2014-11-08 18:00:26 +02:00
Gary Russell
96d18d43a7 INT-3554: Expression Setters Polishing
JIRA: https://jira.spring.io/browse/INT-3554
2014-11-08 07:28:08 -05:00
Artem Bilan
9f77fcd763 INT-3550: RoutingSlip Improvements
JIRA: https://jira.spring.io/browse/INT-3550

* Make `RoutingSlipRouteStrategy#getNextPath` as `Object` return type. to allow to produce `MessageChannel` result, not only `beanName`
* Make `RoutingSlipHeaderValueMessageProcessor` ctor to accept `Object... routingSlipPath` instead of just String.
It is useful from JavaConfig, when we can use `RoutingSlipRouteStrategy` `@Bean` reference.
* Add JavaConfig test case to demonstrate how `RoutingSlipRouteStrategy` can get deal with inline `FixedSubscriberChannel`
and Lambdas together with Reactor Streams.

INT-3550: Polishing according PR comments

* Fix `AbstractMessageProducingHandler` to check if `nextPath` isn't empty String
* Add `RoutingSlipHeaderValueMessageProcessor` ctor check for the `routingSlipPath` entries types
* Add `RoutingSlipRouteStrategy` JavaDocs regarding the loop of strategy invocation
* Add `Process Manager` doc

Doc Polishing.
2014-11-07 16:20:22 -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
Gary Russell
90c6f2fa3e INT-3555: Fix Header Channel Mapping
JIRA: https://jira.spring.io/browse/INT-3555

Previously, `replyChannel` and `errorChannel` headers were
unconditionally dropped in `AbstractHeaderMapper`. This was
changed in 4.1.0.M1 to allow these headers to be transmitted
in the case that they were translated to a String by a
`HeaderChannelRegistry`.

However, we should still drop these headers if they reference live
`MessageChannel` instances.
2014-11-07 18:50:57 +02:00
Gary Russell
1c9cea162d 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`.
2014-11-05 15:13:29 -05:00
Artem Bilan
ecbb4ef386 INT-3538-3: Docs for Idempotent Receiver
JIRA: https://jira.spring.io/browse/INT-3538

I-R Doc Polishing
2014-11-05 14:36:28 -05:00
Artem Bilan
efe3b11fc3 INT-3538: Docs for Routing Slip
JIRA: https://jira.spring.io/browse/INT-3538

INT-3538-2: `RoutingSlipHeaderValueMessageProcessor` improvement

Since `HeaderEnricher` populates `beanFactory` to its `HeaderValueMessageProcessor`s,
there is no reason to specify `RoutingSlipHeaderValueMessageProcessor` as a separate bean.
Therefore the `IntegrationEvaluationContextAware` may not be reached.
Remove its support from `RoutingSlipHeaderValueMessageProcessor` and just rely on the `setBeanFactory`

RS Doc Polishing
2014-11-05 11:26:45 -05:00
Artem Bilan
af19bbfa70 INT-3538: Docs for Scatter-Gather
JIRA: https://jira.spring.io/browse/INT-3538

Phase #1: `Scatter-Gather`

S-G Doc Polishing

INT-3538 Add `requires-reply` to `scatter-gather`

Final S-G Doc Polish
2014-11-05 09:02:09 -05:00
Gary Russell
6f85509920 INT-3549 Fix AMQP o-c-a Validation
JIRA: https://jira.spring.io/browse/INT-3549

`afterPropertiesSet()` checks for `NullChannel` to determine
whether a correlation expression is needed for confirms.

This code fails when `nullChannel` is proxied.

Extract the type before testing.
2014-11-04 20:38:38 +02:00
Gary Russell
f6c36d049d INT-3548 Fix @Payloads Annotation
JIRA: https://jira.spring.io/browse/INT-3548

Refactoring in 4.1 broke the `@Payloads` annotation in the
`MessagingMethodInvokerHelper`.

The test case missed this because it explicitly declares
`@Payloads List<Integer>` which is actually handled by the
case below:

````java
else if (Collection.class.isAssignableFrom(parameterType) || parameterType.isArray()) {
	if (canProcessMessageList) {
		sb.append("messages.![payload]");
		...
````

`List<?>` triggered

````java
else if ((parameterTypeDescriptor.isAssignableTo(messageListTypeDescriptor) || parameterTypeDescriptor
				.isAssignableTo(messageArrayTypeDescriptor))) {
	sb.append("messages");
	...
````

- Add back the logic to detect `@Payloads`.
- Remove `@Payloads` from the existing test.
- Add a new test that uses `List<?>`
2014-11-04 11:33:56 -05:00
Gary Russell
7dcb6ce58f INT-3457 Fix stop(Runnable) in AbstractEndpoint
JIRA: https://jira.spring.io/browse/INT-3547
JIRA: https://jira.spring.io/browse/INT-3546

INT-3486 changed stop(Runnable) so that it could be
overridden by subclasses, to allow separation of the
`stop()` and `callback` invocation.

However, the refactoring changed the logic such that
the `running` field is not reset, causing `doStop()` to
be called even when the component was not running.

Reset the running field.

Also, the MQTT inbound channel adapter did not test
for a `null` `client` in `doStop()`.
2014-11-04 10:07:03 -05:00
Artem Bilan
f2ca6cdd06 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:43:32 -05:00
Gary Russell
32171f5ed6 INT-3542 Clarify Docs Regarding Inner Beans
JIRA: https://jira.spring.io/browse/INT-3542
2014-10-31 15:37:47 -04:00
Artem Bilan
9e468e520a INT-3540: Add <scatter-gather> to the <chain>
JIRA: https://jira.spring.io/browse/INT-3540
2014-10-30 15:07:43 +02:00
Artem Bilan
542fc4fb5e 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 11:02:38 +02:00
Spring Buildmaster
10b84684ba [artifactory-release] Next development version 2014-10-26 08:11:44 -07:00
Spring Buildmaster
2835447dc6 [artifactory-release] Release version 4.1.0.RC1 2014-10-26 08:11:33 -07: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
Artem Bilan
ff2b15ea9e INT-2426: Add Idempotent Receiver EIP
JIRA: https://jira.spring.io/browse/INT-2426

INT-2426: pushed `final` modifier fix for Java 6 compatibility

INT-2426: Rework logic to the `MetadataStore`

INT-2426: `IdempotentReceiver` -> `IdempotentReceiverInterceptor`

* Move `Idempotent Filtering` logic to the `IdempotentReceiverInterceptor`, which should be applied as a regular
AOP `Advice` to the `MessageHandler#handleMessage`
* Provide an xml component `<idempotent-receiver>`
* Introduce `IdempotentReceiverAutoProxyCreator` to get deal with `IdempotentReceiverInterceptor` and `MessageHandler`s.
The `Proxying` logic is based on the mapping between interceptor and `consumer endpoint` `ids`
* Introduce `MetadataStoreSelector` along side with `MetadataKeyStrategy` and `ExpressionMetadataKeyStrategy` implementation

INT-2426: Introduce `IdempotentReceiver` annotation

Add `IdempotentReceiverIntegrationTests` in the JMX module to be sure that all proxying works well.

INT-2426: Polishing according PR comments

* Rename `IdempotentReceiverAutoProxyCreatorInitializer`
* Add support for several `IRI` for the one `MH`
* Polishing JavaDocs

INT-2426: Add `What's New` note

Doc Polishing.

More Doc Polishing

Use Timestamp (hex) instead of Id for Value

Facilitate cleanup.
2014-10-24 15:53:05 -04:00
Gary Russell
6e81950236 Update Spring AMQP to 1.4.0.RC1 2014-10-23 14:49:23 -04:00
Artem Bilan
134aa5923e INT-3521 completions for ChannelInterceptorList
JIRA: https://jira.spring.io/browse/INT-3521

INT-3521: Rework invocation `index` to the `Deque` of invoked interceptors

Conflicts:
	src/reference/docbook/whats-new.xml

INT-3521: Address PR comments

Create an `interceptorStack` only if there are `interceptor` on the channel.
Invoke `afterSend(Receive)Completion` only `if (interceptorStack != null)`

Minor Doc Polishing
2014-10-22 17:49:48 -04:00
Artem Bilan
fa03c6f268 INT-267: Implement Routing Slip Pattern
JIRA: https://jira.spring.io/browse/INT-267

The implementation looks like:
* There is the `ROUTING_SLIP` header to keep the list of bean ids;
* The `ROUTING_SLIP_INDEX` header keeps track of current `index` in the `ROUTING_SLIP` header;
* `ROUTING_SLIP` List can contain channel names or bean references for the `RoutingSlip` strategy implementations.
They are differentiated with `@` prefix;
* The `<header-enricher>` adds `<routing-slip>` sub-element to specify the comma-delimited value for desired `ROUTING_SLIP` for the downstream flow;
* The `AbstractReplyProducingMessageHandler` adds the logic to get deal with `ROUTING_SLIP` List and the algorithm is:
    - If `ROUTING_SLIP` isn't `null` we build `AtomicInteger` for the current `routingSlipIndex`;
    - the recursive `getReplyChannelFromRoutingSlip` should return a channel name or `null`;
    - if current `ROUTING_SLIP_INDEX` if for the `RoutingSlip` strategy, we check its result for `null` and `incrementAndGet()` the current index or not;
    - for the simple channel name value from `ROUTING_SLIP` list we just `incrementAndGet()` the current index and return the value;
    - the new `ROUTING_SLIP_INDEX` is populated to the headers of new reply message.
* Polishing for `AbstractMessageSplitter`

**TODO**: Docs and applying `RoutingSlip` algorithm for the `AbstractCorrelatingMessageHandler`

INT-267: Move `replyProducing` logic `ARPMH` -> `AMPH`

* Rework `AbstractCorrelatingMessageHandler` to use methods from super class
* Rework `MessageHandlerChain.ReplyForwardingMessageChannel` to use `produceReply`
* Rename `RoutingSlip` -> `RoutingSlipRouteStrategy`
* Add `ExpressionEvaluationRoutingSlipRouteStrategy`

Now `routingSlip` header can be configured like:

```
<routing-slip value="channel1; #{@routingSlipRoutingPojo.get(request, reply)}; @routingSlipRoutingStrategy; #{request.headers[myRoutingSlipChannel]}; channel6"/>
```

Where `;` is used as delimiter, because of `,` in the method invocation from SpEL.
The simple literal (`channel1`) is just a `MessageChannel` `id`.
`@` is used for `RoutingSlipRouteStrategy` bean reference.
`#{...}` used for SpEL.
The `HeaderEnricherParserSupport` parses this `value` to the `List<String>` - a set of bean names, where any SpEL is wrapped
to the `ExpressionEvaluationRoutingSlipRouteStrategy` bean definition

INT-267: Introduce `RoutingSlip` Domain class

Rename `AbstractMessageProducingHandler` methods: `*reply` -> `*output`

Conflicts:
	src/reference/docbook/whats-new.xml

INT-267: Rework `RoutingSlip` -> `Map<List<String>, Integer>`

Since `RoutingSlip` POJO isn't scalable in the distributed multi-language environment,
it would be better to use some Java generic type for this `ROUTING_SLIP` header.

The `Collections.singletonMap(Collections.unmodifiableList(routingSlipPath), 0)` is the best candidate to be convertible to other systems
and allow to have thread-safety.

The `ROUTING_SLIP` header is recalculated now on each `nextPath`

INT-267: Introduce `RoutingSlipHeaderValueMessageProcessor`

* Rework `HeaderEnricherParserSupport` logic to get rid of SpEL parsing
and change `routingSlipPath` to the `ManagedList<String>` to get gain of `property-placehoder`
* Add `<context:property-placeholder>` stuff to the `RoutingSlipTests`

INT-267: Move inline expressions to the implicit `EERSRS` from the `RoutingSlipHeaderValueMessageProcessor`

INT-267: Fix up JavaDocs and add JDBC test-case

INT-267: Address PR comments

INT-267: Polishing according PR comments

Polishing
2014-10-22 15:31:39 -04:00
Artem Bilan
c7286cc991 INT-3535: Fix JmsHM to not override properties
JIRA: https://jira.spring.io/browse/INT-3535

Previously when `DefaultJmsHeaderMapper` overrided values, which had been able to be populated by the `MessageConverter`.

Since `MessageConverter` result has a precedence which is closer to JMS, skip those custom `MessageHeaders` which already has been populated by `MessageConverter`
2014-10-22 11:14:17 -04:00
Gary Russell
4b3836fa09 Speed Up Mongo Build When No Mongo
@Rule used a 10 second connection timeout.

Polishing
2014-10-22 16:06:43 +03:00
Gary Russell
e4f1ee14aa 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__
2014-10-22 12:26:08 +03:00
Artem Bilan
869a8de05f INT-275: Implement Scatter-Gather Pattern
JIRA: https://jira.spring.io/browse/INT-275

In addition fix the `Lifecycle` issue in the `ServiceActivatorAnnotationPostProcessor`

Add Namespace support, Addition tests
   and fix some typos in the XSD

INT-275: Fix failed tests

INT-275: Fix for `replyChannel` Header

Add `sync` reply test-case

INT-275: Make `ScatterGatherHandler` sync

Fix some `MessageHandler`s from `SmartLifecycle`

INT-275: Fix `ScatterGatherHandler.handleRequestMessage` logic

INT-275: Fix `ScatterGatherHandler` JMX proxying issues

* Make `AbstractCorrelatingMessageHandler.getMessageStore()` as `public`
* Move `ScatterGatherHandlerIntegrationTests` to the JMX module to be sure that `ScatterGatherHandler`
works well with `@EnableIntegrationMBeanExport`
* Add xml config sample how to use an internal gatherer's `MessageStore` in the `MessageGroupStoreReaper`
* Add `What's New` notice
2014-10-21 15:14:34 -04:00
Gary Russell
72f68f8c75 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:43:37 +03:00
Gary Russell
176afcf807 INT-3519 Add Poll Skip Advice
JIRA: https://jira.spring.io/browse/INT-3519

Add a mechanism to allow skipping polls, perhaps
because of some downstream condition.

INT-3519: Polishing
2014-10-21 16:31:10 +03:00
Artem Bilan
328bd68702 INT-3516 Fix JPA Build Error
https://build.spring.io/browse/INT-B41-121
2014-10-20 16:02:48 -04:00
Artem Bilan
5f9b04949e INT-3520: Add Reactor's PersistentQueue Support
JIRA: https://jira.spring.io/browse/INT-3520

INT-3520: Use `Condition` to wait items in the `Queue`

INT-3520: Reworking to the `Semaphore(0)`

* Implement 'artificial infinite wait'
* Add distributed test with infinite `receive()`

INT-3520: Correct usage of `Semaphore`

Minor Doc Polishing
2014-10-20 14:17:47 -04:00
Artem Bilan
a3d8776b5c INT-3516: Allow Optional<> in POJO Method Args
JIRA: https://jira.spring.io/browse/INT-3516

* Add `Optional<>` support for `@Header` in the `MessagingMethodInvokerHelper`
* Add `Optional<>` test-case
* Change `sourceCompatibility` for test to the Java 8

INT-3516: Revert SF version to 4.1.1

Add Docs on the matter

Fix WS Tests; Revert StubJavaMailSender
2014-10-20 09:02:06 -04:00
Artem Bilan
c84b16e2b5 Fix Docs issue
https://build.spring.io/browse/INT-B41-119
2014-10-16 12:53:11 +03:00
Artem Bilan
3081c4ac65 Increase receive timeout for some tests
https://build.spring.io/browse/INT-B41-118

Since `send` to the `discardChannel` caused from the separate Thread (`TaskScheduler` from `groupTimeout`)
there is some time window when receiving thread wait on `queue` lock, so `0` timeout to wait isn't enough
2014-10-16 12:27:09 +03:00
Gary Russell
cc78b9ec51 INT-3529 Add 'expire-groups-upon-timeout' to Reseq
JIRA: https://jira.spring.io/browse/INT-3529

Late arriving messages will now be immediately discarded by
default.

INT-3529 Polishing

Move group completion to the Resequencer's `afterRelease()` when
the group is timed out.
2014-10-16 11:42:12 +03:00
Gary Russell
c94a7cff2b INT-3531 Varargs for JavaMailSender
JIRA: https://jira.spring.io/browse/INT-3531

JavaMailSender now uses varargs instead of [].

Also, add spring-context-support as an optional
dependency to avoid reactor pulling in an old version into
the eclipse .classpath.

You cannot exclude transitive dependencies from optional
(reactor) dependencies.
2014-10-15 14:18:20 -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
252c53db4c INT-3527: WebSocket and 'o-c-a' Improvements
JIRA: https://jira.spring.io/browse/INT-3527

* `WebSocketInboundChannelAdapter` now handles `CONNECT` STOMP message and sends `CONNECT_ACK` message to the `WebSocketSession` immediately
* `ExpressionMessageProducerSupport` implementations now checks the result of `expression` and if it is a `Message<?>` it is sent to channel without creating a new one
which previously wrapped that `Message<?>` as the `payload`.
* Add `<script>` support to the `<outbound-channel-adapter>`
* Upgrade to the SF 4.1.1
* Add appropriate notes to the Docs
2014-10-14 11:38:44 -04:00
Artem Bilan
d5f1bb6516 INT-3512: Add <advice-chain> to the Aggregator
JIRA: https://jira.spring.io/browse/INT-3512

INT-3512: Fix typos

INT-3512: add `expire-` prefix to the advice sub-elements

INT-3512: Mark `AggregatorWithCustomReleaseStrategyTests` as `LONG_RUNNING_TEST`

Doc Polishing
2014-10-14 11:30:18 -04:00
Gary Russell
113716effd 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.
2014-10-04 10:11:59 +01:00
Gary Russell
a7b5158f4a INT-3524 Fix Tooling MessageChannel References
JIRA: https://jira.spring.io/browse/INT-3524

A number of references (expected-type) still referred to
the Spring Integration 3.0 MessageChanel.
2014-10-03 07:55:23 +01:00
Artem Bilan
6814aafe48 INT-3511: Document WebSocket Support
JIRA: https://jira.spring.io/browse/INT-3511

Add note about Broker destinations

Doc Polishing

INT-3511: Fix 'useBroker' Docs and provide compatibility with SF 4.1.1
2014-10-01 13:44:13 +01:00