Commit Graph

1937 Commits

Author SHA1 Message Date
Artem Bilan
ea89682368 INT-4252 IntegrationFlow: Allow Custom Bean Names
JIRA: https://jira.spring.io/browse/INT-4252

To allow to provide arbitrary bean names for the intermediate components
in the `IntegrationFlow` change `ComponentsRegistration` to return
a `Map<Object, String>` instead of raw `Collection<Object>`

* Use the value from that map in the `IntegrationFlowBeanPostProcessor` as a
fallback option before walking into bean name generation
* Provide `containerId` option for the AMQP DSL components

* Revert `@AfterClass` in the `AmqpTests`
* Expose `id()` for the `JmsDestinationAccessorSpec`
* Register `ListenerContainer` and `JmsTemplate`
as bean via `ComponentRegistration` in the particular JMS Java DSL components
* Fix `Jms` factory to populate the `JmsDefaultListenerContainerSpec`
for the `messageDrivenChannelAdapter()` without class specified

* Refactor AMQP DSL Inbound components to deal with the new ContainerSpec API
* Remove `containerId()` in favor of `id()` in the ContainerSpec
2017-05-23 14:46:06 -04:00
Gary Russell
799dcaae9f INT-4276: Selective Header Propagation
JIRA: https://jira.spring.io/browse/INT-4276

The `readOnlyHeaders` integration property allows suppression of certain headers
globally.

Add support for suppressing propagation on individual message handlers.
2017-05-22 12:56:55 -04:00
Artem Bilan
ea6cf0f4ef INT-4245: Improve ReplyProducingMHWrapper
JIRA: https://jira.spring.io/browse/INT-4245

* Move `ReplyProducingMessageHandlerWrapper` outside of
`ServiceActivatorAnnotationPostProcessor`.
* Use it from the `ServiceActivatorFactoryBean` as well to fix
the missed `Lifecycle` control
* Increase wait timeout in the `ConnectionFactoryTests`
* Mark endpoint as `auto-startup="false"` in the SFTP parser tests
* Remove redundant `org.gradle.daemon=true` from the `gradle.properties`
since it is like that by default for a while already
2017-05-18 08:37:56 -04:00
Artem Bilan
be98a6c2d0 INT-4274: Improve IntegrationFlow Lifecycle
JIRA: https://jira.spring.io/browse/INT-4274

Since any component from the `StandardIntegrationFlow` can be started
independently, the `StandardIntegrationFlow.stop()` should propagate
the stop control to the target components independently of its previous
`running` state

Javadoc Polishing
2017-05-16 15:33:40 -04:00
Artem Bilan
4dba3065ff INT-4275: Add IntegrationFlowContext.getRegistry
JIRA: https://jira.spring.io/browse/INT-4275

To analyze the state of the `IntegrationFlowContext` provide the access to
its internal `registry`
2017-05-16 08:36:08 -04:00
Artem Bilan
6c2200a03f Revert to B-S versions for base line dependencies
Increase receive timeouts in the `ResequencerTests`
2017-05-15 10:31:08 -04:00
Gary Russell
f4a17886be INT-4272: Read Only Header Improvements
JIRA: https://jira.spring.io/browse/INT-4272

- Honor read only header configuration when building from an unchanged message
- Support adding read only headers to the message builder factory

* Move `IntegrationMessageHeaderAccessor.containsReadOnly()` to the
`MessageBuilder` to avoid confusing

**Cherry-pick to 4.3.x**
2017-05-12 10:44:57 -04:00
Artem Bilan
709cb7fe4c Remove Jackson Imports from JacksonJsonUtils
Since the classes load their imports explicitly we can't use them for
classes which provides utilities to check classpath

* Move imports to fully qualified names in the target utility method

**Cherry-pick to 4.3.x**

Move `JacksonJsonUtils.isPresent` methods to separate `JacksonPresent` class

Polishing
2017-05-11 15:39:47 -04:00
Artem Bilan
9543877c0c Fix FluxMessageChannel for Multi Sources
* Rename `ReactiveConsumer` to `ReactiveStreamsConsumer`
* Rename `FluxSubscribableChannel` to `ReactiveStreamsSubscribableChannel`
* Remove the `processor` functionality from the `FluxMessageChannel`
in favor of internal `FluxSink` as it is recommended by the Project Reactor:
> Most of the time, you should try to avoid using a Processor.
They are harder to use correctly and prone to some corner cases.

