Commit Graph

9623 Commits

Author SHA1 Message Date
Artem Bilan
b3087b4fc8 Remove Gradle "fix"-scripts for Checkstyle rules 2016-04-25 13:18:53 -04:00
Gary Russell
564eb165d1 INT-3993: Add Error Flow Logic to Object Map
JIRA: https://jira.spring.io/browse/INT-3993

Does not include "standard" `errorChannel` routing from pollers,
this is implied.
2016-04-25 13:12:27 -04:00
Gary Russell
2370296b95 INT-3967: Add contentDescriptor to Object Model
JIRA: https://jira.spring.io/browse/INT-3967

Polishing

Polishing

Polishing - remove componentName
2016-04-25 13:11:22 -04:00
Gary Russell
439559f255 INT-3994: Add Option to Map MimeMessage
JIRA: https://jira.spring.io/browse/INT-3994

If a header mapper is injected into the mail receiver, a mapped
message is result instead of a message with the raw `MimeMessage`.

`MimeMessage` properties are mapped as discrete headers; in addition
the raw email headers are provided as a multivalue map in the headers.

Handle Multipart

Since a Multipart content has a reference to the original MimeMessage,
convert to a simple byte[] by default.

Add an option in case the user wants to map the message but still
interpret the Multipart intact.

Namespace and Docs

Polishing

Polishing - PR Comments
2016-04-22 18:01:02 -04:00
Artem Bilan
8df487c96f INT-3991: Add IntegrationGraphController
JIRA: https://jira.spring.io/browse/INT-3991

* Add `IntegrationGraphController` `@RestController` over `IntegrationGraphServer` bean
* Add `@EnableIntegrationGraphController` and `<int-http:graph-controller>` to register
`IntegrationGraphController` if the `DispatcherServlet` is in classpath.
* Also register the `IntegrationGraphServer` bean from the same place, if that isn't presented in the application context yet.
* Allow to configure the "root" `path` for the `IntegrationGraphController` as a placeholder value via
`spring.integration.graph.controller.request.mapping.path` property
* Add tests for both `@EnableIntegrationGraphController` and `<int-http:graph-controller>` cases based on the `MockMvc`
2016-04-22 17:34:21 -04:00
Gary Russell
b84747b090 INT-3989: WatchService Scanner Fix Checkstyle 2016-04-22 14:26:01 -04:00
Gary Russell
06703c8368 Fix WatchService Scanner Tests 2016-04-22 14:17:37 -04:00
Artem Bilan
7b1f77ac1f INT-3989: WatchServiceDirectoryScanner Improvement
JIRA: https://jira.spring.io/browse/INT-3989,
https://jira.spring.io/browse/INT-3990,
https://jira.spring.io/browse/INT-3988

INT-3989: Add `FileReadingMessageSource.WatchServiceDirectoryScanner`

* Deprecate top-level `WatchServiceDirectoryScanner` because of inconsistency around `Lifecycle` and shared `directory` property
* Copy/paste its logic into the `FileReadingMessageSource.WatchServiceDirectoryScanner` to hide that inconsistency, but still get a gain from the `WatchService` benefits
* Add support for the `StandardWatchEventKinds.ENTRY_MODIFY` and `StandardWatchEventKinds.ENTRY_DELETE` events in the `FileReadingMessageSource.WatchServiceDirectoryScanner`
* Introduce `useWatchService` option to switch to the internal `FileReadingMessageSource.WatchServiceDirectoryScanner`
* Make `CompositeFileListFilter` also as `ResettableFileListFilter`
* Deprecate weird `FileReadingMessageSource.onSend()` method and remove its usage from tests
* Modify `WatchServiceDirectoryScannerTests` for the new logic
* Document changes

Add `MODIFY` and `DELETE` test coverage

Optimize the `filesFromEvents()` logic replacing item with the fresh event sources.
Remove the item from the result set in case of `DELETE` event, because file removal generates both `MODIFY` and `DELETE` events.

* Add `FileReadingMessageSource.setWatchEvents` to allow to listen to the specific events,
not only `CREATE` or all of them.
* Modify tests and docs to reflect the new API

Address PR comments

* Improve `FileReadingMessageSource.setWatchEvents()`
* Add `file.exists()` before adding file from event.

