Commit Graph

9504 Commits

Author SHA1 Message Date
Gary Russell
bac3565dfd GH-2714: Fix PollSkipAdvice
Fixes https://github.com/spring-projects/spring-integration/issues/2714

Return null instead of false when poll skipped.
2019-01-24 10:46:04 -05:00
Gary Russell
fff968e5ad Add Duration overloads to Pollers factory
- test adds coverage to all time-based factory methods
2019-01-23 17:39:12 -05:00
Artem Bilan
800227558b INT-2549: Ignore MBean call reply in op-invoc-c-a
JIRA: https://jira.spring.io/browse/INT-2549

* Add `expectReply` property into the `OperationInvokingMessageHandler`
to align the one-way and request-reply behavior with all other similar
components in Spring Integration
* Ignore an operation invocation result in case of `expectReply == false`
and log warning
* Provide some refactoring into the `OperationInvokingMessageHandler`
to fix Sonar complains about complexity

**Cherry-pick to 5.0.x, 4.3.x**
2019-01-23 15:30:58 -05:00
Gary Russell
f43fa9772e Update issue template 2019-01-23 11:23:50 -05:00
Artem Bilan
5b42c28f40 Refactor AbstractMailReceiver for proper locking
According Sonar we can't just leave lock unlocked in th method, so
apply refactoring for the `AbstractMailReceiver.receive()` where we don't
have uncontrolled `lock()` in the separate method
2019-01-23 11:15:40 -05:00
Artem Bilan
690a2c3c3e Implement Lifecycle for IntegrationComponentSpec
Since an `IntegrationComponentSpec` is a `FactoryBean`, all it's target
callbacks and lifecycle is controlled over a `FactoryBean`.

* Add `SmartLifecycle` for the `IntegrationComponentSpec` to delegate
lifecycle hooks to the `target` if necessary
* Refactor `IntegrationComponentSpec` to be an `AbstractFactoryBean`
which is a central place for the `FactoryBean`, `InitializingBean` and
`DisposableBean` interfaces

