Commit Graph

867 Commits

Author SHA1 Message Date
Gary Russell
6216075619 Deprecation doc polishing
Channel interceptors.
2018-04-10 19:02:07 -04:00
Gary Russell
b940e3872b Upgrade to SF 5.1; Remove Deprecated Code
Polishing - PR Comments

Remove direct log4j usage in tests

- hazelcast depends on it; retain the dependency just in jmx

Fix hazelcast logger type
2018-04-10 18:49:42 -04:00
Gary Russell
544de6bf5f Add BoundRabbitChannelAdvice
Polishing and docs

Polishing - DEBUG log for confirms; add integration test

Polishing - PR Comments

Renamed Advice

Verify acks logged.

Polishing - more PR comments

Renamed to BoundRabbitChannelAdvice.

* Extract `ConfirmCallback`s instances for optimization
* Remove unused constant
2018-03-29 15:53:57 -04:00
Artem Bilan
8afdcb4893 Fix Transformers usage in Docs
**Cherry-pick to 5.0.x**
2018-03-27 12:23:05 -04:00
Gary Russell
1cd6c11808 INT-4443: Use SimpleEC for uriVariablesExpression
JIRA: https://jira.spring.io/browse/INT-4443

**cherry-pick to 5.0.x, 4.3.x**

Polishing; use data binding accessor in test evaluation contexts.

Add `.withInstanceMethods()`

See https://jira.spring.io/browse/SPR-16588?focusedCommentId=158041&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-158041

* Polishing according PR comments
2018-03-26 16:48:37 -04:00
Gary Russell
2975255be8 INT-4439: Micrometer Docs Polishing
JIRA: https://jira.spring.io/browse/INT-4439
2018-03-22 15:27:13 -04:00
Gary Russell
82f252dd00 INT-4390: Fix tangles
JIRA: https://jira.spring.io/browse/INT-4390

Phase I: flow context/registration cycle

- extract interfaces
- rename implementations to `Standard...`

Phase II - dsl<->dsl.channel tangles

Move the channel specs to dsl.

Fix missing refactorings

(Not related to DSL) - rename core `event` package to `events`

- avoid collision with event module package
- fix tangle caused by `MessageGroupExpiredEvent`.

Phase III - dsl<->config.dsl

- move classes from config.dsl to dsl

(Not related to DSL) - fix many tangles caused by graph being a sub-package of support.management
 - make `graph` a top-level package

(Not related to DSL) - move `IntegrationManagementConfigurer` from
`management` to `config` - tangle between core and management
* Polishing Copyrights, diamonds, some JavaDocs and What's New
2018-03-16 14:59:47 -04:00
Gary Russell
6718d8d433 INT-4423: Make Micrometer dependency optional
JIRA: https://jira.spring.io/browse/INT-4423

Add a facade on top of micrometer so the dependency can
be optional.t

Next iteration - PR comments

Checkstyle

More polishing; static classes etc.

checkstyle

Further polishing; docs; auto-register `MicrometerMetricsCaptor`.

Polishing - move captor load to a static method on the captor.

* Fix Checkstyle violation
* Some code style polishing
2018-03-09 15:24:29 -05:00
Gary Russell
212f478151 INT-4417: Add @EndpointId
JIRA: https://jira.spring.io/browse/INT-4417

Provide more flexibility with bean naming when using EIP Annotations with
Java configuration.

* Polishing - PR Comments

* More polishing - remove `@Inherited`; disallow with more than one EIP annotation.
2018-03-05 14:34:04 -05:00
Gary Russell
82a8982857 INT-4418: Micrometer docs and polishing
JIRA: https://jira.spring.io/browse/INT-4418

Add docs for the rework and optimize `Meter` creation.

Polishing

* Polishing according PR comments

* Fix typo in `dsl.adoc`
2018-02-28 14:09:04 -05:00
Artem Bilan
60be69335f Polishing configuration.adoc 2018-02-26 14:15:19 -05:00
Gary Russell
24809557fb INT-4408: PollerSpec Doc Polishing
JIRA: https://jira.spring.io/browse/INT-4408
2018-02-20 14:26:43 -05:00
Gary Russell
9123503ec9 Fix asciidoc syntax
A code block was incorrectly labeled as java.
2018-02-16 14:44:15 -05:00
Artem Bilan
800184270a INT-4402: Apply global interceptors at runtime
JIRA: https://jira.spring.io/browse/INT-4402

Make `GlobalChannelInterceptorProcessor` as a `BeanPostProcessor`,
so it can apply global `ChannelInterceptor`s to any initialized channel
beans, even those created at runtime, like in case of dynamic flows with
Java DSL

**Cherry-pick to 4.3.x**