Add more DEBUG logs into the `WatchServiceDirectoryScanner`

With the fact of those logs provide more optimizations:
* Don't register the same directory for watching:
  - use the `ConcurrentMap<Path, WatchKey> pathKeys` to track registrations
  - any modification within the directory causes the `ENTRY_MODIFY` for the directory as well.
    So, skip such an event exactly for the directory during `walkDirectory`
* Add debug logs in case of `ENTRY_DELETE`
2016-04-22 13:29:10 -04:00
Gary Russell
379a8a2d0b Async AMQP Tests: Purge ackChannel
Since acks may arrive after the timeout and therefore won't be
delivered to the ackChannel, purge the channel to clear it
instead of waiting for the acks, before stubbing the template.
2016-04-22 12:43:24 -04:00
Gary Russell
a98ce143e2 Async AMQP Test - Always Get the Ack First 2016-04-22 12:33:48 -04:00
Gary Russell
c1092e7f15 Fix Test and Add Diagnostics
https://build.spring.io/browse/INT-MJATS41-608/
2016-04-22 10:10:10 -04:00
Artem Bilan
cfdfa62745 Fix some latest test failures
https://build.spring.io/browse/INT-B43-164/

* Fix CheckStyle for `System. out .println(` expression commenting out such a code line
* Fix generics in the `JdbcMessageStoreTests`
* Increase receive timeout in the `FileMessageHistoryTests`
* Change the `AsyncAmqpGatewayTests` logic to deal with the same channel for both `ack/nack`.
The `timeout` case without reply may end up with the `Consumer cancel`, therefore `nack` not `ack` like we expected
2016-04-21 19:03:35 -04:00
Artem Bilan
286c421c1a INT-3387: MessageGroupStore Improvements
JIRA: https://jira.spring.io/browse/INT-3387,
https://jira.spring.io/browse/INT-3806

* Introduce
```
MessageGroupStore

void addMessagesToGroup(Object groupId, Message<?>... messages);
```
And implement it in all stores.

* Use new `addMessagesToGroup` where it is reasonable, e.g. `DelayHandler`
* Optimize test-case to use a new store method (where it is possible)
* Fix timing delays in the `JdbcMessageStoreTests`
* Introduce `PersistentMessageGroup`
* Add `AbstractMessageGroupStore#proxyMessageGroupForLazyLoad` to wrap the raw `MessageGroup` to the `PersistentMessageGroup` for lazy-load
* Rework `MessageGroupMetadata` do not be `immutable` and allow to store/restore in the `AbstractKeyValueMessageStore` only the `MessageGroupMetadata`
* Refactor `ResequencingMessageHandler` and `SequenceSizeReleaseStrategy` a bit for better performance when interact with the `MessageGroup`
* Add `AbstractMessageGroupStore#setLazyLoadMessageGroups` to switch off the `lazy-load` behavior and restore the previous full `MessageGroup` logic
* Add `What's New` note and `message-store.adoc` paragraph for the lazy-load functionality

`GroupType.PERSISTENT` and not lazy by default

PR Comments

Fix `JdbcMessageStoreTests` timing issues

Address PR comments

* Add performance test to the `ConfigurableMongoDbMessageGroupStoreTests`
* Add JavaDocs for the `MessageGroupFactory` methods
* Add `log4j.properties` into the `test` MongoDB module for better traceability
* Fix `JdbcMessageStore#getOneMessageFromGroup()` over the `doPollForMessage()` delegation.
The `jdbcTemplate.queryForObject()` requires exactly one and only one raw in `resultSet`
* Add performance test results into the `message-store.adoc`
2016-04-21 17:47:20 -04:00
Artem Bilan
4e4763d24f Fix JavaDos and Compiler warnings
https://build.spring.io/browse/INT-B43-162
2016-04-21 10:25:08 -04:00
Artem Bilan
38274f5ac6 JdbcPollingChannelAdapter: Fix typo and CodeStyle 2016-04-21 10:16:39 -04:00
Artem Bilan
1dc4ebe4d1 INT-4001 Disable some Jackson features by default
JIRA: https://jira.spring.io/browse/INT-4001

Since all other Spring Framework components use the Jackson's `ObjectMapper` configuration by default as:
```
this.objectMapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false);
this.objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
```
It would be better to be consistent in Spring Integration, too.