**Cherry-pick to 5.0.x**
2019-01-23 10:08:06 -05:00
Artem Bilan
119db815c2 * Fix new Sonar issue in the AbstractMailReceiver (#2709)
* * Fix new Sonar issue in the `AbstractMailReceiver`

* * Move `unlock()` to its own `finally`

* * Make `ImapMailReceiverTests.imapIdleServer` non-static to allow
recreate the mail server for each test method

https://build.spring.io/browse/INT-MASTERSPRING40-591/

* * Remove MongoDb download from Travis config

* * Fix Checkstyle violation
2019-01-22 12:51:29 -05:00
Artem Bilan
d37e6562d8 Fix DSL to deal with beanNames for handlers (#2707)
* Fix DSL to deal with beanNames for handlers

When consumer endpoint is created by the Framework, the target
`MessageHandler` gets a `componentName` from the `ConsumerEndpointFactoryBean`.
Therefore we can't rely on the `getComponentName()` when we create beans
from Java DSL.

* Introduce `NamedComponent.getBeanName()` contract; make it default
to the `getComponentName()`; implement this method from the
`IntegrationObjectSupport`
* Use this new `getBeanName()` from the `IntegrationFlowBeanPostProcessor`
and `StandardIntegrationFlowContext` for better existing beans checks
and possible reuse existing `MessageHandler` in different endpoints
* Optimize `FixedSubscriberChannel` and implement `getBeanName()` over there
* Implement `getBeanName()` in the `AbstractMessageSource`; use
`ExpressionEvalMap` to evaluate headers expressions
* Implement `getBeanName()` in `Trackable*Metrics` classes as delegation
to the `this.trackable`

* * Fix race condition around `discardChannelName` property in the `MessageFilter`
2019-01-22 11:04:47 -05:00
Artem Bilan
a5e437f94a INT-2543: Relax mail host when mail-props present
JIRA: https://jira.spring.io/browse/INT-2543

We may have a mail server host configured in the properties and the
target session will resolve it properly from provided `javaMailProperties`.
The same applies for `username`

* Do not require `host` and `username`, when `javaMailProperties` is
provided
* Add additional factory methods into the `Mail` factory for Java DSL
* Add Java DSL sample into the `mail.adoc`
2019-01-22 11:00:32 -05:00
Artem Bilan
0ac766040f Fix a couple new Sonar smells 2019-01-18 15:27:45 -05:00
Artem Bilan
7da77f7043 INT-1887: Optimize AbstractMailReceiver.receive()
JIRA: https://jira.spring.io/browse/INT-1887

* Optimize access to the `AbstractMailReceiver.folder` via `ReadWriteLock`
2019-01-18 15:27:09 -05:00
Gary Russell
4ea3b1c23c GH-2705: public CTORs on AMFPFileListFilter Impls
Fixes https://github.com/spring-projects/spring-integration/issues/2705
2019-01-18 11:12:38 -05:00
Gary Russell
48ae91e3d9 Docs: Fix File.renameTo() Expressions
https://stackoverflow.com/questions/30151642/moving-processed-files-to-another-directory-using-spring-integration-ftp-inbound/30152053?noredirect=1#comment95312701_30152053

- also fix some PDF overflows
2019-01-17 18:12:27 -05:00
Artem Bilan
462dc98803 GH-2695: Add proxy option to @EnablePublisher (#2701)
* GH-2695: Add proxy option to @EnablePublisher

Fixes spring-projects/spring-integration#2695

To configure a `proxyTargetClass=true` we need declare a
`PublisherAnnotationBeanPostProcessor` bean manually, but that may cause
a confuse when `@EnablePublisher` is still present.
So, target service is proxied twice

* Expose `proxyTargetClass` and `order` into the `@EnablePublisher`
and `<enable-publisher>`
* Refactor `PublisherAnnotationBeanPostProcessor` to extend an
`AbstractBeanFactoryAwareAdvisingPostProcessor` to avoid AOP boilerplate
code altogether
* Add assertion into the `PublisherAnnotationBeanPostProcessor` to be
sure that only one of its instance is present in the application context

* * Polishing error message and Docs
2019-01-17 10:44:39 -05:00
Cameron Mayfield
cd8cbaa99c GH-2699: Make expressions cache concurrent
Fixes spring-projects/spring-integration#2699

* [GH-2699] Match style

* [GH-2699] Shorten test line length

**Cherry-pick to 5.0.x**
2019-01-16 18:03:03 -05:00
Artem Bilan
eed16f02ca Fix BeanFactory propagation for MMInvokerHelper (#2694)
* Fix BeanFactory propagation for MMInvokerHelper

* Remove check for `null` in the
`MessagingMethodInvokerHelper.isProvidedMessageHandlerFactoryBean()`
* Fix `RecipientListRouter` for `BeanFactory` propagation to the
`Recipient.selector`
* Fix tests for `BeanFactory` population and propagation
* Add `errorChannel` into the `TestUtils.createTestApplicationContext()`
* Fix some Sonar smell, including new reported

* * Restore NPE check for the `BeanFactory` in the
`MessagingMethodInvokerHelper` to avoid breaking changes in the current
point release
* Some other polishing and optimizations in the
`MessagingMethodInvokerHelper`
2019-01-15 15:16:33 -05:00
Artem Bilan
63684e2012 INT-4574: JDBC: Add NOT NULL for primary keys
JIRA: https://jira.spring.io/browse/INT-4574

Some RDBMS don't allow have nullable columns for primary keys

* Add NOT NULL for all the columns involved in primary keys
2019-01-14 17:33:27 -05:00
Artem Bilan
936d63bd65 Update CONTRIBUTING for GH issues bug tracking (#2696)
* Update CONTRIBUTING for GH issues bug tracking

* * Still mention JIRA
2019-01-14 13:24:25 -05:00
Gary Russell
518c4918e2 TcpCodecs factory Sonar polishing
- also some magic numbers in the deserializers
2019-01-12 12:53:38 -05:00
Gary Russell
4dcbb92246 Upgrade spring-retry 2019-01-11 15:15:18 -05:00
Gary Russell
ae3bb154fa TcpCodecs factory improvement
- add convenience factory methods to set the max message size while creating the codec

* Polishing - PR comments; deprecate protected field; checkstyle fixes.
2019-01-11 12:12:43 -05:00
Spring Buildmaster
60be204b4d [artifactory-release] Next development version 2019-01-11 00:39:18 +00:00
Spring Buildmaster
53338846a7 [artifactory-release] Release version 5.1.2.RELEASE 2019-01-11 00:39:14 +00:00
Artem Bilan
610852c033 Prepare for release; upgrade security & micrometer 2019-01-10 19:12:53 -05:00
Artem Bilan
7511c94391 Upgrade some dependencies 2019-01-10 17:01:22 -05:00
Artem Bilan
d4a03006cf Fix ambiguity for NullChannel instances bean name
When we use explicitly `new NullChannel()` in DSL definition, we don't
provide a bean name and just end up with an explicit `nullChannel`
component name in the class.
This way it clashes with the global `errorChannel`, but since instances
are different we get a `BeanDefinitionOverrideException`

* Remove explicit `nullChannel` component name in the `NullChannel` in
favor of the generated name as it is done for any regular beans
* Some internal polishing in the `NullChannel`
* Some polishing in the `IntegrationFlowBeanPostProcessor` to deal with
`NullChannel` as with any other regular `AbstractMessageChannel`s and
generate a proper name for it within the scope of the current
`IntegrationFlow`
2019-01-10 15:21:56 -05:00
Artem Bilan
59c69ed40d Allow XML components injection
**Cherry-pick to 5.0.x & 4.3.x**

* Polishing after rebase
* Copyright to 2019

* Rebase and update according upstream deps
2019-01-10 14:43:06 -05:00
Oleg Zhurakousky
0d1312874c INT-4571 Make MessageHandlerMethodFactory injectable
Make MessageHandlerMethodFactory injectable into MessagingMethodInvokerHelper
Allow 'handlerMethod' to be overridden
Deprecate HandlerMethodArgumentResolversHolder
Add 'integrationMessageHandlerMethodFactory' property to IntegrationContextUtils
Add test that actually validates that custom resolver gets picked up

* Polishing code style and some code smells
2019-01-10 13:44:19 -05:00
Artem Bilan
1d5e66b0ee RemoteFileTemplate: Fix Checkstyle violation
* Add `if (session != null)` in the `RemoteFileTemplate` around `dirty()`
2019-01-10 11:05:18 -05:00
Alen Turkovic
6ddcfb3a8d Custom Session dirty logic
Fixes spring-projects/spring-integration#2687

Allows any session to implement its dirty logic.

* License year was not updated

**Cherry-pick to 5.0.x**
2019-01-10 10:52:45 -05:00
Gary Russell
2766707547 Sonar fixes
- remaining hidden fields

* Fix copyright
2019-01-09 13:30:08 -05:00
Gary Russell
e30741f7eb Upgrade SF to 5.1.4 2019-01-09 12:06:30 -05:00
Gary Russell
e40cfe101e Sonar fixes
Hidden fields, `o.s.i.a*` through `o.s.i.j*`.
2019-01-09 10:02:19 -05:00
Artem Bilan
6eeec50b4a INT-4572: Add MessageProducer.setOutputChannelName
JIRA: https://jira.spring.io/browse/INT-4572

* Add `setOutputChannelName()` contract into the `MessageProducer`
to avoid proxy unwrapping and casting to the `MessageProducerSupport`
2019-01-08 16:32:10 -05:00
Gary Russell
53e3248d73 Make Test IMAP Server fields volatile
`resetServer()` runs on a different thread.
2019-01-07 12:42:55 -05:00
Gary Russell
1bafe89d49 Sonar Fixes
- avoid parameter assignments
2019-01-07 11:35:58 -05:00
Gary Russell
76439e3440 Upgrade Groovy version 2019-01-04 16:03:16 -05:00
Gary Russell
870cbfea2e Upgrade Jackson version 2019-01-04 14:52:05 -05:00
Gary Russell
e8df546b04 Sonar Fixes - Javadoc-only imports 2019-01-02 12:26:22 -05:00
Artem Bilan
a39881fd0d Fix new issues in Sonar
* Use properly `IntegrationObjectSupport.extractTypeIfPossible()`
2018-12-23 11:48:33 -05:00
Gary Russell
113a371f2c Remove Exception from IOS.onInit() 2018-12-22 17:25:56 -05:00
Artem Bilan
81b4ea1bef Sonar fixes according latest report (#2676)
* Sonar fixes according latest report

* Fix initialization order in the `GatewayMethodInboundMessageMapper`

* Fix mock in the `DelegatingSessionFactoryTests`

* Fix `AbstractRemoteFileOutboundGateway.listFilesInRemoteDir`

* * PR comments

* * Fix `AbstractRemoteFileOutboundGateway.listFilesInRemoteDir` complexity
2018-12-22 11:57:35 -05:00
Artem Bilan
1943c15afe INT-4570: Add MessageCollectionCallback for Mongo (#2675)
* INT-4570: Add MessageCollectionCallback for Mongo

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

The `MongoDbOutboundGateway` is intended to be used with the
`requestMessage` context, however using a plain `CollectionCallback`
we don't have access to the `requestMessage`

* Deprecate `CollectionCallback` usage in favor of newly introduced
`MessageCollectionCallback` and `message-collection-callback` for XML

**Cherry-pick to 5.0.x**

* * Remove `message-collection-callback` in favor of
`MessageCollectionCallback<T> extends CollectionCallback<T>`

* * Rename a new setter to `setMessageCollectionCallback()` to avoid
reflection collision
2018-12-21 15:27:03 -05:00
Artem Bilan
0d09bdccd4 Replace xmlunit dependecy with AssertJ methods 2018-12-21 09:10:23 -05:00
Artem Bilan
93d7c58b64 Enable ModifierOrderCheck Checkstyle rule (#2673)
* Enable ModifierOrderCheck Checkstyle rule

* Fix violations for `static` and `abstract` modifier
* Remove redundant code in the `TcpNioConnection`
* Mark `connectionFactoryName` as `@Nullable` in the `TcpConnectionSupport`
ctor and its inheritors
* Fix some smells according IDEA suggestions in the affected classes
* This should fix some Sonar smells as well

* * Fix `HeaderMapperTests`

* * Polishing `TcpConnection` code style and fix Javdocs
2018-12-20 19:19:47 -05:00
Gary Russell
a01d09f0f1 Sonar Fixes
Final critical smells.
2018-12-20 11:58:32 -05:00
Artem Bilan
761af2730c * Fix Sonar issues for Sec., STOMP, SFTP, WebFlux 2018-12-19 16:51:22 -05:00
Gary Russell
7790f9e550 Sonar fixes
Critical issues `o.s.i.t*`, `o.s.i.u*`.

* Polishing - PR Comments.
2018-12-19 14:49:27 -05:00
Artem Bilan
8ce8bf9d73 Fix code smell in websocket and webflux modules (#2669)
* * Fix code smell in websocket and webflux modules

* * More fixes

* * Fix NPE in the `IntegrationHandlerResultHandler`
2018-12-19 12:33:47 -05:00
Gary Russell
e8bd31cc37 Sonar fixes
Critical smells `0.s.i.r*`

* Polishing - PR Comments.
2018-12-19 09:47:57 -05:00