* Make connectable, upstream publishers for the `FluxMessageChannel` as
bridges to the internal `sink` via `this::send`.
This way we are able to receive data from multi sources.
When the source is completed (e.g. `Mono` in case of WebFlux response),
the downstream flow isn't completed.
* Rework `MessageChannelReactiveUtils#PollableChannelPublisherAdapter`
to be based on the `Flux.create()` and `onRequest()` to poll channel for messages
* Add one more request to the `ReactiveHttpRequestExecutingMessageHandler`
to be sure that we consume different `Mono`s by the `FluxSubscribableChannel`
properly without completion
* Upgrade to the `spring-io-plugin:0.0.7.RELEASE`

Add `IntegrationConsumer` implementation to the `ReactiveStreamsConsumer`
2017-05-10 14:02:35 -04:00
Artem Bilan
7e919a4017 INT-4267: Add JSON (De)Serializers for Messaging
JIRA: https://jira.spring.io/browse/INT-4267
Fixes: spring-projects/spring-integration#2110

The documentation clearly point that we can simply use JSON (de)serialization
with the `RedisMessageStore`, but actually it isn't so easy

* Fix `MessageGroupMetadata`, `MessageHolder`, `MessageMetadata` for Jackson
deserialization compatibility
* Add `MessageHeaders`-based ctor to the `AdviceMessage`
* Add `MessageHeadersJacksonSerializer` to serialize `MessageHeaders`
to the `HashMap` for easier deserialization afterwards
* Add deserializer implementations for all `Message` types
* Add convenient `JsonObjectMapperProvider#jacksonMessageAwareMapper()`
factory method to build `ObjectMapper` supplied with mentioned above
(de)serializers

**Cherry-pick to 4.3.10 without `MessageHolder` and `MessageMetadata`**

Address PR comments and document the feature

Doc Polishing
2017-05-10 10:31:46 -04:00
Artem Bilan
aca97e7025 Fix Race Condition in TxSyncQueueChannelTests
https://build.spring.io/browse/INT-MASTER-653

The test-case uses only 1 second to wait for the message
in the `QueueChannel`.
That isn't enough on slow environment like CI causing failure for
the current test and unexpected value in the queue for the subsequent
tests

* Fix timeouts
* Get rid of `CountDownLatch` - the same is done by the wait on queues
* Purge queue in between tests.
This way we may not have failed subsequent test, thus failure analyze
will be much easier
* Rework `testRollback()` to wait for good result after one retry over
rollback
* Remove duplicate bean definition from XML config

**Cherry-pick to 4.3.x and 4.2.x**
2017-05-08 16:13:07 -04:00
Gary Russell
2b4c343eaa INT-4270: CGLib Compatibility
JIRA: https://jira.spring.io/browse/INT-4270

Initial Commit

Remove `final` modifier from certain critical framework methods that prevent CGLib proxies working.

Since Spring Boot 2.0 now uses proxyTargetClass=true by default (and has done that for
transactional proxies since 1.4), we must relax these restrictions so that CGLib can
proxy channels (which is often done to make subflows run in a transaction).

When CGLib can't override a `final` method, the fields used within those methods are uninitialized.
In the case of `AbstractMessageChannel` this causes an NPE on the unitiallized `dataTypes` field.
With `MessageHandler`, fields like `shouldTrack` are always false.

Further, methods on `IntegrationObjectSupport` - such as `getComponentName()` return null.

I have left setters and `afterPropertiesSet` (on IOS) `final` since these will typically be called
before the object is proxied.

I suspect there will be other methods we need to open up, but perhaps we should only do them on-demand.

__cherry-pick to 4.3.x__
2017-05-05 09:37:18 -04:00
Gary Russell
572467b1c4 INT-4260: MessagePublishingErrorHandler Orig. Msg
JIRA: https://jira.spring.io/browse/INT-4260

MPEH: Populate the `ErrorMessage.originalMessage`,
if available and not the same as the `failedMessage`.

Polishing - rename exception to `MessagingExceptionWrapper`;
 make `MPEH` a subclass of `ErrorMessagePublisher`

PR Comments

