Commit Graph

1049 Commits

Author SHA1 Message Date
Artem Bilan
0f5bd4a40a INT-3494: Resolve dir for writing as a Resource (#3109)
* INT-3494: Resolve dir for writing as a Resource

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

The expression for local directory can be resolved into a `Resource`
or resource location.
* Fix `ExpressionUtils.expressionToFile()` to support `Resource` and
also use `ResourceUtils.getFile(path)` when expression result is a string
* Modify tests to ensure that resource is resolved properly
* Upgrade affected tests to JUnit 5
* Mention an new functionality in docs

* * Improve Java doc for `ExpressionUtils.expressionToFile()`
* Finish the sentence in the `file.adoc`
2019-11-14 16:27:59 -05:00
Artem Bilan
72f7c72392 GH-3107: Add errorOnTimeout for TcpInboundGateway
Fixes https://github.com/spring-projects/spring-integration/issues/3107

The `MessagingGatewaySupport` has an `errorOnTimeout` option to throw
a `MessageTimeoutException` when downstream reply doesn't come back in
time for configured reply timeout

* Expose an `errorOnTimeout` option as a `TcpInboundGateway` ctor
property
* Add new factory methods into a `Tcp` factory for Java DSL
* Ensure a property works as expected in the `IpIntegrationTests`
* Document a new option

* Add a setter for MessagingGatewaySupport.errorOnTimeout option
* Expose an `errorOnTimeout` option on the DSL's `MessagingGatewaySpec`
making all the out-of-the-box inbound gateways possible to react to the
`MessageTimeoutException` when no reply during reply timeout
* Propagate properly `errorOnTimeout` in the `JmsInboundGateway`
* Modify docs respectively

* Improve docs about `errorOnTimeout`
2019-11-14 09:07:46 -05:00
Artem Bilan
feae9d8dcd Remove duplicate WebFlux endpoints summary
There is a WebFlux endpoints row in the `endpoint-summary.adoc`
table in its proper place by alphabet order, therefor one just after an
HTTP is wrong
2019-11-12 15:34:07 -05:00
Artem Bilan
3e68228ae3 More docs for new RSocket features 2019-11-01 16:53:23 -04:00
Artem Bilan
6468ecc530 GH-3089: Add AmqpInGateway.replyHeadersMappedLast (#3091)
* GH-3089: Add AmqpInGateway.replyHeadersMappedLast

Fixes https://github.com/spring-projects/spring-integration/issues/3089

In some use-case we would like to control when headers from SI message
should be populated into an AMQP message.
One of the use-case is like a `SimpleMessageConverter` and its `plain/text`
for the String reply, meanwhile we know that this content is an
`application/json`.
So, with a new `replyHeadersMappedLast` we can override the mentioned
`content-type` header, populated by the `MessageConverter` with an
actual value from the message headers populated in the flow upstream

* Introduce an `AmqpInboundGateway.replyHeadersMappedLast`; expose it
on the DSL and XML level
* Use newly introduced `MappingUtils.mapReplyMessage()`
* Optimize `DefaultAmqpHeaderMapper` to not parse JSON headers at all
when `JsonHeaders.TYPE_ID` is already present (e.g. `MessageConverter`
result)
* Also skip `JsonHeaders` when we `populateUserDefinedHeader()`

**Cherry-pick to 5.1.x**

* * Fix language and package typos
* Add missed `@param` in JavaDoc of the `AmqpBaseInboundGatewaySpec.batchingStrategy()`
* Extract a `RabbitTemplate` `MessageConverter` to use for reply messages
conversion - pursue a backward compatibility
2019-10-31 16:25:40 -04:00
Artem Bilan
229676b12c Fix links in reactive-streams.adoc doc
Mention this new docs in the `whats-new.adoc`
2019-09-30 16:38:38 -04:00
Artem Bilan
ad96ca49f1 Add Reactive Stream chapter into docs
* Improve `channel.adoc`: polishing, new channels, java config
* Make `LoadBalancingStrategy` in the `DirectChannel` ctor as
`@Nullable` to reflect the real logic behind

* More Dos and polishing according PR comments
* Mention WebFlux and RSocket endpoints in the `endpoint-summary.adoc`
table

* More reactive streams docs
* `SourcePollingChannelAdapter` polishing
* Wrap multi-value publisher into `Mono.just()` in the `AbstractMessageProducingHandler`
instead of emitting just only a first item for the standard reply

Doc polishing
2019-09-30 14:36:33 -04:00
Artem Bilan
eeb951b0da Fix new Sonar Smells
* Change `whats-new.adoc#x5.2-behavior` to point for the whole
`5.1-to-5.2-Migration-Guide`
2019-09-29 10:28:09 -04:00
Gary Russell
f3850b7520 RSocket Doc Polishing 2019-09-27 11:31:06 -04:00
Artem Bilan
b12657c599 Document RSocket support
* Fix some typos in `webflux.adoc` and `dsl.adoc`
* Make `FunctionsTests.kt` more Kotlin friendly
* Improve RSocket components and tests for them,
especially rely on the default `RSocketStrategies` in the
target SF RSocket components
* Rework `ServerRSocketConnector.setClientRSocketKeyStrategy` to use the whole `MessageHeaders` for consultation.
It turns out that just destination is not enough since it can be used from different clients
* Make the key based on the provided `setupData` by default
* Include all the `MessageHeaders` into the `RSocketConnectedEvent`

* Improve Docs according review feedback and Docs in SF

Doc polishing
2019-09-24 14:55:04 -04:00
Gary Russell
87840bcfe4 GH-3056: Add Micrometer Metrics to Runtime Graph
Resolves https://github.com/spring-projects/spring-integration/issues/3056

* Retrieve meters each time the graph is rendered, not just when it is built.
2019-09-20 09:15:55 -04:00
Artem Bilan
6da8112f6e Polishing What's New
* Move FTP `chmod` support into the (S)FTP changes: it is not a new
component
2019-09-08 12:49:07 -04:00
Artem Bilan
29bebdba97 GH-3047: Add GatewayProxySpec for Java DSL
Fixes https://github.com/spring-projects/spring-integration/issues/3047

* Improve `GatewayProxyFactoryBean` to determine the return type of the
method call from the interface generic types, when the `serviceInterface`
is a `java.util.function.Function`
* Propagate `MethodArgsHolder` as a `rootObject` for SpEL evaluations
* Deprecate `#gatewayMethod` and `#args` evaluation context variables
in favor of `MethodArgsHolder` as root object.
They will be removed in the future release and a single
`EvaluationContext` will be used for all the gateway expressions
* Introduce an
`IntegrationFlows.from(Class<?> serviceInterface, Consumer<GatewayProxySpec> endpointConfigurer)`
to allow to configure any valid gateway proxy options similar to what
we have with the `<gateway>` and `@MessagingGateway`.
This way we are very close to consistency between different approaches

* * Remove `default` prefix from `GatewayProxySpec` options
* Document the change
2019-09-06 13:46:16 -04:00
Artem Bilan
b9478ace95 Upgrade dependencies; fix some typos in docs 2019-09-05 15:30:57 -04:00
Artem Bilan
5b43b6c7dd GH-2890: Document a bridge for subflow starts
Fixes https://github.com/spring-projects/spring-integration/issues/2890

Explain in a docs why and how a `bridge` appears in the flow when we
declare a subflow for mapping

* Upgrade to Kotlin `1.3.50`

* Upgrade to Kotlin `1.3.50`
* Polishing Doc according PR comments

Doc polishing
2019-08-29 14:52:30 -04:00
Artem Bilan
ca8377da9b GH-3017: Expose cancel-idle-interval XML attribute
Fixes https://github.com/spring-projects/spring-integration/issues/3017

* Expose also a `ImapIdleChannelAdapterSpec.cancelIdleInterval()` option
* Deprecate useless `ImapMailInboundChannelAdapterSpec.cancelIdleInterval()`

* Fix language in the Doc
2019-08-28 17:17:10 -04:00
Artem Bilan
4db71d751a GH-3035: Include INT_ prefix into PK constraints
Fixes https://github.com/spring-projects/spring-integration/issues/3035

To avoid names collision for primary key indexes on the target schemas
include an `INT_` prefix to names for the PKs in Spring Integration SQL
scripts.
Also fix the Docs for mentioned PKs
2019-08-28 16:07:12 -04:00
Artem Bilan
a756e6334d GH-3043: Add FileHeaders.REMOTE_HOST header (#3044)
* GH-3043: Add FileHeaders.REMOTE_HOST header

Fixes https://github.com/spring-projects/spring-integration/issues/3043

* Populate a `FileHeaders.REMOTE_HOST` from the
`AbstractRemoteFileStreamingMessageSource` and "get"-based commands
in the `AbstractRemoteFileOutboundGateway`
* Extract the value from the a `Session.getHost()` contract
* The `AbstractInboundFileSynchronizingMessageSource` cannot be
addressed with this because the real message is already based on the
locally stored file
* Adjust some affected tests according our code style requirements

* * Add remote file info support into `AbstractInboundFileSynchronizingMessageSource`
* Introduce a `MetadataStore` functionality into the `AbstractInboundFileSynchronizer`
to gather a remote file info an save it in the URI style against local file
* Retrieve such an info in the `AbstractInboundFileSynchronizingMessageSource`
during local file polling
* Introduce `protocol()` contract for the `AbstractInboundFileSynchronizer`
to build a proper URI in the metadata for external readers to distinguish
remote files properly
* Document the feature

* * Fix some typos in Docs

* * Rename property and header constant to the `HOST_PORT` pair
* Fix typos in Docs
* Add  `remote-file-metadata-store` and `metadata-store-prefix` into XSD
of (S)FTP Inbound Channel Adapters
* Add `remoteFileMetadataStore` and `metadataStorePrefix` options
into `RemoteFileInboundChannelAdapterSpec` for Java DSL
2019-08-28 08:58:13 -04:00
Artem Bilan
f600361237 GH-3010 Add idleBetweenTries for JdbcLockRegistry
Fixes https://github.com/spring-projects/spring-integration/issues/3010

Sometimes `100` milliseconds interval is too often to try to obtain a
lock with `UPDATE/INSERT` queries

**Cherry-pick to 5.1.x**
2019-08-20 17:15:25 -04:00
Mike Gorodilin
f0807fe704 Usage clarification of the group-timeout property
Added some clarification on the usage of  the group-timeout property based on discussion 
https://stackoverflow.com/questions/48230453/issue-with-spring-integration-aggregator-group-timeout-value

* Update aggregator.adoc

Fixed according to one sentence per line rule.
2019-08-20 10:07:18 -04:00
Artem Bilan
b7e928b846 GH-3024 Move Error Handling Docs to the top level
Fixes https://github.com/spring-projects/spring-integration/issues/3024

To avoid confusing about `errorChannel` header behavior and make it more
clear how to handle errors in Spring Integration flows, it would be
better to present an `Error Handling` chapter on the top level.
So, now it is a first chapter of the `Appendices` section
2019-08-19 16:14:55 -04:00
Gary Russell
a4f7412cf5 GH-3026 Support chmod with FTP
Resolves https://github.com/spring-projects/spring-integration/issues/3026

* Fix exception messages; remove test TODOs; test works on Windows
2019-08-15 17:38:24 -04:00
Gary Russell
f256974dd8 AMQP OB Adapter - option to wait for confirms
- add an option to block the caller until a confirm is received

* Resolve PR comments re exceptions, default timeout etc
2019-08-15 17:18:59 -04:00
Artem Bilan
13a8623b59 GH-3027: Decouple RotationPolicy
Fixes https://github.com/spring-projects/spring-integration/issues/3027

This is a polishing for PR https://github.com/spring-projects/spring-integration/pull/3029

* Move `KeyDirectory` in to the `RotationPolicy` since it looks like fully
coupled concept with that abstraction and the class name is so bad for
the public API
* Remove `AbstractStandardRotationPolicy` in favor of a `StandardRotationPolicy`
extendability
* Change `ftp.adoc` and `sftp.adoc` to reflect a new API reality
* Mantion these changes in the `whats-new.adoc`
2019-08-15 11:32:25 -04:00
Gary Russell
d2fc02065d GH-3020: QueueChannel doc polishing
Resolves https://github.com/spring-projects/spring-integration/issues/3020
2019-08-08 16:19:57 -04:00
Gary Russell
cd0f56bc87 Add Apache MINA SftpEventListener
- republish certain events as `ApplicationEvent`s.

* * Add ApacheMinaFtplet to provide the same functionality with FTP
* Fix typo

* * Polishing javadocs and event toString() methods
2019-07-30 10:31:23 -04:00
Gary Russell
b1dfb7bfa3 INT-1926: Option to disallow arbitrary routing
JIRA: https://jira.spring.io/browse/INT-1926

Add an option to mapping routers to disable falling back to the
channel key as the channel name.
2019-07-30 09:44:35 -04:00
Gary Russell
91eb3655aa GH-3003: Add link to migration guide 2019-07-29 11:49:36 -04:00
Artem Bilan
80d679a9b0 GH-2748: More bean definitions into exceptions
Fixes https://github.com/spring-projects/spring-integration/issues/2748

* Refactor more `MessageHandlingException`s to include `this` into an
exception message
* Revert using `MessagingException` in some places which really are not
about messaging.
This helps to wrap them into `MessageHandlingException` later in the
`MessageHandler` for the `BeanDefinition` reference
* Remove `volatile` from configuration properties in the affected
classes
* Remove already deprecated `JmsOutboundGateway.setPriority()`
* Add `resource` and `source` for `BeanDefinition` in the
`AbstractChannelAdapterParser` & `AbstractInboundGatewayParser`
* Document the feature
2019-07-23 15:19:56 -04:00
Gary Russell
989d31716d Add type mapping to SimpleToAvroTransformer
* Fix setter names for expression Strings
2019-07-18 16:40:06 -04:00
Gary Russell
9a2b75bae3 Add simple Avro transformers
Unsophisticated Avro transformers for `SpecificRecord` implementations.

* * Fix DSL Factory

- transformer was changed to `<? extends GenericContainer>`; change the DSL to match

* * Restore test log4j

* * Revert to supporting only SpecificRecord

* * Fix assert

* * Add multi-type deserialization with fluent API
* Polishing for PR comments

* * Remove type mappings; Exxpression now returns the type (or class name)
* Cache types created from class names
* Add type header in "toAvro" transformer

* * Remove the type cache (already handled by the class loader)

* * Don't convert the class to String in the "toAvro" transformer
2019-07-09 14:59:01 -04:00
Artem Bilan
5a1846cfe5 INT-2480: Add aggregate headers strategy
JIRA: https://jira.spring.io/browse/INT-2480

* Introduce `headers-function` option into the `aggregator` for merging
and computing headers for the output message based on the completed
group
* Implement a `DefaultAggregateHeadersFunction` and use it in the
`AbstractAggregatingMessageGroupProcessor` for default behavior with
possible injection for any other implementation
* Add `DelegatingMessageGroupProcessor` to wrap any other
`MessageGroupProcessor` implementations with possible usage of the
`headersFunction` if result is not a `Message` or `MessageBuilder`
* Make `AbstractCorrelatingMessageHandler.getOutputProcessor()` as
`public` rto give access to this option from the `AggregatorSpec` to
be able to inject a `headersFunction` in Java DSL configuration
* Add `AbstractIntegrationMessageBuilder.getHeader()` to get access to
some underlying header avoiding extra `Map` in case of `getHeaders()`
* Change a logic in the `AbstractMessageProducingHandler.produceOutput()`
to consult a `reply` for the `replyChannel` as well `routingSlip` header
if the `reply` is a `Message` or `MessageBuilder`
* Introduce a `AbstractMessageProducingHandler.messageBuilderForReply()`
and use it in `AbstractMessageSplitter` to avoid duplication
* Validate a new functionality in tests
* Fix `FileOutboundGatewayParserTests` to rely on the `TemporaryFolder`
to clean up test files after using

* JavaDocs for `DefaultAggregateHeadersFunction`
* Some `router.adoc` polishing

* Fix link to Reactor in the `router.adoc`

* Add docs for new `Function<MessageGroup, Map<String, Object>>` strategy

* Doc polishing.
2019-07-03 16:32:23 -04:00
Artem Bilan
5d50755d02 Fix some typos in Docs
* Especially misconfiguration when we need to render an `*`, but got
a bold text
2019-06-29 20:52:36 -04:00
Artem Bilan
c18c2e2141 Add Validation to HTTP Inbound (#2978)
* Add Validation to HTTP Inbound

* Pull a validation functionality from `WebFluxInboundEndpoint` to its
super class `BaseHttpInboundEndpoint` making a validation available for
the `HttpRequestHandlingEndpointSupport` as well
* Do the same for the `validator()` option in DSL for the
`HttpInboundEndpointSupportSpec`
* Add `validator` XML attribute for both HTTP and WebFlux inbound
endpoint XSDs
* Test parsers for a new `validator` option
* Document validation in the `http.adoc`
* Apply some polishing in the `http.adoc`, as well as in the
`HttpRequestHandlingEndpointSupport` JavaDocs
* Clarify in `webflux.adoc` that validation is applied for the
`Publisher` items before the payload is finally built for the message to
send.
* Add WebFlux into the table of endpoints in the `endpoint-summary.adoc`

* * Remove unused imports
* Fix `SimpleMessageListenerContainerSpec` for deprecated `txSize` option
2019-06-27 09:47:45 -04:00
Artem Bilan
c5ec2d94c6 Remove double commas in docs for link syntax 2019-06-26 16:14:02 -04:00
Gary Russell
175223d0e0 GH-2974: Fix race in TcpNetConnection.getPayload()
Fixes https://github.com/spring-projects/spring-integration/issues/2974

There is a race in that we could get a `SocketException` in `inputStream`.
Since this is between payloads, it needs to be thrown as a
`SoftEndOfStreamException`.

* * Add javadocs to SoftEndOfStreamException

* * SEOSE is now a RuntimeException (can't be an UncheckedIOException - no default CTOR
2019-06-26 11:15:34 -04:00
Artem Bilan
59cdc4ddae Add validation support into WebFlux Inbound (#2977)
* Add validation support into WebFlux Inbound

See https://stackoverflow.com/questions/56729517/spring-integration-webflux-validate-input-json-body

* Introduce a `WebFluxInboundEndpoint.validator` option to validate
a request payload after conversion HTTP request into a `Publisher`
* Expose a `WebFluxInboundEndpointSpec.validator()` option
* Introduce a `IntegrationWebExchangeBindException` to extend a
`WebExchangeBindException` for Spring Integration use-case.
such an exception is used in the `ResponseStatusExceptionHandler`
extensions, like one in Spring Boot for proper response rendering
* Test and document the solution

* * Remove unused imports from IntegrationWebExchangeBindException
2019-06-26 11:11:33 -04:00
Artem Bilan
d79c06a987 GH-2967: Fix ScatterGatherH for headers copy (#2968)
* GH-2967: Fix ScatterGatherH for headers copy

Fixes https://github.com/spring-projects/spring-integration/issues/2967

The `ChannelInterceptor` is added into the `this.gatherChannel` on each
request message making a subsequent requests for scatter-gather as
halting on reply.

* Add an interceptor into an injected `this.gatherChannel` only once
during `ScatterGatherHandler` initialization
* Introduce `ORIGINAL_REPLY_CHANNEL` and `ORIGINAL_ERROR_CHANNEL`
headers to carry a request reply and error channels from headers
* Populate `REPLY_CHANNEL` and `ERROR_CHANNEL` headers back before
sending scattering replies into gatherer
* Transfer a `GATHER_RESULT_CHANNEL` header now directly from the scatter
message to make it available in the reply from the gatherer
* Add note about those headers in the `scatter-gather.adoc`
* Modify `ScatterGatherTests` to be sure that `ScatterGatherHandler`
works for several requests

**Cherry-pick to 5.1.x**

* * Fix language in doc
2019-06-19 16:14:11 -04:00
Artem Bilan
244e5942df Fix nohttp for custom whitelist.lines
Looks like we can't have a custom `whitelist.lines` in the `/checkstyle`
dir.

* Move `whitelist.lines` with the `http://www.jcraft.com` entry into the
`/src/nohttp`
* Upgrade `nohttp` to `0.0.3`
* Revert `jsch` URL in the `sftp.adoc`
* Upgrade to Micormeter-1.1.5
2019-06-17 16:55:37 -04:00
Artem Bilan
71fbe29da4 Add Docs for Flux Aggregator
* Some test polishing
* Fix not properly wrapped code snippet in the `scripting.adoc`

Doc polishing
2019-06-14 11:32:55 -04:00
Gary Russell
2fb7554dcf Fix new tangle introduced by Control Bus changes
- tangle between `expression` and `endpoint`
- move `Pausable` to `core`
2019-06-14 11:17:34 -04:00
Artem Bilan
1c88ba19d7 Polishing for nohttp plugin
* Move the plugin and its task into the root project configuration
* Add more image file extensions to exclude
* Fix `sftp.adoc` do not use HTTP url for the JSCH library project page;
 use GitHub repo link instead
2019-06-10 13:59:30 -04:00
Gary Russell
8c68255050 Fix doc links; add checkAsciidocLinks to testAll 2019-06-05 14:51:10 -04:00
Gary Russell
466daa8774 TCP: Connect Timeout; Close Stream
- Add `connectTimeout` to client connection factories
- Add `closeStreamAfterSend` to outbound gateway

* Polishing - PR Comments.
2019-06-05 14:38:13 -04:00
Artem Bilan
1d08d3bdc2 Various Docs build fixes
https://build.spring.io/browse/INT-MASTER-1568/

* Fix `whats-new.adoc` for broken link
* remove `logDocuments = true` from the `build.gradle`
* Change the Gradle task name in the `.travis.yml` for consistency
2019-05-30 15:27:49 -04:00
Gary Russell
2a50a26252 Build: check external asciidoc links
* Check external links have a description

* Use Groovy regex instead of Java

* Add source file name to exception message

* Add 'checkAsciiDocLinks' to Travis build
2019-05-30 15:09:45 -04:00
Artem Bilan
374b4b70f1 GH-2880: Handle Pausable in Control Bus (#2940)
* GH-2880: Handle `Pausable` in Control Bus

Fixes https://github.com/spring-projects/spring-integration/issues/2880

* Refactor `ControlBusMethodFilter` to handle `Pausable` managed operations
* Optimize and internal `ControlBusMethodFilter.filter()` logic to rely
on the `MergedAnnotations`
* Modify `EnableIntegrationTests` to test new functionality and document
the feature

* * `ControlBusMethodFilter` to deal with plain `Lifecycle` impls as well
2019-05-30 14:10:00 -04:00
Artem Bilan
34db267a8a GH-2936: Add custom converters for MongoDbMS
Fixes https://github.com/spring-projects/spring-integration/issues/2936

* Add `MongoDbMessageStore.setCustomConverters()` to allow to inject
any custom converters for `payload` as well as header values

**Cherry-pick to 5.1.x**
2019-05-30 10:36:37 -04:00
Gary Russell
9fa9d1b3d0 Add Multi-Page HTML Reference
- to avoid having to load the whole document
- provide a link to the single page version for browser search

* Fix cross-document links.

Links need to be qualified with the containing file name for the
multi-page html doc.
2019-05-29 17:47:34 -04:00
Gary Russell
d7fa60922b Fix Broken Links in Reference 2019-05-29 16:24:46 -04:00