* Add mention options to the `Jackson2JsonObjectMapper` default's `ObjectMapper`
* Add on more constructor into the `Jackson2JsonMessageParser` to allow to inject customized `Jackson2JsonObjectMapper`
* Modify a couple tests to reflect the change
* Reformat code style in the `AbstractJsonInboundMessageMapperTests` for better readability

**The Migration Guide note follows up**
2016-04-20 17:09:55 -04:00
Artem Bilan
256a7292ef INT-3999: Avoid "hard" References from Futures
JIRA: https://jira.spring.io/browse/INT-3999

Since the scheduled tasks may live for a long time it can finish
with the `OutOfMemory` if we use the direct reference to big objects, like `Message<?>`.

* Fix `AbstractCorrelatingMessageHandler` to deal only with the `groupId`
from the `scheduleGroupToForceComplete()` when we `schedule` `Runnable` for the `forceRelease` logic.
* Fix `DelayHandler` to deal only with `messageId` in the `releaseMessageAfterDelay()`, when we
`schedule` `Runnable` for the `releaseMessageAfterDelay`.
* Since the logic hasn't been changed for those components, there is no any new test.
There is just enough to be sure that all existing tests are fine.

**Cherry-pick to 4.0.x, 4.1.x, 4.2.x**

Optimise the release task for the `SimpleMessageStore` case
2016-04-20 15:55:44 -04:00
Artem Bilan
882f4c017e INT-3998: Channel Late-Binding for WireTap
JIRA: https://jira.spring.io/browse/INT-3998

Do not modify interceptors from the `AbstractMessageChannel`.

They must be declared as beans, too.

Fix [UnusedImport] in the `EnableIntegrationTests`

Doc Polishing
2016-04-20 15:12:42 -04:00
Gary Russell
d8e4a9d114 Fix Partial Stubbing Problem in AMQP Tests
https://build.spring.io/browse/INT-SONAR-1700/

We set up some stubbing on the `AsyncAmqpTemplate` to test nacks
which are not easy to generate on a real broker.

However, some acks might not have been consumed yet - this can cause
partial stubbing errors, depending on timing.

Be sure to consume all acks before stubbing the template.
2016-04-20 14:19:49 -04:00
Artem Bilan
818387f0a4 INT-3982: Fix XSD declaration ambiguity
JIRA: https://jira.spring.io/browse/INT-3982

Also fix some sporadic, timing issues in tests
2016-04-19 08:18:14 -04:00
Gary Russell
9e092d44f7 INT-3996: Fix JdbcChannelMessageStore Javadoc
JIRA: https://jira.spring.io/browse/INT-3996

One of the query provider implementations was missing. To avoid a maintenance
nightmare, simply reference the interface's javadoc which lists all known
implementations.

* Simple `JdbcChannelMessageStore` JavaDocs polishing
* Add `LogAdjustingTestSupport` to the `StompIntegrationTests` to trace failures in the future.
* Also change the test `Start/Stop` messages to the `WARN` level in the `LogAdjustingTestSupport`, because `DEBUG` doesn't work everywhere.
Maybe some logging systems mix misconfiguration, like we have in the WebSocket modules with the Embedded Tomcat
2016-04-18 10:51:10 -04:00
Gary Russell
ae9cfc3ea5 INT-3967: Sonar Issues
https://sonar.spring.io/issues/search#componentRoots=org.springframework.integration%3Aspring-integration|createdAt=2016-04-16T02%3A56%3A21%2B0000|sort=UPDATE_DATE|asc=false
2016-04-16 10:03:33 -04:00
Gary Russell
ed40582121 INT-3967: Expose Object Model
JIRA: https://jira.spring.io/browse/INT-3967,
https://jira.spring.io/browse/INT-3987

Based on the XD FLO object model, each node represents an endpoint or channel.
The graph contains nodes and links where the links represent a connection (publish
or consume) to/from a channel.

From the test case...

