Commit Graph

9623 Commits

Author SHA1 Message Date
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
Artem Bilan
7592d9443e Upgrade to SS-5.0-GA and SA-2.0.1 2017-11-28 12:59:17 -05:00
Oleg Zhurakousky
b58087881a INT-4365 Fixed NPE generated by previous commit
JIRA: https://jira.spring.io/browse/INT-4365
2017-11-28 09:21:28 -05:00
Artem Bilan
90c46f5a79 INT-4365: Improve notPropagatedHeaders function
JIRA: https://jira.spring.io/browse/INT-4365

It is much useful to configure the `notPropagatedHeaders` as a set of
patterns to match.
In this case we can filter a group of headers with the common prefix or
suffix

* Allow to configure `AbstractMessageProducingHandler.setNotPropagatedHeaders`
as simple patterns; the `*` means filter all - not copy request headers
at all - similar to `transformer` behavior
* Add `ConsumerEndpointSpec.notPropagatedHeaders()` for Java DSL
* Add `not-propagated-headers` to the `<service-activator>`

Address PR comments; some other improvements

* Fix `ConsumerEndpointSpec#notPropagatedHeaders()` log message
* Improve `AbstractMessageProducingHandler.notPropagatedHeaders() logic
so any `*` in the set of patterns eliminates all others since it has
a highest priority
* Expose `requires-reply` for the `<transformer>` as a `true` by default
* Refactor a bit `AbstractStandardMessageHandlerFactoryBean` hierarchy to
avoid duplicated code

* Fix `message.adoc`
* Add `noHeadersPropagation` flag to the `AbstractMessageProducingHandler`
* Rework logic in the `updateNotPropagatedHeaders()` to store the array
of patterns instead of `Set` to avoid extra operation on each message
* Combine `noHeadersPropagation` with the `shouldCopyRequestHeaders()`
in the `createOutputMessage()` for logic to determine if we should start
the copy-headers procedure at all

* Revert `AbstractMessageProducingHandler.selectiveHeaderPropagation`
* Optimize `AmqpOutboundGatewayParserTests` performance from 3 secs to 0.5

Fix more NPEs in the `AbstractMessageProducingHandler`
2017-11-27 16:56:41 -05:00
Artem Bilan
7c701ca5e6 INT-2576: Optimize JdbcMS.removeMessageGroup
JIRA: https://jira.spring.io/browse/INT-2576

* Do not fetch message ids and then iterate over them to remove
one by one - just use an appropriate `DELETE` query for all messages
2017-11-27 16:12:13 -05:00
Artem Bilan
7d7fad31c9 INT-4169: Document dynamic HTTP URI variables
JIRA: https://jira.spring.io/browse/INT-4169
2017-11-27 16:11:03 -05:00
Artem Bilan
c3ca61d4a0 Don't wrap SpEL result message to another message
The `ExpressionEvaluatingTransactionSynchronizationProcessor` wraps
an expression evaluation result to the `Message` unconditionally

* Don't wrap one message to another if SpEL result is a `Message` per se
* Don't wrap the received message to another if the `expression` isn't
configured.

**Cherry-pick to 4.3.x**
2017-11-27 16:04:41 -05:00
Craig Walls
28f1769899 Revert to Spring Social Twitter 1.1.2.RELEASE 2017-11-27 15:57:20 -05:00
Artem Bilan
d17c89ae56 Upgrade to SF-5.0.2 and SD Kay SR2 2017-11-27 11:49:49 -05:00
Meherzad Lahewala
96aa7280a0 INT-3876: Track groups in correlation endpoints
JIRA: https://jira.spring.io/browse/INT-3876

INT-3876 track groups ids in AbstractCorrelatingMessageHandler and docs

INT-3876 Fix merge conflict and add missing link in doc

INT-3876 Move groupId check in message group processor and rework on docs

INT-3876 Remove extra space from the doc

INT-3876 Fix checkstyle refer instance variable groupid correctly

INT-3876 Update aggregator doc with more details

* Polishing `aggregator.adoc`
* Rework `AbstractCorrelatingMessageHandlerTests.testDontReapMessageOfOtherHandler`
do not use redundant options
2017-11-20 14:51:50 -05:00
Artem Bilan
f3072af192 INT-550: Optimize AbstractIntNamespaceHandler
JIRA: https://jira.spring.io/browse/INT-550

* We need verify schema version and register `IntegrationRegistrar`
only once, not on parsing each element
* `@Ignore` time-sensitive `GroovyScriptExecutingMessageProcessorTests`
* Upgrade to Gradle-4.3.1 to overcome NPE with caches
2017-11-20 13:58:59 -05:00
Artem Bilan
41a47171c2 Upgrade to Reactor 3.1.2 and some polishing
* Fix TCP/IP `ParserUnitTests.testInUdpMulticast()` do not check
the port.
No guarantee with the OS selection port that it is always going
to be `> 5100`
* Optimize `RmiInboundGatewayParserTests` to load application context
only once - `@RunWith(SpringRunner.class)`
2017-11-17 12:31:25 -05:00
Artem Bilan
1244c6c22a The log() in the end IMPORTANT note in dsl.adoc 2017-11-15 15:21:14 -05:00
Artem Bilan
89614f7ff6 Upgrade to SF-5.0.2.B-S to ensure compatibility
* Fix `EnableIntegrationTests.testMessagingGateway()` do not check for
compiled SpEL since it isn't compilable any more for the Proxy classes
2017-11-15 14:52:35 -05:00
Artem Bilan
9414ceef86 Post merge polishing
JIRA: https://jira.spring.io/browse/INT-4363

* Register `HandlerMethodArgumentResolver`s in the
`IntegrationRegistrar` as `BeanDefinition`s to let them be configured by
the `BeanFactory` callback.
The direct instance doesn't call callbacks
* Use `JacksonPresent` in the `IntegrationRegistrar` instead of local
property
* Some code style polishing for the `IntegrationRegistrar`
* Add `JsonPathTests.testJsonPathOnPayloadAnnotation()` to ensure
that `PayloadExpressionArgumentResolver` is properly configured by the
`BeanFactory` and `#jsonPath()` SpEL-function is properly evaluated on
the `@Payload` for method `@ServiceActivator` method argument
2017-11-15 14:07:46 -05:00
Gary Russell
986d5fc0cd INT-4363: Configurable MessageHandlerMethodFactory
JIRA: https://jira.spring.io/browse/INT-4363

