Commit Graph

9303 Commits

Author SHA1 Message Date
Artem Bilan
07040b3bde GH-2799: Fix AnnGateProxyFB for empty errChannel
Fixes https://github.com/spring-projects/spring-integration/issues/2799

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

When `AnnotationGatewayProxyFactoryBean` is used for the one-way (`void`)
POJI method invocation and downstream processing is based on an
`ExecutorChannel`, the default `errorChannel` value from the annotation
is resolved to the empty string with is set to the target gateway proxy
and can not be resolved to the target bean eventually in the
`MessagePublishingErrorHandler` in case of exception

* Check `errorChannel` attribute for empty string and don't set it into
the `errorChannelName`.
This way the `MessagePublishingErrorHandler` will resolve to the global
`errorChannel` as expected.
2019-03-11 16:34:22 -04:00
Gary Russell
be66bc98dd Fix Zookeeper Issues
- `tryLock()` didn't throw `InterruptedException`
- `putIfAbsent()` use `get()` for current value
1
2019-03-08 12:38:47 -05:00
Gary Russell
3b1db3ef38 Fix race in TcpOutboundGatewayTests
https://build.spring.io/browse/INT-MASTERSPRING40-636/

Move `serverLatch.countDown()` to a finally block.
2019-03-05 12:56:10 -05:00
Gary Russell
34febd443b GH-2776: Fix Streaming Remote File MessageSource
Fixes https://github.com/spring-projects/spring-integration/issues/2776
Also see https://github.com/spring-projects/spring-integration/issues/2777

- reset the filter for the current file if the fetch fails
- implement `Lifecycle` and clear the `toBeReceived` queue and corresponding
  filter entries

* Polishing - PR Comments **cherry-pick to all supported**

* Polishing

# Conflicts:
#	spring-integration-file/src/test/java/org/springframework/integration/file/remote/StreamingInboundTests.java
#	spring-integration-ftp/src/test/java/org/springframework/integration/ftp/inbound/FtpStreamingMessageSourceTests.java
#	spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/StoredProcJavaConfigTests.java

# Conflicts:
#	spring-integration-file/src/main/java/org/springframework/integration/file/remote/AbstractRemoteFileStreamingMessageSource.java
#	spring-integration-file/src/test/java/org/springframework/integration/file/remote/StreamingInboundTests.java
2019-03-01 14:58:26 -05:00
Artem Bilan
8f1a1c1777 Fix possible NPE when generate correlationData
**Cherry-pick to 4.3.x**

Related to https://github.com/spring-projects/spring-integration/pull/2761
2019-02-22 11:02:16 -05:00
Artem Bilan
f33f0575cb GH-2752: RequestMapping: react only for our event
Fixes https://github.com/spring-projects/spring-integration/issues/2752

The logic in the `IntegrationRequestMappingHandlerMapping` fully depends
on the application context it has been registered with, therefore any
arbitrary `ContextRefreshedEvent` doesn't fit our requirements.
More over it may cause a problem with missed mappings when parent-child
configuration is used.

**Chery-pick to 5.1.x, 5.0.x & 4.3.x**
2019-02-19 16:11:06 -05:00
Spring Buildmaster
ce2ed949f8 [artifactory-release] Next development version 2019-02-14 20:53:58 +00:00
Spring Buildmaster
1eee680668 [artifactory-release] Release version 5.0.12.RELEASE 2019-02-14 20:53:53 +00:00
Artem Bilan
5e6506abaf GH-2723: Handle unsupported XML properties
Fixes spring-projects/spring-integration#2723

Not all XML components support all the configuration properties.
For example Saxon HE doesn't support `XMLConstants.ACCESS_EXTERNAL_DTD`
and end up with an exception like:
`IllegalArgumentException: Unknown configuration property http://javax.xml.XMLConstants/property/accessExternalDTD`

* Change `XsltPayloadTransformer` to re-use `TransformerFactoryUtils`
from spring-ws as a centralized source of `TransformerFactory`
configuration.
* Wrap `XMLConstants.ACCESS_EXTERNAL_STYLESHEET` to the `try..catch`
and log INFO about not supported property

**Cherry-pick to 5.0.x & 4.3.x**
2019-01-29 12:36:04 -05:00
Artem Bilan
c723b69f01 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**