```
{
  "nodes" : [ {
    "name" : "three",
    "output" : null,
    "input" : null,
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "sendCount" : 0,
      "sendErrorCount" : 0,
      "timeSinceLastSend" : 0.0,
      "meanSendRate" : 0.0,
      "meanErrorRate" : 0.0,
      "meanErrorRatio" : 0.0,
      "meanSendDuration" : 0.0,
      "minSendDuration" : 0.0,
      "maxSendDuration" : 0.0,
      "standardDeviationSendDuration" : 0.0,
      "sendDuration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "sendRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "errorRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "available" : true
    },
    "componentType" : "channel",
    "componentName" : "three",
    "nodeId" : 1
  }, {
    "name" : "four",
    "output" : null,
    "input" : null,
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "sendCount" : 0,
      "sendErrorCount" : 0,
      "timeSinceLastSend" : 0.0,
      "meanSendRate" : 0.0,
      "meanErrorRate" : 0.0,
      "meanErrorRatio" : 0.0,
      "meanSendDuration" : 0.0,
      "minSendDuration" : 0.0,
      "maxSendDuration" : 0.0,
      "standardDeviationSendDuration" : 0.0,
      "sendDuration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "sendRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "errorRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "available" : true
    },
    "componentType" : "channel",
    "componentName" : "four",
    "nodeId" : 2
  }, {
    "name" : "nullChannel",
    "output" : null,
    "input" : null,
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "sendCount" : 0,
      "sendErrorCount" : 0,
      "timeSinceLastSend" : 0.0,
      "meanSendRate" : 0.0,
      "meanErrorRate" : 0.0,
      "meanErrorRatio" : 0.0,
      "meanSendDuration" : 0.0,
      "minSendDuration" : 0.0,
      "maxSendDuration" : 0.0,
      "standardDeviationSendDuration" : 0.0,
      "sendDuration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "sendRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "errorRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "available" : true
    },
    "componentType" : "channel",
    "componentName" : "nullChannel",
    "nodeId" : 3
  }, {
    "name" : "errorChannel",
    "output" : null,
    "input" : null,
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "sendCount" : 0,
      "sendErrorCount" : 0,
      "timeSinceLastSend" : 0.0,
      "meanSendRate" : 0.0,
      "meanErrorRate" : 0.0,
      "meanErrorRatio" : 0.0,
      "meanSendDuration" : 0.0,
      "minSendDuration" : 0.0,
      "maxSendDuration" : 0.0,
      "standardDeviationSendDuration" : 0.0,
      "sendDuration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "sendRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "errorRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "available" : true
    },
    "componentType" : "publish-subscribe-channel",
    "componentName" : "errorChannel",
    "nodeId" : 4
  }, {
    "name" : "one",
    "output" : null,
    "input" : null,
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "sendCount" : 0,
      "sendErrorCount" : 0,
      "timeSinceLastSend" : 0.0,
      "meanSendRate" : 0.0,
      "meanErrorRate" : 0.0,
      "meanErrorRatio" : 0.0,
      "meanSendDuration" : 0.0,
      "minSendDuration" : 0.0,
      "maxSendDuration" : 0.0,
      "standardDeviationSendDuration" : 0.0,
      "sendDuration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "sendRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "errorRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "available" : true
    },
    "componentType" : "channel",
    "componentName" : "one",
    "nodeId" : 5
  }, {
    "name" : "two",
    "output" : null,
    "input" : null,
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "sendCount" : 0,
      "sendErrorCount" : 0,
      "timeSinceLastSend" : 0.0,
      "meanSendRate" : 0.0,
      "meanErrorRate" : 0.0,
      "meanErrorRatio" : 0.0,
      "meanSendDuration" : 0.0,
      "minSendDuration" : 0.0,
      "maxSendDuration" : 0.0,
      "standardDeviationSendDuration" : 0.0,
      "sendDuration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "sendRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "errorRate" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      },
      "available" : true
    },
    "componentType" : "channel",
    "componentName" : "two",
    "nodeId" : 6
  }, {
    "name" : "producer",
    "output" : "one",
    "input" : null,
    "stats" : null,
    "componentType" : "test-producer",
    "componentName" : "producer",
    "nodeId" : 7
  }, {
    "name" : "polling",
    "output" : null,
    "input" : "four",
    "stats" : null,
    "componentType" : "unknown",
    "componentName" : "unknown",
    "nodeId" : 8
  }, {
    "name" : "foreignMessageHandlerNoStats",
    "output" : null,
    "input" : "three",
    "stats" : null,
    "componentType" : "unknown",
    "componentName" : "unknown",
    "nodeId" : 9
  }, {
    "name" : "_org.springframework.integration.errorLogger",
    "output" : null,
    "input" : "errorChannel",
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "handleCount" : 0,
      "errorCount" : 0,
      "meanDuration" : 0.0,
      "minDuration" : 0.0,
      "maxDuration" : 0.0,
      "standardDeviationDuration" : 0.0,
      "activeCount" : 0,
      "available" : true,
      "duration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      }
    },
    "componentType" : "logging-channel-adapter",
    "componentName" : "_org.springframework.integration.errorLogger",
    "nodeId" : 10
  }, {
    "name" : "services.foo.serviceActivator",
    "output" : "two",
    "input" : "one",
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "handleCount" : 0,
      "errorCount" : 0,
      "meanDuration" : 0.0,
      "minDuration" : 0.0,
      "maxDuration" : 0.0,
      "standardDeviationDuration" : 0.0,
      "activeCount" : 0,
      "available" : true,
      "duration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      }
    },
    "componentType" : "service-activator",
    "componentName" : "services.foo.serviceActivator.handler",
    "nodeId" : 11
  }, {
    "name" : "services.bar.serviceActivator",
    "output" : null,
    "input" : "two",
    "stats" : {
      "countsEnabled" : true,
      "statsEnabled" : true,
      "loggingEnabled" : true,
      "handleCount" : 0,
      "errorCount" : 0,
      "meanDuration" : 0.0,
      "minDuration" : 0.0,
      "maxDuration" : 0.0,
      "standardDeviationDuration" : 0.0,
      "activeCount" : 0,
      "available" : true,
      "duration" : {
        "count" : 0,
        "min" : 0.0,
        "max" : 0.0,
        "mean" : 0.0,
        "standardDeviation" : 0.0,
        "countLong" : 0
      }
    },
    "componentType" : "service-activator",
    "componentName" : "services.bar.serviceActivator.handler",
    "nodeId" : 12
  } ],
  "links" : [ {
    "from" : 7,
    "to" : 5
  }, {
    "from" : 2,
    "to" : 8
  }, {
    "from" : 1,
    "to" : 9
  }, {
    "from" : 4,
    "to" : 10
  }, {
    "from" : 5,
    "to" : 11
  }, {
    "from" : 11,
    "to" : 6
  }, {
    "from" : 6,
    "to" : 12
  } ]
}
```

