Commit Graph

9039 Commits

Author SHA1 Message Date
Artem Bilan
2fbb6fbaf4 Fix JdbcLockRegDiffClientTests race condition
https://build.spring.io/browse/INT-MJATS41-1242

When different `DefaultLockRepository` instances use the same client id,
there is a possibility that they will update the same row in the table.
This way we have a chance that not only one obtains a lock and try to
add a value to the collection.

* Remove the test-case for the same client id as non-stable and even
dangerous by the the distributed lock purpose
* Use `tryLock(Long.MAX_VALUE)` to really ensure the wait behavior
during the concurrent loop
* Use `20` for thread pool to align with the tasks amount

**Cherry-picked to 4.3.x**
2018-01-24 17:26:33 -05:00
Artem Bilan
c48a2392d2 Use JavaScript instead of Ruby
https://build.spring.io/browse/INT-SI43X-230

Looks like Ruby engine takes some time to start and
`Jsr223InboundChannelAdapterTests` is slow as 3 seconds locally as well

* Change the script to JavaScript and now we have 200 millis

**Cherry-pick to 4.3.x**
2018-01-24 15:07:26 -05:00
Gary Russell
870cd77d52 Fix Hang in JMS Test
- add a timeout for template.receive()
- don't cache consumers
2018-01-24 14:09:03 -05:00
Artem Bilan
aca79f842d Fix deprecation from SF-5.0.3
* Upgrade to Spring Data Key SR3, Reactor-3.1.3, Reactor Netty-0.7.3
2018-01-24 11:13:01 -05:00
Gary Russell
534bb6cd37 Bump SF to 5.0.3 2018-01-24 09:55:15 -05:00
Artem Bilan
9f6457fc31 INT-4383: Add test for EnricherSpec.errorChannel
JIRA: https://jira.spring.io/browse/INT-4383
2018-01-23 12:42:38 -05:00
Alexis Hafner
061dcb1b87 INT-4383 Expose errorChannel in EnricherSpec
JIRA: https://jira.spring.io/browse/INT-4383
2018-01-23 12:31:27 -05:00
Abhijit Sarkar
56ffed0801 GH-2340: Fix WebFluxMessageHandlerSpec
Fixes https://github.com/spring-projects/spring-integration/issues/2340

* Make `WebFluxMessageHandlerSpec` to support method chain
* Add `WebFluxDslTests.testWebFluxFlowWithReplyPayloadToFlux()`
2018-01-23 10:10:40 -05:00
Artem Bilan
01b0e1c79a INT-4366: Fix MulticastSendingMH race condition
JIRA: https://jira.spring.io/browse/INT-4366

The `MulticastSendingMessageHandler.getSocket()` doesn't guard around
`this.multicastSocket` property causing `NPE` and other inconsistency
in the multi-threaded environment

* Make the whole `MulticastSendingMessageHandler.getSocket()` as
`synchronized` like it is with the super method
* Reuse `closeSocketIfNeeded()` in the
`UnicastSendingMessageHandler.handleMessageInternal()`
* Fix type in the `UnicastSendingMessageHandler` logging message
* Fix `UdpChannelAdapterTests` for missed `BeanFactory` for the SpEL
and also `MulticastSendingMessageHandler.stop()` in one missed places

**Cherry-pick to 4.3.x**
2018-01-22 17:19:32 -05:00
Artem Bilan
170292acf3 Shutdown executors in TCP/IP tests 2018-01-22 16:17:20 -05:00
Artem Bilan
2736de99de Fix JdbcLockRegistry tests
https://build.spring.io/browse/INT-MASTER-901

The `JdbcLockRegistryDifferentClientTests.testOnlyOneLock()` relies
on the `ArrayList.isEmpty()` state to proceed with the logic.
But since the `ArrayList.size` property is not `volatile`, there is no
guarantee for the proper state in the multi-threaded environment like
we have in this test-case.

* Replace `ArrayList` in the test with the `LinkedBlockingQueue` which
already rely on the `AtomicInteger` for the `size` property
* Fix `JdbcLockRegistry` tests to shutdown used `ExecutorService` s
to ensure set free threads after test suite execution.

**Cherry-pick to 4.3.x**
2018-01-22 12:52:49 -05:00
Gary Russell
55d92edd4e INT-4382: Fix deadlock in FileWritingMH
JIRA: https://jira.spring.io/browse/INT-4382