# Conflicts:
#	spring-integration-jmx/src/main/java/org/springframework/integration/jmx/OperationInvokingMessageHandler.java
#	spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java
2019-01-23 15:52:11 -05:00
Artem Bilan
b4a2de12aa 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:44 -05:00
Gary Russell
e8f8c37c91 GH-2705: public CTORs on AMFPFileListFilter Impls
Fixes https://github.com/spring-projects/spring-integration/issues/2705
2019-01-18 11:14:32 -05:00
Cameron Mayfield
d803e75647 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**

(cherry picked from commit cd8cbaa99c)
2019-01-16 18:04:44 -05:00
Artem Bilan
c64524b163 INT-4574: JDBC: Add NOT NULL for primary keys (#2698)
* 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

**Cherry-pick to 4.3.x**

* * Include index generation into the `schema.sql.vpp`

* * Remove redundant blank line from generated scripts

* * Fix INT_CHANNEL_MESSAGE primary generation
2019-01-15 08:34:30 -05:00
Spring Buildmaster
bb1b76146e [artifactory-release] Next development version 2019-01-10 22:01:01 +00:00
Spring Buildmaster
173daaec61 [artifactory-release] Release version 5.0.11.RELEASE 2019-01-10 22:00:56 +00:00
Artem Bilan
27aafae01b Prepare for release; upgrade dependencies 2019-01-10 16:32:22 -05:00
Artem Bilan
270fd78cea 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
* Do not rely on `spring-web` in classpath: use `ClassUtils.forName()`
to load `ServletContextResource` class for checking

# Conflicts:
#	build.gradle
#	spring-integration-xml/src/main/java/org/springframework/integration/xml/selector/XmlValidatingMessageSelector.java
#	spring-integration-xml/src/main/java/org/springframework/integration/xml/transformer/XsltPayloadTransformer.java
#	spring-integration-xml/src/main/java/org/springframework/integration/xml/xpath/XPathUtils.java
#	spring-integration-xml/src/test/java/org/springframework/integration/xml/transformer/XsltPayloadTransformerTests.java
2019-01-10 15:13:22 -05:00
Artem Bilan
565578b392 RemoteFileTemplate: Fix Checkstyle violation
* Add `if (session != null)` in the `RemoteFileTemplate` around `dirty()`

(cherry picked from commit 1d5e66b0ee)
2019-01-10 11:05:55 -05:00
Alen Turkovic
f63abc161a 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**

# Conflicts:
#	spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/Session.java
2019-01-10 10:55:27 -05:00
Gary Russell
23fb52cd20 Upgrade Spring Framework to 5.0.12 2019-01-09 12:07:23 -05:00
Gary Russell
8f34d04dcc Upgrade Jackson version 2019-01-04 16:04:12 -05:00
Artem Bilan
d5dd0a1240 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

# Conflicts:
#	spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/outbound/MongoDbOutboundGateway.java
#	spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/config/MongoDbOutboundGatewayParserTests.java
#	spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/dsl/MongoDbTests.java
#	spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/outbound/MongoDbOutboundGatewayTests.java
#	spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/rules/MongoDbAvailableTests.java
#	src/reference/asciidoc/mongodb.adoc
2018-12-21 17:28:56 -05:00
Artem Bilan
ae4b3fffb2 Increase expire period for testExpireTwoRegistries
https://build.spring.io/browse/INT-MASTER-1313/

**Cherry-pick to 5.0.x**

(cherry picked from commit 89fdb938de)
2018-12-14 11:53:49 -05:00
Artem Bilan
0199741d29 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:39:13 -05:00
Artem Bilan
a3dc10b405 Fix Javadocs in the MessageGroupQueue 2018-12-06 16:45:00 -05:00
Artem Bilan
15024858d4 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

# Conflicts:
#	spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java
#	src/reference/asciidoc/gateway.adoc
2018-12-06 16:10:24 -05:00
Gary Russell
7a2547f601 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.

(cherry picked from commit 9832f61d2a)
2018-12-04 15:16:20 -05:00
Gary Russell
be6498008f 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**

# Conflicts:
#	src/reference/asciidoc/jdbc.adoc
#	src/reference/asciidoc/whats-new.adoc
2018-11-30 13:16:39 -05:00
Spring Buildmaster
7f8a81b22f [artifactory-release] Next development version 2018-11-28 20:10:36 +00:00
Spring Buildmaster
0fd9321ec8 [artifactory-release] Release version 5.0.10.RELEASE 2018-11-28 20:10:33 +00:00
Gary Russell
3e0a3fa317 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**

(cherry picked from commit 39fef2c70a)

* Upgrade to Spring Security `5.0.10`
2018-11-28 14:27:06 -05:00
Artem Bilan
9d276ce95d Upgrade versions 2018-11-27 13:22:01 -05:00
Gary Russell
8f5154f88e Upgrade to SF 5.0.11.BS 2018-11-25 18:26:44 -05:00
Artem Bilan
20ed93a8d8 Optimize type conversion in LambdaMessageProcessor 2018-11-20 16:11:26 -05:00
Gary Russell
ffaa4ee780 Log error for class cast exception on lambda
**cherry-pick to 5.0.x**

* Fix test

* Polish log message.

* Polishing - docs and javadocs.

# Conflicts:
#	spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowDefinition.java
2018-11-19 16:58:51 -05:00
Artem Bilan
47a4b28f1f INT-4556: Fix messaging anns for FactoryBeans
JIRA: https://jira.spring.io/browse/INT-4556

We definitely need to resolve a `@Bean` method to the target object to
be sure do not create a new `MessageHandler` bean.

**Cherry-pick to 5.0.x**
2018-11-19 13:41:37 -05:00
Artem Bilan
d1b3046638 INT-4550: Disallow multi aggregators on same MGS (#2622)
* INT-4550: Disallow multi aggregators on same MGS

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

**Cherry-pick to 5.0.x**

* * Introduce `UniqueExpiryCallback`
* Use `UniqueExpiryCallback` in the `AbstractCorrelatingMessageHandler`
* Check for uniqueness in the `AbstractMessageGroupStore`
* Remove duplicate code in the `ConfigurableMongoDbMessageStore`

* * Fix tests according a new logic

* * Address PR review

* Change `Assert.isTrue` to the `logger.error` for backward compatibility
* Revert changes in tests since we don't throw exception anymore
* Fix language on doc

* * Fix Checkstyle violation in the `AbstractMessageGroupStore`

* * Ignore `testDontReapMessageOfOtherHandler()`
2018-11-15 15:02:28 -05:00
Gary Russell
1e8da3a940 INT-4552: UDP: Catch and log async send exceptions
JIRA: https://jira.spring.io/browse/INT-4552

**Cherry-pick to 5.0.x**

(cherry picked from commit ce3ac36dcd)
2018-11-13 12:05:29 -05:00
Artem Bilan
5dff882f5e INT-4551: Fix exception msg from previous commit
JIRA: https://jira.spring.io/browse/INT-4551

**Cherry-pick to 5.0.x**

(cherry picked from commit 1dca553850)
2018-11-08 14:53:52 -05:00
Artem Bilan
ce42e56d7e INT-4551: Fail if old Java DSL jar is present
JIRA: https://jira.spring.io/browse/INT-4551

**Cherry-pick to 5.0.x**
2018-11-08 13:53:52 -05:00
Artem Bilan
6d523e2a70 Fix RotatingServersTests concurrency
https://build.spring.io/browse/INT-FATS5IC-685/

Even if we stop `SourcePollingChannelAdapter`, the task on the fly is
still going to be executed.
This way we may have extra calls to our logic.

* Use `CopyOnWriteArrayList` for the `sessionSources` to avoid
`ConcurrentModificationException` during this collection read in the
tests

**Cherry-pick to 5.0.x**

(cherry picked from commit 76c670075b)
2018-11-07 10:47:05 -05:00
Artem Bilan
0418b7cbdc 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:11:30 -04:00
Gary Russell
e3c4175187 INT-4546: Expose IMAP cancel interval via DSL
JIRA: https://jira.spring.io/browse/INT-4546

(cherry picked from commit 743afafa97)
2018-10-16 13:16:59 -04:00
Spring Buildmaster
ce78a26789 [artifactory-release] Next development version 2018-10-15 17:53:18 +00:00
Spring Buildmaster
95eda8c3d7 [artifactory-release] Release version 5.0.9.RELEASE 2018-10-15 17:53:13 +00:00
Artem Bilan
d50cdcd741 Upgrade Spring Security 5.0.8
(Mostly to bring fresh build for release process)
2018-10-15 13:06:52 -04:00
Artem Bilan
a598b6d4a2 Prepare for release 2018-10-15 12:08:43 -04:00
Gary Russell
32e221d499 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**

# Conflicts:
#	build.gradle
2018-10-11 11:18:28 -04:00
Artem Bilan
490ae1b49b 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:27:14 -04:00