Polishing

Only include stats if at least counts are enabled.

More Polishing

Polishing

Polishing - PR Comments; isAvailable()->protected

Make isAvailable protected so it doesn't appear in the JSON.

More Polishing - PR Comments

Yet More Polishing

buildGraph() -> private, rebuild() returns graph
2016-04-15 12:57:46 -04:00
Artem Bilan
3638275783 Fix Error Handling chapter typos 2016-04-14 18:31:29 -04:00
Gary Russell
4027b38da8 Remove System.out/.err Calls From All Tests 2016-04-14 16:22:45 -04:00
Artem Bilan
e5bf0187eb INT-3980: Don't Require @Component for Messaging
JIRA: https://jira.spring.io/browse/INT-3980

When we declare our components via `@Bean` (or `<bean>`) the requirements for
the `@Component` (`@MessageEndpoint`) looks redundant and sometimes even dangerous,
when we use `@ComponentScan`, too.

* Remove the `@Component` restriction logic from the `MessagingAnnotationPostProcessor`
* Ensure that tests pass

(We may consider to backport afterwards)

Add `requireComponentAnnotation` logic

* Introduce `spring.integration.messagingAnnotations.require.componentAnnotation` property for `spring.integration.properties` as `false` by default
* Add `MessagingAnnotationPostProcessor#setRequireComponentAnnotation()` to accept the value from the `spring.integration.messagingAnnotations.require.componentAnnotation`
 * Fix `integraton` typo everywhere
 * Document the change in the `What's New` and in the `configuration.adoc`
 * Ensure that logic works properly (no messaging endpoints populated) with the `spring.integration.messagingAnnotations.require.componentAnnotation = true` and "unannotated" `AnnotatedEndpoint2` in the `AnnotatedEndpointActivationTests`