Polishing - PR Comments
2017-05-03 16:32:49 -04:00
Artem Bilan
18f9fcbb59 INT-4259: ACorrelationMH: WARN group reschedule
JIRA: https://jira.spring.io/browse/INT-4259

Since DEBUG can switched off for the application, it becomes difficult
to determine the wrong configuration for the discard flow from
the scheduler thread.

* Change logging level to the `WARN` and log the full stack-trace as well
to give more information about the reason of rescheduling group for
`forceComplete`

**Cherry-pick to 4.3.x**
2017-05-03 10:04:52 -04:00
Artem Bilan
f03356ccbc INT-4265: Add Java DSL .routeByError() EIP-Method
JIRA: https://jira.spring.io/browse/INT-4265

* Add `.routeByError()` EIP-method to the `IntegrationFlowDefinition`
based on the `ErrorMessageExceptionTypeRouter`
* Add missed `dynamicChannelLimit()` option to the `RouterSpec`
* Rework `RouterSpec#RouterMappingProvider` into the `ContextRefreshedEvent`
phase initialization to be sure that dependent `MappingMessageRouterManagement`
is fully initialized before applying mapping conversions

* Rename `routeByError()` to `routeByException()` to more reflect reality
of the `ErrorMessageExceptionTypeRouter` and don't mislead about
Java's `Error`
* Polish `ErrorMessageExceptionTypeRouter` JavaDocs a bit and some Java 8
code style
* Add `ApplicationContext` assertion into the
`RouterMappingProvider.onApplicationEvent()` do not trigger delegate
initialization if `ContextRefreshedEvent` is from the different app context
2017-05-02 14:26:04 -04:00
Gary Russell
ca231763a3 Rename ReactiveChannel
- as discussed last week

TODO:
- should we take the channel outside of the `AbstractMessageChannel` hierarchy?
  - avoid blocking interceptors
  - we would lose channel metrics though
- rename `ReactiveConsumer` ?

Polishing some missed renaming
2017-05-01 13:45:35 -04:00
Artem Bilan
b869666021 INT-4261: Do not Register Resource to TX Twice
JIRA: https://jira.spring.io/browse/INT-4261

When we have some `Advice` withing TX Advice which may perform `doPoll()`
several times, we unconditionally call
`transactionSynchronizationFactory.create(resource)`.
With the out-of-the-box implementations
`DefaultTransactionSynchronizationFactory` and
`PassThroughTransactionSynchronizationFactory`
we preform `TransactionSynchronizationManager.bindResource()`.
If resource is already there, an `IllegalStateException` is thrown

* Check that resource isn't bound already to the TX and don't create a new
`TransactionalResourceSynchronization` - just return `null`
* Check in the target users for the `null` before registering synchronization

Move resource registration to TX outside of out-of-the-box factories

* Fix condition in the `AbstractPollingEndpoint` for the resource
* Increase responsiveness of TX test to decreasing `fixed-delay`
and using `receive-timeout="-1"`
2017-04-28 12:56:03 -04:00
Artem Bilan
026484c382 Compatibility with the latest dependencies
* Upgrade to Gradle 3.5, SS-5.0, Hibernate-5.2.10, Mockito-2.7.22, Pah-1.1.1
And some other minor upgrades
* Fix deprecations for Mockito compatibility
* Fix `ServletWebSocketHandlerRegistry` deprecations
* Fix SD-Mongo deprecations
* Tweak JMX tests to avoid dangling threads after tests exist
* Increase timeouts in some polling tests
2017-04-26 11:29:18 -04:00
Artem Bilan
3c047c5076 INT-4264: .publishSubscribeChannel(): fix order
JIRA: https://jira.spring.io/browse/INT-4264

When we use Java DSL `.publishSubscribeChannel()`, we expect that subscribers
will be called in the order they are defined in the flow.
But actually everything is depend on the populated `MessageHandler` implementation.
The `AbstractMessageHandler` implements `Ordered` and according the
`OrderedAwareCopyOnWriteArraySet` logic they are placed in the beginning of the
handlers set, meanwhile all others (un-ordered) are moved to the end.

* Add implicit `.bridge()` to all the subFlows added to the `PublishSubscribeSpec`.
This way all the subFlow subscribers will be ordered the same way (because of
`BridgeHandler`) and, therefore, will be preformed in the expected (as declared) order
2017-04-25 14:28:11 -04:00
Gary Russell
c66540593c INT-4257 Polishing - Subclasses: buildErrorMessage
JIRA: https://jira.spring.io/browse/INT-4257