There is a deadlock in the FMWH due to lock ordering.

Writes try to lock the handler monitor while holding the file lock.
The `Flusher` tries to lock the file lock while holding th handler monitor.

- Change the `Flusher`, `stop` and `flushIfNeeded` methods to not call close
  on the file state while holding the handler monitor.

__cherry pick to 4.3.x__ (fix <> for Java 6)

Polishing - PR Comments

* Optimize `flushIfNeeded(FlushPredicate)` to delegate only to the
`flushIfNeeded(MessageFlushPredicate, Message<?>)`
2018-01-22 11:45:40 -05:00
Gary Russell
5695d43ca0 Fix PDF Overflows 2018-01-20 13:21:56 -05:00
Gary Russell
2d6984b3cb Revert "INT-4366: Fix MulticastSendingMH
This reverts commit c3b64dc1ac.
2018-01-19 17:19:27 -05:00
Artem Bilan
c3b64dc1ac INT-4366: Fix MulticastSendingMessageHandler (#2329)
* INT-4366: Fix MulticastSendingMessageHandler

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

Fix race condition in the `MulticastSendingMessageHandler` around
`multicastSocket` and super `socket` properties.

* Synchronize around `this` and check for the `multicastSocket == null`.
This let the `MulticastSendingMessageHandler` to fully configure and
prepare the socket for use.
* Remove `socket.setInterface(whichNic)` since it is populated by the
`InetSocketAddress` ctor before

**Cherry-pick to 4.3.x**

* Fix thread leaks in TCP/IP tests
2018-01-19 12:34:57 -05:00
Gary Russell
8aa91d1db0 Shutdown test executors in -core
- don't use `ExecutorService` as `@Bean` - spring can't stop them
- also add log adjuster for ftp test that sometimes fails
2018-01-19 10:21:55 -05:00
Gary Russell
d890f14c5d More JMS Test speed improvements
- reduce timeouts for tests that expect to time out
- reduce iterations
2018-01-18 15:27:30 -05:00
Gary Russell
fd94955771 INT-4379: JMS OG Shutdown reply container on stop
JIRA: https://jira.spring.io/browse/INT-4379

- shutdown the container when the gateway is stopped

Also, improve test suite

- at the end of the tests, hundreds of threads are running, some caused by the above
  but others because `TaskExecutor`s are not shut down
- reduce the number of iterations in the JMS pipeline tests to speed things up
- change more tests to extend `ActiveMQMultiContextTests`, to keep a single broker up

__cherry-pick to 4.3.x__ (perhaps just the gateway fix)
2018-01-18 14:12:53 -05:00
Artem Bilan
7e263aa618 GH-2301: Add SimpMessageGrFactory.GroupType.LIST
Fixes https://github.com/spring-projects/spring-integration/issues/2301

* For non-ordered, without deduplication logic use-case the `ArrayList`
option for internal `SimpleMessageGroup` collection is added
* Make `SimpleMessageGroup` `protected` ctor as `public` for better
reuse in case of custom `MessageGroupFactory`
2018-01-18 11:56:25 -05:00
Artem Bilan
86c76999f6 Optimize AbstractMessageSources
To avoid `Message` re-creation during `AbstractMessageSource.receive()`
logic, refactor `AbstractMessageSource` implementations
to return `AbstractIntegrationMessageBuilder`

* Add `AbstractIntegrationMessageBuilder<File> doReceive()` to the
`FileReadingMessageSource` to be called from the `AbstractInboundFileSynchronizingMessageSource`
to avoid message recreation in its `doReceive()`
* Some code style refactoring in the `AbstractMessageSource`
2018-01-18 11:17:03 -05:00
Yilin Wei
e6ec86c505 INT-3945: Add async to the @ServiceActivator
JIRA: https://jira.spring.io/browse/INT-3945

Adding test for async annotated ServiceActivator

fix whitespace

Address comments

Change copyright and author

* Some code style polishing
* Rename `Log4j2LevelAdjuster.level()` to more friendly `forLevel()`
factory method name.
* Add `@param level` to the `Log4j2LevelAdjuster.forLevel()` to fix
JavaDoc warning
2018-01-18 09:48:22 -05:00
Gary Russell
1bb4f86151 Minor Fixes
- use passive mode for FTP tests
(active fails on one of my machines for some reason)

* Fix generic args instead of `@SuppressWarnings("rawtypes")`
2018-01-16 16:37:50 -05:00
Gary Russell
032c8fa55d INT-4378: TCP Fix CF Name in Intercepted Events
JIRA: https://jira.spring.io/browse/INT-4378

Events (e.g. `TcpConnectionOpenEvent` from intercepted connections contain an
'unknown' connection factory name.

Delegate to the underlying connection's factory name.
2018-01-16 13:00:26 -05:00
Artem Bilan
c4c4e51627 Some JsonPropertyAccessor polishing
* Add `WrappedJsonNode.getTarget()` API to let target users to get
access to the target `JsonNode` for their logic
* Some code style and JavaDocs improvements in the `JsonPropertyAccessor`
2018-01-12 11:54:02 -05:00
Artem Bilan
a4eb55bf7a Fix SpelPropertyAccessorRegistrar
The `SpelPropertyAccessorRegistrar` ctor and
`add(PropertyAccessor... propertyAccessors)` method use wrong variable
to build a key for the provided `PropertyAccessor`.
Therefore during iteration the next `PropertyAccessor` overrides the
previous and we end up just only with one instance in the registry

* Extract `private static obtainAccessorKey()` method to build
decapitalized key for the `PropertyAccessor`
* Change the map store to the `LinkedHashMap` to keep order of the
provided `PropertyAccessor` s
* Modify `EnableIntegrationTests` to ensure that we support several
`PropertyAccessor` s and in the proper order

**Cherry-pick to 4.3.x**
2018-01-12 11:50:33 -05:00
Gary Russell
00b910c874 INT-4371: More polishing - consumer queue header
JIRA: https://jira.spring.io/browse/INT-4371
2018-01-11 15:24:48 -05:00
Gary Russell
c98d50540c INT-4371: Polishing - raw message header; docs
JIRA: https://jira.spring.io/browse/INT-4371

* Polishing - DSL
2018-01-11 11:08:49 -05:00
Artem Bilan
30450c48be INT-4376: Upgage to Log4J 2 (#2321)
* INT-4376: Upgage to Log4J 2

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

* Deprecate Log4J 1.x components in favor of newly added
a `Log4j2LevelAdjuster` JUnit `@Rule`
* Update all the logging configuration to Log4J 2

* Polishing after testing
2018-01-11 10:59:55 -05:00
Gary Russell
422f651113 DSL: Polishing AMQP ICA Spec
Also add `messageHeaders()` to `MessageSourceSpec`.
2018-01-05 16:36:02 -05:00
Artem Bilan
b5ec98f025 WebFlux improvements
* add `BodyExtractor` support for Outbound part
* add `ClientHttpResponseBodyExtractor` as identity function
* add XML configuration for the Inbound part
* document `BodyExtractor` and Inbound XML support

Rename `replyToFlux` property to the `replyPayloadToFlux`

Doc Polishing
2018-01-05 14:17:37 -05:00
Artem Bilan
1e1346dc94 Upgrade to Servlet API 4.0 and AspectJ-1.8.13 2018-01-04 17:39:33 -05:00
Gary Russell
bab850595a INT-4371: Add MessageSource Acknowlegment support
JIRA: https://jira.spring.io/browse/INT-4371

Add an abstract message source that populates the message with a header containing
an abstraction that allows the application to acknowledge/reject/requeue the message.
(In amqp, for example, this would map to channel.basicAck(tag),
channel.basicReject(tag, false), and channel.basicReject(tag, true).

With some brokers (such as kafka), acknowledge and reject might be equivalent
since there is no automatic DLQ processing in kafka both would simply commit the offset.

Also include a strategy interface for a factory to provide the acknowledgment header.

Add MessageSourcePollableChannel

Fix typo

Polishing - PR Comments

- remove marker interface; just use presence of the header for auto-ack
- remove the MessageSourcePollableChannel - users can use a MethodInterceptor to enhance the message
- other PR comments

Save entire response to allow customization of the ack/nack actions.

Docs, Copyrights; add MessageSourcePollingTemplate

Polishing - PR Comments - support disabling auto-ack, when possible.

More Utilities

* Simple code style polishing
2018-01-04 17:28:21 -05:00
Gary Russell
5ad304a2a2 INT-4374: TCP Fix elastic raw deserializer
JIRA: https://jira.spring.io/browse/INT-4374

Detect end of stream to prevent emitting an empty byte[] payload.
2018-01-04 09:55:14 -05:00
Gary Russell
f21f81092d INT-4369: Add DeliveryAttempt header
JIRA: https://jira.spring.io/browse/INT-4369

Also add `StaticMessageHeaderAccessor`

- avoids object creation when getting type-safe well-known headers.

* Docs
2018-01-02 16:17:32 -05:00
Gary Russell
381d3f9483 Doc Copyright 2018 2018-01-02 12:59:59 -05:00
Gary Russell
1724aecb24 GH-2313: IdempotentReceiver Discard Channel Name
Resolves: https://github.com/spring-projects/spring-integration/issues/2313

Allow configuration of the discard channel by name.

Refactor the interceptor to extend `IntegrationObjectSupport` and use
a channel resolver, if necessary.

* Polishing
2018-01-02 12:53:50 -05:00
Gary Russell
e2d919ce00 Add Github Issue and PR templates
* Polishing - PR Comments
2018-01-02 11:13:26 -05:00
Gary Russell
6f56e8ba11 Add UDP Test Diagnostics 2017-12-28 14:41:27 -05:00
krizsan
d273345234 INT-4373: Fix channel error count
JIRA: https://jira.spring.io/browse/INT-4373

Error count is wrong when just counts enabled.

CheckStyle fix.

Reduce send timeout in test.
2017-12-28 09:45:41 -05:00
Gary Russell
0245e77136 Docs example for DSL IdempotentReceiver 2017-12-27 17:05:29 -05:00
Artem Bilan
34ffd9654d Fix SimpleJsonSerializer when exception on prop
When the target Java Bean reader throws an exception it is wrapped to
the `InvocationTargetException` which `getMessage()` returns `null`.

* Extract the `cause` when `InvocationTargetException` and check the
`message` for null anyway.
* Also check for `null` before calling `toString()` in the
`SimpleJsonSerializer.toElement()`
2017-12-20 16:15:41 -05:00
Gary Russell
e585bb949f INT-4368: Twitter - move init to start()
JIRA: https://jira.spring.io/browse/INT-4368

Test fails if redis not available.

Also fix synchronization of `lastEnqueuedId`.
2017-12-19 15:10:26 -05:00
Artem Bilan
bd872846fb GH-2300: Add Flux support in WebFluxRequestExecMH
Fixes: spring-projects/spring-integration#2300

To allow to consume a streaming HTTP response downstream expose
`replyToFlux` option on the `WebFluxRequestExecutingMessageHandler`.
This way the body of the HTTP response can be converted now to the
`Flux` for subsequent output message.
The option is `false` by default; can be changed to `true` in the `5.1`
2017-12-19 09:42:02 -05:00
Artem Bilan
21bf69b7f8 INT-4367: Fix MessagingMethodInvHelper for CGLIB
JIRA: https://jira.spring.io/browse/INT-4367

When CGLIB proxy is used for messaging POJO invocation,
the `InvocableHandlerMethod` doesn't recognize method parameter
annotations and therefore the logic is wrong at runtime or just
rejected during method processing

* Use `AopUtils.selectInvocableMethod()` to select the proper method to
call according the provided proxy type
2017-12-19 09:29:55 -05:00
Artem Bilan
2f450f7cde Polishing dsl.adoc 2017-12-18 14:12:22 -05:00
Artem Bilan
75b5948c47 GH-2302: Clarify in Docs the DSL log() behavior
Fixes: spring-projects/spring-integration/issues/2302
2017-12-15 11:48:23 -05:00
Artem Bilan
74486a7fde Upgrade to Smack-4.2.2
https://build.spring.io/browse/INT-FATS5IC-340
2017-11-30 10:03:20 -05:00
Spring Buildmaster
65cf21c473 [artifactory-release] Next development version 2017-11-28 20:00:02 +00:00
Spring Buildmaster
7072beab20 [artifactory-release] Release version 5.0.0.RELEASE 2017-11-28 19:59:55 +00:00
Artem Bilan
8805dd6533 GH-2243: Fix producer endpoint image
Fixes: spring-projects/spring-integration#2243

The Message is indeed a result of `MessageChannel` consumption, but
definitely not a part of interaction with the tarter system.
For example `FileWritingMessageHandler` obviously writes to file,
but don't produce any messages
2017-11-28 14:14:34 -05:00