This PR also fixes: https://jira.spring.io/browse/INT-3962

Fix issues according Travis report

Doc Polishing
2016-04-12 14:35:03 -04:00
Artem Bilan
40a9d28667 INT-3979: Properly Handle MBuilder in Splitter
JIRA: https://jira.spring.io/browse/INT-3979

Previously we had a to instantiate all messages from the `MessageBuilder`
if we would like to return messages as splitted items.
For example to populate some item-specific headers.

From other hand the `MessageBuilder` as an item incorrectly remained as a `payload`.

* Add condition logic to the `AbstractMessageSplitter` to properly handle `AbstractIntegrationMessageBuilder`
and don't create an extra `Message`

* Apply the same logic to the `AbstractAggregatingMessageGroupProcessor`

(We may consider to backport it later)
2016-04-12 11:05:19 -04:00
Artem Bilan
b469e62c8a INT-3984: Fix the BFPPs order
JIRA: https://jira.spring.io/browse/INT-3984

The `PropertySourcesPlaceholderConfigurer implements BeanFactoryPostProcessor, PriorityOrdered`
meaning that it is run before any other regular `BeanFactoryPostProcessor`,
like the `IntegrationConfigurationBeanFactoryPostProcessor` has been before.
With such an order any `BeanDefinition` declaration from the `IntegrationConfigurationBeanFactoryPostProcessor` process
ended up without `PP` resolutions.

* Rework `IntegrationConfigurationBeanFactoryPostProcessor` to the `BeanDefinitionRegistryPostProcessor`,
which makes it be loaded as early as possible. See `PostProcessorRegistrationDelegate`:
````java
// Now, invoke the postProcessBeanFactory callback of all processors handled so far.
invokeBeanFactoryPostProcessors(registryPostProcessors, beanFactory);
invokeBeanFactoryPostProcessors(regularPostProcessors, beanFactory);
````

* Modify `EnableIntegrationTests` and `ChannelSecurityInterceptorSecuredChannelAnnotationTests` to ensure that the change
meets the `PP` and `SpEL` resolutions during bean definition phase.
* Fix the timing issue in the `JdbcMessageStoreChannelIntegrationTests`
2016-04-12 11:00:53 -04:00
Artem Bilan
1df7815148 INT-3978 Fix MessageHistory for Message Types
JIRA: https://jira.spring.io/browse/INT-3978

Previously the `MessageHistory.write()` always used `MessageBuilder` to populated the `history` header.
Since the `MessageBuilder` doesn't care about the `source` message type, we might lose some important information,
like `AdviceMessage.inputMessage`

* Add conditional logic into the `MessageHistory` for all known `Message<?>` implementations
* Provide appropriate tests in the `MessageHistoryTests` for known `Message<?>` implementations
* Make `AdviceMessage` generic and fix all affected code on the matter
* Since `MutableMessage` is public already, fix `MongoDbMessageStore.DBObjectToMutableMessageConverter` to use
`MutableMessage` type directly.

Add WARN for non-standard `Message` type
2016-04-12 10:31:25 -04:00
Artem Bilan
f48d019970 INT-3909: Upgrade to Tomcat-8.0.33
JIRA: https://jira.spring.io/browse/INT-3909

Un`@Ignore` the `ClientWebSocketContainerTests` to ensure that `Tomcat-8.0.33` has the fix for the closed WebSocket session race condition.

Fix `StompIntegrationTests` test data

Clean up queue channels before each test, because of some remained extra messages during the web-socket protocol interactions,
like socket close events or similar

Fix `RedisStoreInboundChannelAdapterIntegrationTests` race conditions

Since Jedis driver is async, we not always receive a reply from the `TX-sync` component immediately.
And loop checking the Redis for the `key` after some `Thread.sleep()`
2016-04-12 09:57:38 -04:00
Artem Bilan
993549111c INT-3985: Upgrade to Spring-WS-2.3.0
JIRA: https://jira.spring.io/browse/INT-3985

Fix a couple typos in the `ws.adoc`
2016-04-12 09:53:43 -04:00
Artem Bilan
13d11e5035 Upgrade to SD-Hopper and other fixes
Fixes https://build.spring.io/browse/INT-MJATS41-593