So that subclasses can also generate error message for conditions such
as message conversion errors.

Polishing - PR Comments

Fix JMS buildErrorMessage Override

Update Copyrights
2017-04-24 13:35:13 -04:00
Artem Bilan
71b93987d7 INT-4257-2: Document ErrorMessagePublisher
JIRA: https://jira.spring.io/browse/INT-4257

* Remove deprecated `EnhancedErrorMessage`
* Document `ErrorMessagePublisher` and `ErrorMessageStrategy`
* Fix Reactor version to `3.1` in Doc
* Fix sample about Reactive Streams in the `router.adoc`
2017-04-20 11:52:40 -04:00
Artem Bilan
28058884f4 INT-4257: Introduce ErrorMessagePublisher
JIRA: https://jira.spring.io/browse/INT-4257

To make a target `ErrorMessage` customizable introduce
`ErrorMessagePublishingRecoveryCallback` and
`ErrorMessageStrategy` to inject

**Cherry-pick to 4.3.x**

Fix `ErrorMessagePublishingRecoveryCallback` generic type for
`RequestHandlerRetryAdvice` compatibility

Polishing

- Support publishing when no retry context is available
- Use a constant for the message context key

Add EnhancedErrorMessage

- contains input message at time of error message generation
- make the default RecovererErrorMessageStrategy public and extensible

Fix `RetryAdviceParserTests` for new `RecoveryCallback` architecture

Rename to `ErrorMessagePublisher`
Decouple ErrorMessagePublisher from Retry

Refactoring for better purpose reflection and JavaDocs

Use `ErrorMessageStrategy` in message producers.

Add JavaDocs to the `DefaultErrorMessageStrategy`

Deprecate EnhancedErrorMessage

Minor Polish for Subclass Use

- make setters final
- allow subclasses to supply the AttributeAccessor

Fix Tests
2017-04-19 17:54:32 -04:00
Artem Bilan
34db64c832 INT-4254: LockRegLInit: Fix unconditional unlock
JIRA: https://jira.spring.io/browse/INT-4254

The `LockRegistryLeaderInitiator#LeaderSelector` unconditional calls
`unlock()` in the `finally` block when the `Lock` might not be locked.

Another problem that `running = true` is set after submitting `LeaderSelector` task.
That might bring the problem that `LeaderSelector` won't be selected because of
`this.running` race condition

* Move `this.running = true` before submitting `LeaderSelector` task
* Move `unlock()` into the `if (this.locked)` condition

**Cherry-pick to 4.3.x**
2017-04-18 15:22:40 -04:00
Gary Russell
c5e66ec65c Fix Promise->Mono Test Name and Beans 2017-04-16 13:33:31 -04:00
Gary Russell
effca79f3f Upgrade to Reactor 3.1
Polishing

- remove catch from test
- update netty for stomp

Add reactiveErrorHandler to AbstractMessageHandler
2017-04-14 22:14:21 -04:00
Gary Russell
f751398cfe ARFOGateway: Directory LiteralExpression->Value...
Using a `LiteralExpression` in the `AbstractRemoteFileOutboundGateway` (when the
user provides a `File` for the directory) causes us to create a new `File` object
each time, instead of using the user-supplied `File`.

Use a `ValueExpression` instead.

Move the `FileWritingMessageHandler` logic to `ExpressionUtils` and use it from both places.

Also add a String setter variant for convenient Java Configuration.
2017-04-06 11:42:22 -04:00
Artem Bilan
d5c633d703 Fix LockRegLeaderInitiatorTests race condition
https://build.spring.io/browse/INT-FATS5IC-129/

Since leader selection is done on background thread in the
`LockRegistryLeaderInitiatorTests`, there is no guarantee that
after `Thread.sleep(100)` the lock will be obtained and leader state is
changed.

* Waiting for the `granted` `CountDownLatch` is much robust condition
2017-04-06 10:47:22 -04:00
Artem Bilan
19c5402079 INT-4208: Add WebFlux-Based HttpMessageHandler
JIRA: https://jira.spring.io/browse/INT-4208

