Commit Graph

9623 Commits

Author SHA1 Message Date
Artem Bilan
90ac259da7 INT-4520 Make IntegrationGraphServer customizable (#2608)
* INT-4520 Make IntegrationGraphServer customizable

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

* * Polishing according PR comments
2018-10-24 15:02:52 -04:00
Artem Bilan
495dfe6437 GH-2500: Polish Redis Docs
Fixes spring-projects/spring-integration#2500
2018-10-23 15:32:09 -04:00
Gary Russell
bd7a3bc4ed GH-2605: (S)FTP test cached sessions
Resolves https://github.com/spring-projects/spring-integration/issues/2605

* Suppress unused field warning.

* Fix typos.

* Use lstat() - don't follow symbolic lincs
2018-10-23 13:59:00 -04:00
Gary Russell
eed5fe7a88 Extensible MicrometerMetricsCaptor and polishing
- change `loadCaptor` to return any existing captor
- make builders and facades protected to allow subclassing
- change `AbstractMeter.getMeter()` to use generics
- add test case demonstrating meter name changes
- docs

* Polishing - PR Comments, and rebase
2018-10-22 19:58:54 -04:00
Artem Bilan
1d1abf257d Polishing for PollingLifecycleTests 2018-10-19 16:02:50 -04:00
Gary Russell
7aa8489279 Fix race in PollingLifecycleTests 2018-10-19 15:42:31 -04:00
Gary Russell
23ebe56838 INT-4530: Remove Meters
JIRA: https://jira.spring.io/browse/INT-4530

- implement `DisposableBean` in all meter-aware components
- remove meters in `destroy()`
- manually destroy annotation components created by `registerSingleton()`
  - changing these beans to register as bean definitions caused some subtle
    initialization side-effects; given we are post-RC, I felt it was too late
    to make such a large change
  - also CPXAC is not a `GenericApplicationContext`
  - hence a bean is registered to destroy them manually

* Rebase; Polishing - PR Comments
2018-10-19 15:00:04 -04:00
Artem Bilan
e3ce37ca36 INT-4544: Allow runtime MBeans (un)registered (#2601)
* INT-4544: Allow runtime MBeans (un)registered

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

* Fix `SourcePollingChannelAdapterFactoryBean` to register an
`outputChannelName` into the `SourcePollingChannelAdapter` for late
binding, especially in case of dynamic `IntegrationFlow` registrations.
This must be back-ported to `5.0.x`
* Implement `DestructionAwareBeanPostProcessor` in the
`IntegrationMBeanExporter` for the runtime beans tracking, e.g. via
dynamic `IntegrationFlow` registrations
* Refactor `IntegrationMBeanExporter` for static and dynamic beans
registration and destruction
* Remove unused properties; introduce some new for tracking beans and
their relationship

* * Move `IntegrationMBeanExporter.registerProducer()` after
`postProcessAfterInitialization()`
* Refactor JMX test configurations to reuse MBeanServer as much as
possible and destroy the server whenever it is necessary

* * More JMX tests polishing

* * And more JMX tests polishing

* * `try...catch` in the `IntegrationMBeanExporter.postProcessAfterInitialization()`
to avoid breaking changes for the current GA phase
* Do not unregister those MBeans explicitly which weren't created at
runtime

* * Log ObjectNames in the `MBeanExporterIntegrationTests`

* * Fix `MessageMetricsAdviceTests` to rely on the application context
* Do not use a cst in the `StandardIntegrationFlowContext` for
`BeanFactory`, but an explicit `BeanDefinitionRegistry`
* Extract targets from proxies in the
`IntegrationMBeanExporter.postProcessAfterInitialization()`
* Remove logging in the `MBeanExporterIntegrationTests`

* * Fix `NotificationListeningMessageProducerTests` to reuse existing `MBeanServer`

* * Change JMX `domain` in the `DslMBeanTests` to `dsl` do not clash with
similar in the `foo` in the `MessageSourceTests`
* Use `MBeanServer` bean in the `Int2307Tests`
* Use JUnit 5ctor injection injection in the `MessageMetricsAdviceTests`

* * Fix JMX tests do not reuse existing `MBeanServer` and make them rely
on the server provided by the managed `MBeanServerFactoryBean` which
destroys a server on application context close
* Fix `StoredProcJmxManagedBeanTests-context.xml` to use `MBeanServer`
from the `<context:mbean-server>`
2018-10-19 09:51:25 -04:00
Artem Bilan
40ba72b84a INT-4545: Fix RPMHWrapper registration for `@SA
JIRA: https://jira.spring.io/browse/INT-4545

Improve the logic in the `AbstractMethodAnnotationPostProcessor` to
check for existing `MessageHandler` and be sure that we need to register
a `ReplyProducingMessageHandlerWrapper` bean

**Cherry-pick to 5.0.x**
2018-10-19 09:10:47 -04:00
Gary Russell
743afafa97 INT-4546: Expose IMAP cancel interval via DSL
JIRA: https://jira.spring.io/browse/INT-4546
2018-10-16 12:58:55 -04:00
Spring Buildmaster
2a49cddca9 [artifactory-release] Next development version 2018-10-15 19:02:43 +00:00
Spring Buildmaster
aa00351096 [artifactory-release] Release version 5.1.0.RC2 2018-10-15 19:02:35 +00:00
Artem Bilan
218efb9981 Prepare for release: downgrade to Security 5.1.0 2018-10-15 14:24:12 -04:00
Artem Bilan
9f34b27430 Upgrade to the latest GAs
* No Spring Security 5.1.1.RELEASE yet
2018-10-15 12:28:22 -04:00
Artem Bilan
ecda2667dd Upgrade some dependencies to the latest versions 2018-10-11 17:14:37 -04:00
Gary Russell
291704d0d9 Fix PDF Doc overflows
- what's new
- no need for backticks in section 7 tables cols 1,2 are marked literal
2018-10-11 14:05:00 -04:00
Gary Russell
49f0a33791 Defensive MBeanExporterHelper Registration
If the initializer is somehow called more than once, context
initialization will fail with default Boot 2.1 settings, which
do not allow bean overrides.
2018-10-11 12:27:27 -04:00
Gary Russell
58fe203c0e SPR-17307: Fix event listener tests
JIRA: https://jira.spring.io/browse/SPR-17307

The event multicaster now saves singletons in `applicationListeners`
instead of adding the bean name to `applicationListenerBeans`.

**cherry-pick to 5.0.x**
2018-10-11 11:16:23 -04:00
Gary Russell
0a7c77d853 INT-4534: Add remote directory to exception
JIRA: https://jira.spring.io/browse/INT-4534

Include the remote directory in exception and debug log messages when synchronizing.
2018-10-11 08:58:53 -04:00
Artem Bilan
41264110ce Some various polishing
* Add `RotatingServerAdvice.StandardRotationPolicy.getCurrent()` method
for better end-user experience when this class is extended
* Add NPE protection into the MQTT Channel Adapters.
Some code style polishing for them

**Cherry-pick to 5.0.x**
2018-10-10 15:21:58 -04:00
Artem Bilan
0f5cfd4314 INT-4542: CorrMH: Use popSequenceDetails properly (#2591)
* INT-4542: CorrMH: Use popSequenceDetails properly

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

Perform a `MessageBuilder.popSequenceDetails()` for those
`MessageGroupProcessor` results which are not `Message`
or `Collection<Message>`

**Cherry-pick to 5.0.x**

* * Add `AbstractCorrelatingMessageHandler.popSequenceDetails` property

* * Rename property to just a `popSequence`

* * Fix JavaDocs on the `AbstractCorrelatingMessageHandler.setPopSequence()`
* Fix Docs typos and language
* finish the `RouterTests.testNestedScatterGather()`
2018-10-10 14:03:40 -04:00
Artem Bilan
1595462ce7 Add @LongRunningTest JUnit 5 condition
* Add docs about `@LongRunningTest`
2018-10-10 13:05:48 -04:00
Artem Bilan
59860c0a4b INT-4535: Fix @SpringIntegrationTest for caching
JIRA: https://jira.spring.io/browse/INT-4535

For the proper Spring Test Context caching support, the `ContextCustomizer`
must implement `hashCode()` and `equals()` methods

* Add `hashCode()` and `equals()` into the `MockIntegrationContextCustomizer`
* Ensure that caching works as excepted with the
`CachedSpringIntegrationTestAnnotationTests` its two sub-classes

**Cherry-pick to 5.0.x**
2018-10-10 13:01:08 -04:00
Gary Russell
4ee5294980 Move Deps to Snapshots 2018-10-10 12:42:39 -04:00
Artem Bilan
ddcfa25fc4 INT-4543: JacksonJsonObjectMapper: fix toJsonNode (#2592)
* INT-4543: JacksonJsonObjectMapper: fix toJsonNode

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

When inbound payload is type of `String`, `byte[]`, `File`, `URL`,
`InputStream` or `Reader`, we have to use an `ObjectMapper.readTree()`
function.
For all other types the `valueToTree()` should be used as a fallback

**Cherry-pick to 5.0.x**

* * Fallback to the `valueToTree()` if not valid JSON

* * Fallback to `valueToTree()` only for `String` and `byte[]`
2018-10-10 12:20:13 -04:00
Gary Russell
11286907e8 GH-2471: Close client on outbound adapter
Resolves https://github.com/spring-projects/spring-integration/issues/2471
2018-10-10 11:49:50 -04:00
Gary Russell
551f03caa4 JMX: Quote object name values if not identifiers
https://www.oracle.com/technetwork/java/javase/tech/best-practices-jsp-136021.html

The set of characters in a value is also limited. If special characters may
occur, it is recommended that the value be quoted, using ObjectName.quote. If
the value for a given key is sometimes quoted, then it should always be quoted.
By default, if a value is a string (rather than a number, say), then it should
be quoted unless you are sure that it will never contain special characters.

Practically, some special characters are allowed, but we will standardize on
allowed characters in java identifiers.
2018-10-09 15:32:52 -04:00
Gary Russell
7ef38919b8 More doc polish for previous commit
Failed to save file :(
2018-10-09 13:15:43 -04:00
Artem Bilan
7176690e4d Improve functions support
* Add `functions-support.adoc` chapter
* Add more tests
* Improve `InboundChannelAdapterAnnotationPostProcessor` to support
Kotlin `Function0`
* Add `FunctionsTests.kt`
* Reformat Kotlin classes to use tabs
* Upgrade to Kotlin `1.2.71`

* Add `What's New` bullet

Doc Polishing
2018-10-09 12:29:34 -04:00
Gary Russell
e7bc060e55 INT-4541: Fix Reactive MessagingGateway Errors
JIRA: https://jira.spring.io/browse/INT-4541

Add test case to reproduce.

The gateway correctly sets up the `errorChannel` header so that a downstream
`MPEH` will send exceptions back to the gateway, but the `map()` function
did not check for an error message.

Check for an error message and throw the payload so that the `onErrorResume`
will route to the error channel.
2018-10-08 17:42:29 -04:00
Artem Bilan
9ae0eb2dbc INT-4540: Use MessageHeaders in GenericHandler (#2589)
* INT-4540: Use MessageHeaders in GenericHandler

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

For better end-user experience use a `MessageHeaders` in the
`GenericHandler` instead of plain `Map<String, Object>`

* * Fix `IntegrationFlowEventsTests`
2018-10-08 16:26:56 -04:00
Artem Bilan
716494c7fb INT-4538: Fix Splitter for ArrayNode.size()
JIRA: https://jira.spring.io/browse/INT-4538

* Add support for Jackson `TreeNode.size()` in the `AbstractMessageSplitter`
* Add overloaded `Transformers.toJson(ObjectToJsonTransformer.ResultType)`
* Modify test to verify Jackson `ArrayNode` use-case with the splitter
and aggregator

**Cherry-pick to 5.0.x**
2018-10-08 10:00:08 -04:00
Artem Bilan
c4d6cf2b50 INT-4539: Fix Java DSL for prototype beans
JIRA: https://jira.spring.io/browse/INT-4539

The `IntegrationFlowBeanPostProcessor` doesn't check for prototype beans
and just override them in the application context with the singletons

* Since we can't in the DSL understand if provided object is a prototype
or not, we try to check for its bean definition by possible bean name.
Use `NamedComponent` for possible bean name to check.
* Remove `final` from the `IntegrationComponentSpec.get()` since its
result is not visible for CGI proxies when it is declared as a `@Bean`
and subsequent `getObject()` produces a new internal object
* Verify prototype beans with new test in the `IntegrationFlowTests`

**Cherry-pick to 5.0.x**
2018-10-06 19:18:41 -04:00
Artem Bilan
2df71fba30 INT-4537: Fix RSConsumer for MockIntegrationCtx
JIRA: https://jira.spring.io/browse/INT-4537

Fixes spring-projects/spring-integration#2582

* Rename `ReactiveStreamsConsumer.messageHandler` property to the
`handler` for consistency with other `IntegrationConsumer` s
* Do not wrap `Subscriber` into the `MessageHandler` if that one is
already a `MessageHandler`
* Fix `MockIntegrationContext` for the logic around `ReactiveStreamsConsumer`
where it is not enough just replace a `handler`, but we also need to do
that with the `subscriber`.
Luckily the `MockMessageHandler` is also a Reactive `Subscriber`
* Clean up `MockIntegrationContext.beans` in the end of `resetBeans()`
* Improve `testing.adoc`

**Cherry-pick to 5.0.x**
2018-10-05 14:39:35 -04:00
Artem Bilan
9e9fa2cf58 RemoteFTempl: InputStream.close() in the finally
If exception happens in the `callback.doWithInputStream(inputStream)`,
we don't close the `inputStream = session.readRaw(remotePath)`.

* Move the `InputStream.close()` to the `finally` block of the
`SessionCallback` action in the `RemoteFileTemplate.get()`

**Cherry-pick to 5.0.x and 4.3.x**
2018-10-05 12:17:50 -04:00
Artem Bilan
8a7adb8cc4 INT-4528: Docs for SmartLifecycleRoleController
JIRA: https://jira.spring.io/browse/INT-4528
2018-10-05 11:52:52 -04:00
Artem Bilan
262e624ef4 INT-4479: RequestEntity as root for status code
JIRA: https://jira.spring.io/browse/INT-4479

For better user experience expose a `RequestEntity<?>` as a root object
for evaluation context for `statusCodeExpression` execution
2018-10-04 17:23:59 -04:00
Gary Russell
a05004ae38 INT-4536: Support Kafka Tombstones
JIRA: https://jira.spring.io/browse/INT-4536

Represent `@KafkaNull` as `null` when `@Payload(required = false)`.
2018-10-04 13:51:18 -04:00
Artem Bilan
8b4d1e66e5 Allow Functions as Service Activators (#2575)
* Allow Functions as Service Activators

* Fix `MessagingMethodInvokerHelper` to extract canonical method for the
`Function` and `Consumer` beans
* Demonstrate in test how `Function` and `Consumer` can be configured
with the Messaging annotations

* Don't mutate method argument
2018-10-02 11:37:34 -04:00
Artem Bilan
6cb8c24c0e Fix Gemfire tests for the proper geode XSD url
https://build.spring.io/browse/INT-MASTERSPRING40-473/
2018-09-23 19:00:04 -04:00
Spring Buildmaster
61bbd8eece [artifactory-release] Next development version 2018-09-21 17:05:58 +00:00
Spring Buildmaster
868fdf11e6 [artifactory-release] Release version 5.1.0.RC1 2018-09-21 17:05:53 +00:00
Gary Russell
0e239393b3 Upgrade Spring AMQP to 2.1.0.RC1 2018-09-21 12:10:12 -04:00
Gary Russell
d4d76a632f Upgrade Spring-Data, Spring-Security 2018-09-21 12:03:46 -04:00
Steven
4f2372b02a FileReadingMS: Make an Assert message more clear
* Changed an Assert error message in the `FileReadingMessageSource` to make the requirements 
when using an external scanner clearer, and added some explanatory comments.

* Removed use of 'local' to eliminate confusion.

* Added javadoc addendum
2018-09-21 11:36:59 -04:00
Cengis K
b295fb8486 GH-2569: Add ChainFileListFilter constructors
* Adding ChainFileListFilter constructors to behave like CompositeFileListFilter

Fixes https://github.com/spring-projects/spring-integration/issues/2569

Adding constructors in `ChainFileListFilter` matching super, so this class behave 
like `CompositeFileListFilter` when using XML flow configuration.

* Fix import error

* Fix checkstyle

* Fix checkstyle

* Fix checkstyle

* Fix author name case
Remove unnecessary javadoc

* Fix code smell squid:S1155

* Add a simple test case for initializing filters with constructor
Fix code smell squid:S1192

* Add a simple test case for initializing filters with constructor
Fix code smell squid:S1192

* Fix missing import
2018-09-21 11:32:16 -04:00
Gary Russell
2d54fe2618 Upgrade to SF 5.1.0, Gradle 4.10.2 2018-09-21 11:12:41 -04:00
Artem Bilan
b931112776 Upgrades to the latest dependencies and fixes
* Spring AMQP 2.1 B-S and fix imports for moved classes
* Reactor GA
* SF-5.1 B-S and exclude `org.springframework` from all the
Spring Security dependencies
* the latest Hibernate and JPA and fix the test query for the
appropriate actual syntax
* latest SSHD and add required dependency for `sshd-sftp`
* latest Groovy and extra dependency for the `groovy-dateutil`
* latest Smack for XMPP and appropriate code fixes for compatibility
* Fix `StompIntegrationTests` to use `AFTER_EACH_TEST_METHOD`:
when session is disconnected on the server, we can't interact with it
anymore
2018-09-20 15:01:10 -04:00
Gary Russell
8582d402ce Fix for previous commit
- failed to remove `RetryListener` from the gateway.
2018-09-19 12:15:56 -04:00
Gary Russell
dd6afa81d2 Use RetrySynchronizationManager
Use the `RetrySynchronizationManager` instead of a `RetryListener`.

Fix `setAttributesIfNecessary` for gateway conversion errors (this, at least,
should be cherry-picked).
2018-09-19 11:35:12 -04:00