Commit Graph

9623 Commits

Author SHA1 Message Date
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
Artem Bilan
271181247d Fix code smell in test and syslog modules (#2667)
* Fix code smell in test and syslog modules

* * Fix code smell in the scripting module
2018-12-18 15:58:40 -05:00
Artem Bilan
12dd73d219 Fix code smell for PayloadTypeConvertTransformers 2018-12-18 15:27:34 -05:00
Artem Bilan
3dd8b63576 INT-4569: Disallow beans override in DSL (#2664)
* INT-4569: Disallow beans override in DSL

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

* Thorw `BeanDefinitionOverrideException` from the
`IntegrationFlowBeanPostProcessor` when it detects existing bean and it
is not the same object we try to register from the DSL
* Document limitations about `prototype` beans
* Some polishing in the DSL chapter of the docs

* * Fix algorithm in the `IntegrationFlowBeanPostProcessor.noBeanPresentForComponent()`

* * Polishing dsl.adoc
* Call `BeanFactory.initializeBean()` for existing beans if they are
`prototype`

* * Code formatting in the `ManualFlowTests`
2018-12-18 14:22:17 -05:00
Gary Russell
65df35bfd1 Sonar fixes
Critical smells `o.s.i.m*`.
2018-12-18 13:28:59 -05:00
Artem Bilan
3f48d2043b ImapMailReceiver: Check folder.isOpen before idle
Increase wait timeout for message in the ImapMailReceiverTests

https://build.spring.io/browse/INT-MASTERSPRING40-556/
2018-12-15 14:30:59 -05:00
Gary Russell
355479f935 Sonar false positive polishing
Reported on next line.
2018-12-14 22:26:23 -05:00
Gary Russell
7efe79f457 Sonar fixes
Critical issues for `o.s.i.j*` (except `jdbc`).
2018-12-14 16:12:04 -05:00
Artem Bilan
89fdb938de Increase expire period for testExpireTwoRegistries
https://build.spring.io/browse/INT-MASTER-1313/

**Cherry-pick to 5.0.x**
2018-12-14 11:52:21 -05:00
Artem Bilan
c5f29fc6ef RedisLock: Throw exception from unlock on expire (#2661)
* RedisLock: Throw exception from unlock on expire

The lock might be expired in target Redis store in between `lock()` and
`unlock()`.
So, throw an `IllegalStateException` when lock is expired during
unlocking.
At the same time the lock lock is unlocked anyway.

**Cherry-pick to 5.0.x**

* * Create a new test for exception
* Add more info into the exception
2018-12-14 11:38:38 -05:00
Gary Russell
3f522f7efe Fix "new" Sonar issues
Reported as new due to touched source file.
2018-12-13 23:21:42 -05:00
Artem Bilan
d7356aa85d Use Context CL wherever it is applicable (#2656)
* Use Context CL wherever it is applicable

* Use `ClassUtils.getDefaultClassLoader()` in the `IntegrationManagementConfigurer`
for checking a Micrometer presence from the `afterSingletonsInstantiated()`
* Use `ClassUtils.getDefaultClassLoader()` in the `ScatterGatherHandler`
to load required class
* Refactor `HeaderEnricherParserSupport` do not use CL at all.
The `TypedStringValue` will resolve a target type later by the
`BeanFactory`.
This way we honor a property placeholder behavior for the `type` XML
attribute

* * Use `ClassUtils.getDefaultClassLoader()` in the ScatterGatherHandler ctor
2018-12-13 16:14:37 -05:00
Artem Bilan
33e52486cf More fixes for IMAP channel adapter and its tests
https://build.spring.io/browse/INT-MASTERSPRING40-553

The `ImapMailReceiverTests` fails sporadically according some race
condition or wrong logic.

* Fix `ImapIdleChannelAdapter` to check for folder not null before
performing logic in the `IdleTask`
* Polishing for logs which are based on constant strings
* Remove `volatile` from configuration properties in the
`ImapIdleChannelAdapter` and `AbstractMailReceiver`
* Refactor some smells into the `protected` getters instead of direct
access to the property
* Stop channel adapters in the `ImapMailReceiverTests`
* Also destroy task schedulers in the `ImapMailReceiverTests`
2018-12-12 13:06:16 -05:00
Gary Russell
ca2e70f236 Sonar Fixes
Critical smells for `o.s.i.jdbc`.

Fix new smell in TCP.
2018-12-10 14:31:17 -05:00
Gary Russell
579a72265c Fix Broken TCP OG Test
Default timeout expression is now a `ValueExpression`.
2018-12-09 20:47:17 -05:00
Gary Russell
563f526ddc Sonar Fixes
Critical smells for packages `o.s.i.i*`.

* Polishing

* Polishing

* Missed saving a file.

* Polishing - PR Comments

* More PR comments.
2018-12-07 14:59:27 -05:00
Gary Russell
4760c54097 Sonar Fixes
Critical smells `o.s.i.h*`.
2018-12-07 12:39:19 -05:00
Artem Bilan
536b6b1786 INT-4565: Fix IntComponentScan for profiles (#2652)
* INT-4565: Fix IntComponentScan for profiles

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

* Propagate an `Environment` to the internal `ClassPathScanningCandidateComponentProvider`
in the `IntegrationComponentScanRegistrar` for proper profiles activation
* Ensure the logic works in the `GatewayInterfaceTests`
* Some polishing and performance improvement for the `GatewayInterfaceTests`
* Add a note about `@Profile` in the `gateway.adoc`
* Polishing for the `gateway.adoc`

**Cherry-pick to 5.0.x & 4.3.x**

* * Add not activated by profile gateway interface into the `GatewayInterfaceTests`
* More `GatewayInterfaceTests` polishing
* Fix typo in the `gateway.adoc`

* Fix Checkstyle violation
2018-12-06 15:41:40 -05:00
Gary Russell
2cde493fbf Sonar Fixes
Packages `o.s.i.g*`

* Polishing - PR comments
2018-12-06 15:23:54 -05:00
Gary Russell
687e6d5004 INT-4150: Sonar Fixes
"New" issues for previous commit; Sonar reports as "new" issues in
changed files.
2018-12-06 12:21:16 -05:00
Artem Bilan
992c0ce6a7 INT-4150: Make ImapMailReceiverTests much faster
JIRA: https://jira.spring.io/browse/INT-4150

* Fix internal `taskScheduler` for destroy in the `ImapMailReceiver`
* Some code style polishing in the `ImapIdleChannelAdapter`
2018-12-06 09:08:48 -05:00
Artem Bilan
29b4a296be INT-4563: Add JMX test for MQTT
JIRA: https://jira.spring.io/browse/INT-4563

* Add a `MqttDslTests` with the JMX configured to be sure that SI
managed components are registered in JMX properly.
* Also this test covers a Java DSL configuration for MQTT channel adapters
* Some polishing for `AbstractMqttMessageHandler`
* Document Java DSL configuration for the MQTT channel adapters
2018-12-04 15:31:22 -05:00
Gary Russell
9832f61d2a INT-4564: ACMH: Fix erroneous error log
JIRA: https://jira.spring.io/browse/INT-4564

INT-4550 added an error log when multiple ACMHs were registered with the
same store; the error log logic was incorrect and the error was logged
when the first ACMH was registered.
2018-12-04 15:13:49 -05:00
Gary Russell
62fc7df693 Sonar Fixes
Critical smells, packages `o.s.i.a*` to `f*`.

Plus new smells caused by these changes.
2018-12-03 10:44:26 -05:00
Artem Bilan
4ade0ceaf4 INT-4385: Clarify <jms> namespace in jms.adoc
JIRA: https://jira.spring.io/browse/INT-4385

It is slightly unclear for end-users that `<jms:listener-container/>`
is just a syntax sugar and the real JMS container is created by the
`<jms:listener>` sub-element

* Add a NOTE to the `jms.adoc` to explain such a confuse and what and
how is going to happen if the intention to use a `<jms:listener-container/>`
for Spring Integration channel adapters.
2018-11-30 13:29:19 -05:00
Gary Russell
7135d0603c INT-4553: Store-backed QueueChannel improvements
JIRA: https://jira.spring.io/browse/INT-4553
Fixes https://github.com/spring-projects/spring-integration/issues/2628
Fixes https://github.com/spring-projects/spring-integration/issues/2629

- Avoid `size()` calls on the MGS, use `poll()` instead.
- Optimize the indexes for the `INT_CHANNEL_MESSAGE` table.

Avoid size call when no timeout too.

Polishing - PR Comments

Missed a doc fix

Another missed %PREFIX%

Fix underscores

Polishing; PR comments; make MGQ extendable.

Fix version in doc.

* Polishing `@since`
* Use diamonds whenever it is possible

**Cherry-pick to 5.0.x**
2018-11-30 13:07:59 -05:00
Spring Buildmaster
cfa439d0d4 [artifactory-release] Next development version 2018-11-28 20:00:11 +00:00
Spring Buildmaster
b047b8d9bb [artifactory-release] Release version 5.1.1.RELEASE 2018-11-28 20:00:03 +00:00
Artem Bilan
9d21bf29f6 Upgrade dependencies and fix tests for them 2018-11-28 14:31:04 -05:00
Gary Russell
39fef2c70a INT-4560: Fix Race in FileSystemPersistentAOFLF
JIRA: https://jira.spring.io/browse/INT-4560

Reproduced and tested with

```java
@SpringBootApplication
public class So53521593Application {

	private static final Logger logger = LoggerFactory.getLogger(So53521593Application.class);

	public static void main(String[] args) {
		SpringApplication.run(So53521593Application.class, args);
	}

	@Bean
	public IntegrationFlow flow() {
		ExecutorService exec = Executors.newFixedThreadPool(10);
		return IntegrationFlows.from(Files.inboundAdapter(new File("/tmp/foo")).filter(
					new MyFilter(new SimpleMetadataStore(), "foo")),
						e -> e.poller(Pollers.fixedDelay(5, TimeUnit.SECONDS)
								.maxMessagesPerPoll(10)))
				.channel(MessageChannels.executor(exec))
				.<File>handle((p, h) -> {
					try {
						p.delete();
						logger.info(p.toString());
						Thread.sleep(10_000);
					}
					catch (InterruptedException e1) {
						Thread.currentThread().interrupt();
					}
					return null;
				})
				.get();
	}
}

class MyFilter extends FileSystemPersistentAcceptOnceFileListFilter {

	public MyFilter(ConcurrentMetadataStore store, String prefix) {
		super(store, prefix);
	}

	@Override
	protected long modified(File file) {
		long modified = super.modified(file);
		System.out.println(modified);
		return modified;
	}

}
```

**cherry-pick to 5.0.x, 4.3.x**
2018-11-28 14:18:09 -05:00
Gary Russell
a4746f79ae Sonar fix 2018-11-27 23:01:47 -05:00
Gary Russell
26ce65deef More Sonar fixes 2018-11-27 22:41:00 -05:00