The JIRA requests making the `MessageHandlerMethodFactory` a bean.
This is not possible without a major rework of the `MessagingMethodInvokerHelper`.

The problem is that the `InvokerHandlerMethod` s are created before the factory
is initialized. In fact, it only works at all since the IHMs have a hard reference
to the factory's argument resolvers so, when they are initialized in `initialize()`
each handler sees the resolvers.

This really needs to be improved but, since we are so close to GA, the compromise
was to add a `HandlerMethodArgumentResolversHolder` which holds the standard resolvers
which are then wired into the factory (along with the message converter).

Delaying the creation of the `InvokerHandlerMethod` is not trivial; today they are
built in the CTOR; moving it to `initialize()` would prevent the fast failure for
a badly configured bean; the proper solution might be to make the MMIHs beans themselves.

Polishing - PR Comments
2017-11-15 14:07:14 -05:00
Artem Bilan
7ca20e53f7 GH-2268: Add RedisHeaders.MESSAGE_SOURCE header
Resolves: /spring-projects/spring-integration#2268

* To indicate the source the Redis message in the `RedisInboundChannelAdapter`
populate the `RedisHeaders.MESSAGE_SOURCE` header to the messages to produce
* Fix the `SimpleMessageConverter` to populate the provided `MessageHeaders`
to the message to produce

* Add `toMessage(T object, @Nullable Map<String, Object> headers)`
to the `InboundMessageMapper` to propagate additional header
to the message to create
* Rework all the out-of-the-box `InboundMessageMapper` implementations
to properly propagate additional headers via `toMessage()`
from the `SimpleMessageConverter`
* Provide optimizations in the `InboundMessageMapper` implementations
do not re-create messages
* Refactor `MutableMessage.toString()` to align with the `GenericMessage`

* Add more `@Nullable` to method arguments
* Increase latch wait timeout in the `EndpointParserTests`
* Address `redis.adoc` PR comment
2017-11-15 11:06:18 -05:00