* Fix `LoggingHandler` JavaDoc
* Fix `JdbcOutboundGatewayParserTests` timing and race condition issues
* Add `mock(BeanFactory.class)` to the `JpaOutboundChannelAdapterTests` for `JpaExecutor`
* Fix `JpaOutboundChannelAdapterTests` for the incorrect transaction usage
2016-04-11 14:55:27 -04:00
Artem Bilan
ba2a713c75 INT-3981: Add a couple <chain> tests
JIRA: https://jira.spring.io/browse/INT-3981

Since the `MessageHandlerChain` uses a `ReplyForwardingMessageChannel` in the end of invocation,
we don't need to have add an extra `<bridge>` for shifting just populated `replyChannel` header.

* Add a couple tests to prove that
* Fix the typos in the `ChainParserTests`
* Remove unnecessary `DirectFieldAccessor` usage in the `MessageHandlerChain`
2016-04-11 14:55:27 -04:00
Artem Bilan
4abc7861f0 GH-1757: Add Code Style Wiki page
Fixes: https://github.com/spring-projects/spring-integration/issues/1757
2016-04-11 14:42:31 -04:00
Gary Russell
020aa019a1 Sonar Fixes after Checkstyle Updates
https://sonar.spring.io/issues/search#componentRoots=org.springframework.integration%3Aspring-integration|createdAt=2016-04-07T03%3A04%3A31%2B0000|sort=UPDATE_DATE|asc=false
2016-04-07 09:01:17 -04:00
Gary Russell
57f96bb759 checkstyle Misc Rules
checkstyle Nesting

checkstyle GenericWhitespace

checkstyle MethodParamPad

checkstyle NoWhiteSpace

checkstyle ParenPad Script

checkstyle ParenPad
2016-04-05 17:21:29 -04:00
Gary Russell
05cc7be644 checkstyle WhiteAround
WhiteAroundCheck script
2016-04-05 13:50:11 -04:00
Gary Russell
842aded9a4 checkstyle MutableException
checkstyle EmptyBlock

checkstyle fixRightCurly Script

checkstyle EmptyStatement

checkstyle RightCurly

checkstyle TailingWhite

checkstyle NeedBraces

Fix the line separator in the `fixRightCurly.gradle`
2016-04-05 13:10:33 -04:00
Artem Bilan
c0b19e61b5 INT-3977: Improve LoggingHandler for JavaConfig
JIRA: https://jira.spring.io/browse/INT-3977

* Add `Level` ctor
* Add `setLogExpression(Expression)` and `setLogExpressionString(String)`
* Deprecate existing `setExpression(String)` in favor of those new
* Some refactor for redundant code around `evaluationContext`
* Fix tests according a new `LoggingHandler` logic
* Add JavaConfig sample to the Reference Manual
2016-04-05 12:19:27 -04:00
Guilherme Trein
dee5c91bd8 Fix typos in the Reference Manual
Update note on channel interceptors in docs

Update `channel.adoc` including `afterReceiveCompletion(..)` in the
list of methods that are not invoked when an interceptor is applied
to `PollableChannel`

Improve `aggregator.adoc` formatting in docs

Fix and improve `channel.adoc` formatting in docs

Convert tabs to spaces of `codec.adoc` in docs

Convert tabs to spaces and fix formatting of `content-enrichment.adoc` in docs

Convert tabs to spaces and fix formatting of `logging-adapter.adoc` in docs

Convert tabs to spaces on `metrics.adoc` in docs

Improve `resequencer.adoc` formatting in docs

Improve `splitter.adoc` formatting in docs

* Fix more typos in the Reference Manual
2016-04-04 14:18:07 -04:00
Gary Russell
4ac3a79df7 checkstyle FinalClassCheck
fixes

fixModifiers after fixFinal

Revert CachingSessionFactory

Class is spied in tests.

checkstyle - Import Rules

checkstyle InterfaceIsType

checkstyle InnerTypeLast

checkstyle OneStatementPerLine

CovariantEquals
OneTopLevelClass