Since `AsyncRestTemplate` is deprecated in Spring 5.0, it doesn't make
sense to promote that feature via our new `AsyncHttpRequestExecutingMessageHandler`
component

* Rework (and rename) `AsyncHttpRequestExecutingMessageHandler` to
`ReactiveHttpRequestExecutingMessageHandler` and make it based on the
WebFlux `WebClient`
* Fix Java DSL (`ReactiveHttpMessageHandlerSpec`) and all tests according a new
logic in the `ReactiveHttpRequestExecutingMessageHandler`
* Fix XML namespace support to use new `ReactiveHttpRequestExecutingMessageHandler`
and don't expose unused options like `converters` and `request-factory`
* Fix `What's New` and `http.adoc`
* To remain with `async` mode for the `ReactiveHttpRequestExecutingMessageHandler`
behavior support fix `AbstractMessageProducingHandler` to adapt reply `Mono`
to the `SettableListenableFuture`
* Introduce new `reactive` behavior for the `AbstractMessageProducingHandler`
when `outputChannel` is `ReactiveSubscribableChannel` and perform
`.subscribeTo(Publisher)` for `Publisher` reply
* Upgrade to Spring AMQP `2.0 M3`
* Downgrade to Spring Security `4.2.2`

Address PR comments

Add async error handling to the one-way case

Minor polishing and checkstyle fix
2017-04-05 13:00:50 -04:00
Artem Bilan
499e1167d1 Upgrade to Reactor-3.0.6
According to some rework and deprecations in the latest Reactor,
fix Reactor-based components to follow with the latest paradigmas

* Use `Flux` wrapper in the `ReactiveChannel` to track cancellation
instead of deprecated `Operators.SubscriberAdapter`
* Do similar `Flux.from(publisher)` in the `doSubscribeTo()`
to avoid subscribers delegation and, therefore, unnecessary call stack
* Rework `ReactiveConsumer` to wrap to a new `BaseSubscriber`
on each `ReactiveConsumer.start()`.
We need this wrapping to prevent subscriber cancellation from the
upstream `Publisher` on error.
We can't rely here on the `Flux.retry()` because upstream
`DirectProcessor` is marked as terminated on any error

Apply Reactor-3.0.6.RELEASE
2017-04-04 10:06:08 -04:00
Artem Bilan
8902fb9489 Fix DisposableBean omission for Java DSL
http://stackoverflow.com/questions/43193858/tomcat-hangs-shutting-down-with-spring-integration-java-dsl

Using manual singleton registration doesn't provide automatic
`DisposableBean` registration

* Improve `IntegrationFlowBeanPostProcessor` to register `DisposableBean`  as well
* Improve `IntegrationFlowContext` to register `DisposableBean`  as well
2017-04-03 19:36:01 -04:00
Artem Bilan
2862c449c5 INT-4251: Add Initial Testing Framwork and Docs
JIRA: https://jira.spring.io/browse/INT-4251

MockIntegration PoC

Demonstrate how `MockIntegration.mockMessageSource()` can be used.
Even from the XML Config!
The same semantics can be applied for any other our mocking features we will add to the `MockIntegration`

Add `testMockMessageSourceDynamicFlow()`

Improve `MockIntegration.Context.instead()` for target bean type assertion

Some refactoring, improvements and JavaDocs

* Move `MockIntegration.Context` to its own `MockIntegrationContext` class
* Rename `@MockIntegrationTest` to `@SpringIntegrationTest` since we talk there not only about mocks, but any other possible testing feature for integration
* Add `@SpringIntegrationTest#stopEndpoints()` attribute for endpoints bean names patterns
* Add `IntegrationEndpointsInitializer` to customize `AbstractEndpoint`s according options from the `@SpringIntegrationTest`
Right now it is only about making them `autoStartup = false`

* Rename `SI-test` to `SI-test-support`
* Rename `SI-mock` to `SI-test`
* Rename `@SpringIntegrationTest#stopEndpoints()` to `noAutoStartup()`
* Fix JavaDocs according PR comments
* Increase timeouts in some sporadically failed tests
* Draft for the `testing.adoc`

Fixes spring-projects/spring-integration-java-dsl#23

Fix `testing.adoc` a bit

* Document Testing Support
* Fix a couple typos in the `xml.adoc`
* Add `package-info.java` files to `/test/` sub-packages

Improve docs according PR comments