* Add `postProcessDynamicBeans` global property with `false` by default
* Rely on the `postProcessDynamicBeans` property in the
`GlobalChannelInterceptorProcessor.postProcessAfterInitialization()`
*  Add `postProcessDynamicBeans=true` to the
`GlobalChannelInterceptorTests-context.xml` to be sure in the test-case
that option works
* Document the option and effect from the global channel interceptors
2018-02-16 11:33:19 -05:00
Artem Bilan
11240be555 GH-2358: Register IntGraphController for WebFlux
Fixes https://github.com/spring-projects/spring-integration/issues/2358

The WebFlux on the server side can deal with MVC `@Controllers` as well
without any Servlet environment.

* Enable `IntegrationGraphController` when we not only in the
Servlet environment, but also in the WebFlux
* Upgrade to SF-5.0.4 and fix WebFlux tests to meet the latest requirements
  (https://jira.spring.io/browse/SPR-16337)
* Move `WEB_FLUX_PRESENT` to the `HttpContextUtils`;
deprecate it in the `WebFluxContextUtils`
* Mention WebFlux ability for the `IntegrationGraphController` in the
`graph.adoc`
2018-02-14 11:08:57 -05:00
Gary Russell
a4130c9e59 INT-4401: Document working with shaded jars
JIRA: https://jira.spring.io/browse/INT-4401

How to fix up the `spring.factories` etc.

* Polishing
2018-02-13 16:19:15 -05:00
Gary Russell
54754743a5 INT-4384: Micrometer Support
JIRA: https://jira.spring.io/browse/INT-4384

Add support for micrometer metrics collection.

Initial commit.

* Rebase; upgrade to Micrometer rc.8

* Polishing - PR Comments

* Final Polishing
2018-02-02 15:30:48 -05:00
Gary Russell
30fac62c2c INT-4388: Add UdpServerListeningEvent
JIRA: https://jira.spring.io/browse/INT-4388

Publish an event when the UDP server socket is established.

* Polishing - remove unreachable assertions
2018-01-30 13:34:53 -05:00
Gary Russell
5695d43ca0 Fix PDF Overflows 2018-01-20 13:21:56 -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
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
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
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
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
0245e77136 Docs example for DSL IdempotentReceiver 2017-12-27 17:05:29 -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
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
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
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
7d7fad31c9 INT-4169: Document dynamic HTTP URI variables
JIRA: https://jira.spring.io/browse/INT-4169
2017-11-27 16:11:03 -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
1244c6c22a The log() in the end IMPORTANT note in dsl.adoc 2017-11-15 15:21: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
Artem Bilan
f7e75223c7 INT-4361: Add a role() hook to Java DSL
JIRA: https://jira.spring.io/browse/INT-4361

* To get a gain of the method chain code flow and avoid extra annotation
parsing, add `.role(String)` hook to the `EndpointSpec`
* Delegate the provided `role` property to the `AbstractEndpoint`
* Register `AbstractEndpoint` as itself `SmartLifecycle` in the
`SmartLifecycleRoleController`
* Add `destroy()` to the `AbstractEndpoint` and remove it from the
`SmartLifecycleRoleController`
* Provide some Java 8 code style refactoring

* Rework XML parsers and Annotation processors to populate `role`
property on the `AbstractEndpoint`
* Wrap `roleController` bean extraction to the `NoSuchBeanDefinitionException` catch
* Fix several `AbstractEndpoint` implementation to properly call
`super.onInit()` which has been missed before
2017-11-10 13:58:28 -05:00
Artem Bilan
a61327766e GH-2207: Clarify RedisMetadataStore in cluster
Resolves: spring-projects/spring-integration#2207

* Since the `WATCH` command isn't supported on clustered connections,
the `RedisMetadataStore.replace()` operation can't be used there.
Document this limitation
2017-11-10 11:37:47 -05:00
Artem Bilan
6891d5a2e2 INT-4277: Add Java DSL chapter to the Docs
JIRA: https://jira.spring.io/browse/INT-4277

*Mostly migration from the https://github.com/spring-projects/spring-integration-java-dsl/wiki/Spring-Integration-Java-DSL-Reference
* Add cross links from some appropriate chapters
* Fix log message in the `WebSocketInboundChannelAdapter`

* Document `IntegrationFlowContext`
* Document gateways via `IntegrationFlow`
2017-11-10 11:31:48 -05:00
Artem Bilan
098e8bc58f INT-4291: Post-merge polishing
JIRA: https://jira.spring.io/browse/INT-4291

* Fix code style in the `ExpressionEvaluatingSqlParameterSourceFactory`
* Remove redundant
`ExpressionEvaluatingSqlParameterSourceFactory.registerSqlTypes` in
favor of the direct access to the `sqlParametersTypes` from the
`ExpressionEvaluatingSqlParameterSource` ctor
* Reformat code style in the `pollingWithSelectParameterSourceJdbcInboundChannelAdapterTest.xml`
* Fix code style in the `ExpressionEvaluatingSqlParameterSourceFactoryTests`
* Polishing `whats-new.adoc` for proper formatting and single link from
the section to the particular chapter
* Fix formatting and wording in the `jdbc.adoc`
2017-11-06 11:33:05 -05:00
Meherzad Lahewala
854dba1366 INT-4291 Add ExprEvalSqlPSF.setSqlParameterTypes
JIRA: https://jira.spring.io/browse/INT-4291

* Fix checkstyle trailing space
*Use correct way to constants in spring xml and fix test case

* Polishing - Update javadoc and rename method name to relate more to the behavior
2017-11-06 11:19:01 -05:00
Artem Bilan
8766262399 INT-4360: Add ClientStompEncoder support
The `StompSubProtocolHandler` explicitly sets `stompCommand` header
to the `MESSAGE` value ignoring any client inputs.
In this case the message is treated as from the server and ignored on
the STOMP Broker side from the client session.

* Introduce `ClientStompEncoder` for the client side to be injected
into the `StompSubProtocolHandler` for the proper client side messages
encoding/decoding.
Override `stompCommand` header to the `SEND` value if it is `MESSAGE`
before encoding to the `byte[]` to send to the session

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

**Cherry-pick to 4.3.x**

Fix WebSocket test to rely on the proper client config class
and don't pick up the server config unconditionally in the test context
2017-10-31 09:25:52 -04:00
Gary Russell
06aa45e91f INT-4279: Document UDP Java Configuration
JIRA: https://jira.spring.io/browse/INT-4279

Add documentation for Java configuration of UDP channel adapters.
Enhance DSL to support host/port for outbound adapters.
2017-10-30 13:49:44 -04:00
Artem Bilan
d7d56a0444 INT-4081: Post-merge polishing and improvements
JIRA: https://jira.spring.io/browse/INT-4081

* Rename `MessageGroupPreparedStatementSetter` to `ChannelMessageStorePreparedStatementSetter`
* Add JavaDocs to the `ChannelMessageStorePreparedStatementSetter`
* Polishing `JdbcChannelMessageStore` JavaDocs; remove unused `BeanFactory`
* Polishing Docs for typos and proper text flow
2017-10-23 11:48:35 -04:00
Meherzad Lahewala
34d0859515 INT-4081: Custom PreparedStSetter for JdbcMChStore
JIRA: https://jira.spring.io/browse/INT-4081

* Add `MessageGroupPreparedStatementSetter` to let end-user to override
the message insertion logic
* Add tests and Docs
2017-10-23 11:48:34 -04:00
Artem Bilan
077b5ffffc INT-4344: AbstRemoteFileOutGw: Add assert for NPE
JIRA: https://jira.spring.io/browse/INT-4344

The `FtpOutboundGateway` provides ctors without expression for remote path.
In this case it is treated as a `working directory` but only for the
`LS`, `NLST`, `PUT` and `MPUT` commands.

* Add assertion in the `AbstractRemoteFileOutboundGateway` to discard
configuration for all other commands when `expression` is `null`

**Cherry-pick to 4.3.x**
2017-10-16 17:04:22 -04:00
Artem Bilan
bf63ef5491 GH-2253: Revert (S)FTP Source to DefaultDirScann
Fixes spring-projects/spring-integration#2253

For backward compatibility and use-cases when processed files are stored
in sub-directories in the `localDirectory` revert the
`AbstractInboundFileSynchronizingMessageSource` logic back to the
`DefaultDirectoryScanner`.
The `RecursiveDirectoryScanner` can be injected via `scanner` option
2017-10-16 16:05:44 -04:00
Artem Bilan
1fa73a9728 INT-4356: FileTransferMH: Add string SpEL setters
JIRA: https://jira.spring.io/browse/INT-4356

**Cherry-pick to 4.3.x**

Address PR comments:
* Remove unused variable in the test case
* Add string-based SpEL setters to the `AbstractInboundFileSynchronizer`
* Fix `@since` in the `FileTransferringMessageHandler` to the proper version
2017-10-16 15:51:12 -04:00
Glenn Renfro
1979f91cf5 INT-4357: LeaderInit: Add failed to lock event
JIRA: https://jira.spring.io/browse/INT-4357

Updated based on code review.

Updated adocs

*Polishing code style, typos
* Add protection from NPE when `LockRegistryLeaderInitiator` isn't
supplied with the `leaderEventPublisher`
* Add `What's New` note
2017-10-13 13:15:12 -04:00
Jorge
a7eebed252 Typo at FTPs example
Use DefaultFtpsSessionFactory instead of DefaultFtpsClientFactory
2017-10-12 15:14:42 -04:00
Glenn Renfro
e515a0d643 INT-4353: Let to set id for DefaultLockRepository
JIRA: https://jira.spring.io/browse/INT-4353

Updated based on code review

* Polishing according PR comments

**Cherry-pick to 4.3.x**
2017-09-29 09:57:59 -04:00