* Revert `'\n'` -> `System.lineSeparator()` in the Gradle scripts to meet Git `autocrlf = true` on Windows
* Fix timing issue with the `LastModifiedFileListFilterTests`, when the `age = 1` might not be enough for the file object when we have some delay before checking
2016-04-04 13:49:56 -04:00
Gary Russell
43af472c3a checkstyle HideUtilityClassConstructor
https://sonar.spring.io/issues/search#componentRoots=org.springframework.integration%3Aspring-integration|createdAt=2016-04-01T10%3A00%3A36%2B0000|sort=UPDATE_DATE|asc=false
2016-04-01 16:18:28 -04:00
Artem Bilan
b363bdb15e INT-3541: The XMPP Extension Support on Outbound
JIRA: https://jira.spring.io/browse/INT-3541

Address PR comments
2016-04-01 13:07:52 -04:00
Artem Bilan
c97ac195a5 INT-3976: Remove an explicit scriptClassName
JIRA: https://jira.spring.io/browse/INT-3976

The class name in case of `StaticScriptSource` (for inline scripts) is required only for Groovy native engine.
Even if `GroovyScriptParser` provides an explicit `scriptClassName` option, we still can configure
`GroovyScriptExecutingMessageProcessor` with the `StaticScriptSource` from Java without the script class name.
Therefore the logic in the `GroovyScriptParser` isn't robust.

* Remove the `GroovyScriptParser` `scriptClassName` logic altogether
* Change the `GroovyScriptExecutingMessageProcessor` to rely on the Groovy native `scriptClassName` generation
in case of the `scriptSource` is provided without the class name option
* Fix the test for the actual generated script class name
2016-03-30 17:10:10 -04:00
Gary Russell
dc94b420ee INT-3975: AMQP Channels: Support extract-payload
JIRA: https://jira.spring.io/browse/INT-3975

Also, switch the default mapping to map all inbound headers, but
don't map `x-*` on outbound (by default).

This will provide apps access to important headers such as `x-death` by
default, while not propagating dangerous headers outbound.

Polishing - PR Comments

Simple code style polishing
2016-03-30 10:37:24 -04:00
Artem Bilan
c677722208 INT-3591: Upgrade to commons-net-3.4
JIRA: https://jira.spring.io/browse/INT-3591

Modify `TestFtpServer` and `FtpServerOutboundTests` for file with leading whitespace
to confirm the `FtpServerFactory` has been fixed in the `commons-net-3.4`
2016-03-28 17:19:03 -04:00
Artem Bilan
b5745af148 INT-3937: Deprecate Reactor Environment usage
JIRA: https://jira.spring.io/browse/INT-3937
2016-03-28 11:38:06 -04:00
Gary Russell
4bfcdb9dfa INT-3944: Async JMS Outbound Gateway
JIRA: https://jira.spring.io/browse/INT-3944

Polishing (PR comments) and Doc Polish

Polishing - PR Comments

Remove custom `async` boolean in favor of the now public setter.

Add exception to `JmsException` hierarchy.

INT-3944: Polishing

* Rename `asyncReplySupported` just to `async`. As well as its getter and setter. Plus fix docs on the matter
* Polishing for the `JmsOutboundGateway` according PR comments
* Rework `JmsOutboundGateway` to return `AbstractIntegrationMessageBuilder` instead of `Message`
since `AbstractMessageProducingHandler` rebuilds `Message` for a new one to copy headers from request
* Add `getPayload()` and `getHeaders()` to the `AbstractIntegrationMessageBuilder` to make the `Routing Slip`
users happy, when the `AbstractIntegrationMessageBuilder` is pushed to the `Routing Slip path` function
* Fix race condition in the `ChatMessageListeningEndpointTests`: the `stanza` parsing is done in the different Thread.

Doc Polishing (Routing Slip)

Fix timing issue in the `LastModifiedFileListFilterTests`:
`Thread.sleep()` not always reflects the reality.
Switch to the "past simulation" via explicit `File.setLastModified()`
2016-03-25 16:44:35 -04:00
Gary Russell
0fd72d2d18 TCP Connection Factory FactoryBean Improvements
Add ctor argument so that early `getObjectType()` calls can return
a narrower type (server Vs. client CF).
2016-03-25 14:00:00 -04:00
Artem Bilan
69ee423ce2 INT-3972: Allow Disabling of Roster Subscriptions
JIRA: https://jira.spring.io/browse/INT-3972
2016-03-25 13:52:12 -04:00