Fix typos in `TestUtils` JavaDocs

Add `What's New` note about Java DSL and Testing support

Doc Polishing
2017-03-31 14:39:08 -04:00
Gary Russell
610ad7e0e1 JavaConfig/DSL Docs for Routers (Part 2) (#2104)
* JavaConfig/DSL Docs for Routers (Part 2)

Add String Expression ctor to `ExpressionEvaluatingRouter`.

* Polishing - PR Comments
2017-03-30 15:18:22 -04:00
Gary Russell
fac04aeece INT-4250: Fix Statistics Mean Decay with Time
JIRA: https://jira.spring.io/browse/INT-4250

When retrieving the mean from `ExponentialMovingAverageRate` or
`ExponentialMovingAverageRatio` via `getStatistics()` the mean did not
decay over time.

The mean did decay when using `getMean()`.

This was caused by the statistics performance refactoring.
2017-03-29 13:52:54 -04:00
Paul Martin
85aead337f INT-4241: Wrap ArrayNodes with ArrayNodeAsList
JIRA: https://jira.spring.io/browse/INT-4241

To allow `ArrayNode` to be treated as `List` in SpEL expressions, wrap them to the internal `ArrayNodeAsList` implementation

Fix Checkstyle errors

* Add `iterator()` support to the `ArrayNodeAsList`
2017-03-27 17:33:43 -04:00
Gary Russell
e9c4bb95a4 Eclipse/JDT Type Inference Workaround in Test
- Remove an unused type argument
- Add a missing type argument
2017-03-24 15:55:48 -04:00
Artem Bilan
78bab07874 Java DSL polishing around HeaderEnricherSpec
* Make `HeaderEnricherSpec extends ConsumerEndpointSpec` to avoid extra
EIP-method with two `Consumer`s, when only one for
the `HeaderEnricherSpec` can address all the options - header enricher,
as well as target endpoint
* Move `this.endpointFactoryBean.setHandler(this.handler)` into
the `ConsumerEndpointSpec#doGet()` instead of ctor to avoid
duplicate code from the target implementations (e.g. `BarrierSpec`)
2017-03-23 13:32:41 -04:00
Artem Bilan
df9593a528 INT-4244: Optimize JpaOutboundGateway for Message
JIRA: https://jira.spring.io/browse/INT-4244

The `JpaOutboundGateway` returns a whole `Message` for reply copying request headers.
Building the reply a `AbstractMessageProducingHandler` uses `MessageBuilder` to create a new `Message` with all request headers because of `shouldCopyRequestHeaders() == true`

* To avoid some overhead with new `Message` and `MessageBuilder` for nothing, just return a JPA result as is and let super class to build the Message

* Optimize all reply producers to return `MessageBuilder` to the super `handleMessage()` process
* Return the whole `gatherResult` `Message<?>` from the `ScatterGatherHandler` to have ability to transfer reply headers as well
* Mark `DelayHandler`  as `shouldCopyRequestHeaders() return false` since it doesn't modify Message and returns it as is after delay
2017-03-23 11:40:25 -04:00
Artem Bilan
752fe0356f Reinstate warns for publish events from Initiator
JIRA: https://jira.spring.io/browse/INT-4220,
https://jira.spring.io/browse/INT-4246

* Stop one more internal `initiator` in the `LockRegistryLeaderInitiatorTests`
2017-03-23 11:39:07 -04:00
Vedran Pavic
fb7e4d6869 INT-4246: Revoke leader when lock isn't acquired
JIRA: https://jira.spring.io/browse/INT-4246

The `LockRegistryLeaderInitiator` currently does not revoke leadership
when leading instance is unable to acquire lock from the underlying lock.
This can result in multiple `LockRegistryLeaderInitiator` instances becoming
 leaders in the exceptional situations such as lock timeouts.

* Handle leadership revoking when leading `LockRegistryLeaderInitiator`
is unable to acquire lock

Polish javadoc

**Cherry-pick to master**

Conflicts:
	spring-integration-core/src/main/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiator.java
	spring-integration-core/src/test/java/org/springframework/integration/support/leader/LockRegistryLeaderInitiatorTests.java

* Stop initiators in the end of test
2017-03-23 11:06:12 -04:00
Ian Bondoc
6616242831 Support for request sub-flow in content enricher
Fixed issues as per code review and added a test for terminating sub flow

Simplified implementation of enricher sub flow and simplified tests

Polishing
2017-03-23 09:55:50 -04:00
Artem Bilan
3a98b1c974 Refactoring for some DSL methods
To avoid some extra methods and let to operate with more cleaner API, merge some specs to single entity

* Make `EnricherSpec` and `AbstractRouterSpec` as `extends ConsumerEndpointSpec`
* Remove extra methods in the `IntegrationFlowDefinition`
* Provide refactoring and fixed to `enrich()` and `route()` functions according the `ConsumerEndpointSpec` merge
* Port `TransformerTests` from SI-Java-DSL project
2017-03-20 17:57:10 -04:00
Gary Russell
70652739b8 JavaConfig/DSL Docs for Routers (Part 1)
Also fix DSL messing `sendTimeout` property for routers.
Since other message handlers have this property on the `ConsumerEndpointSpec`, add support there
instead of `RouterSpec`, for consistency.
Also fix `ConsumerEndpointSpec` `sendTimeout` - can be applied to any
`AbstractMessageProducingHandler`, not just `AbstractReplyProducingMessageHandler`.
Ditto for `async`.

Polishing
2017-03-20 13:04:56 -04:00
Gary Russell
c85b9cbb20 Add JavaConfig Docs for Delayer
Also add `setDelayExpressionString()`.
2017-03-17 14:28:30 -04:00
Artem Bilan
8da89c7cce INT-4100: Improve RequestReplyExchanger
JIRA: https://jira.spring.io/browse/INT-4100

* Add `throws MessagingException` to the `RequestReplyExchanger` to make it fully messaging contract based
* Add test to the `ServiceActivatorDefaultFrameworkMethodTests` to demonstrate how many info is in the stack trace after `RequestReplyExchanger`
* Document how to be with the `throws` clause in custom gateways
* Fix `boolean` attributes in the `spring-integration-5.0.xsd`

* Fix `AbstractChannelAdapterParser` do not populate endpoint attributes if component is nested
* Fix typo in the `AmqpOutboundChannelAdapterParserTests`
* Increase timeouts in the  `MixedDispatcherConfigurationScenarioTests`

Reinstate `auto-startup` to none by default.
 Not all components expects `true` by default in their initial state

Also https://jira.spring.io/browse/INT-3432

Document the behavior of the `throws` clause on gateway method

Remove unrelated `bridge` id from the `<chain>`

Add What's new about  `RequestReplyExchanger` changes

Doc Polishing.
2017-03-14 18:11:32 -04:00
Artem Bilan
d3fb8b8f9e INT-4192: Improve ExprEvaluatingReleaseStrategy
JIRA: https://jira.spring.io/browse/INT-4192

To avoid implicit overhead for loading messages from persistent message store, use entire `MessageGroup` as root object for expression evaluation context

Also see https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-4.3-to-5.0-Migration-Guide
2017-03-14 15:02:45 -04:00
Artem Bilan
b3f461e139 INT-4018: Resolve some TODOs
JIRA: https://jira.spring.io/browse/INT-4018

* Resolve some TODOs as expected
* Remove some as logically or physically with useless effort
* Leave others for future considerations
2017-03-14 12:30:47 -04:00
Andreas Baer
3aa830b7c0 INT-4101: failedMessage on TX failure in pollers
JIRA: https://jira.spring.io/browse/INT-4101

Document `PassThroughTransactionSynchronizationFactory`

Copyright year and author name added

Documentation improved

Polishing
2017-03-09 14:24:42 -05:00
Yi EungJun
2ca05b3c44 fix a typo
s/configfuring/configuring/
2017-03-08 09:32:12 -05:00
Gary Russell
37683f1b80 INT-4219: Test Polishing
JIRA: https://jira.spring.io/browse/INT-4219

- Use `AdditionalAnswers.returnFirstArgument` instead of lambda to return first arg
- Enable CheckStyle `AvoidStaticImport` for tests
- Fix static import violations in tests
2017-03-06 11:13:39 -05:00
Artem Bilan
dd0c426d14 Fix EnableIntegrationTests to use regex matcher
https://build.spring.io/browse/INT-MASTER-575

Looks like SpEL compiles classes to name with unpredictable number
2017-03-03 22:35:25 -05:00