Commit Graph

205 Commits

Author SHA1 Message Date
Artem Bilan
d4a99919ed INT-4300: Add WebFlux Server Support
JIRA: https://jira.spring.io/browse/INT-4300

* Add `ReactiveHttpInboundEndpoint` based on the WebFlux foundation
* Extract `BaseHttpInboundEndpoint` for common
HTTP Inbound Channel Adapters options
* Make `spring-webmvc` and `spring-webflux` as `optional` dependencies
to let end-user to choose
* Refactor `HttpContextUtils` to include constants
for newly added WebFlux support
* Introduce `BaseHttpInboundEndpoint.setRequestPayloadTypeClass()`
for raw `Class<?>` and modify existing `setRequestPayloadType()`
for the `ResolvableType`
* Refactor existing MVC tests and XML components parsers to use
new `setRequestPayloadTypeClass()`
* Add `MessagingGatewaySupport.sendAndReceiveMessageReactive()` to get
a reply from downstream flow reactive back-pressure manner
* Add `IntegrationHandlerResultHandler` implementation to let WebFlux
infrastructure to handle the `Mono<Void>` from the `ReactiveHttpInboundEndpoint`
properly
* Fix `JdbcLockRegistryLeaderInitiatorTests` race condition to assert
the `initiator1` is elected eventually after yielding when the `initiator2`
is stopped

* Fix JavaDocs issue in the `HttpRequestHandlingMessagingGateway`
* Move all the "hard" logic in the `MessagingGatewaySupport#doSendAndReceiveMessageReactive`
to the `Mono` chain ensuring back-pressure when `sendAndReceiveMessageReactive()` is
called not from the Reactive Stream

Add test-case to demonstrate SSE

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

Some polishing and optimization for the
`MessagingGatewaySupport.doSendAndReceiveMessageReactive()`

More optimization for `MessagingGatewaySupport`

* Upgrade to Reactor 3.1 M3
* Document WebFlux-based components

Minor Doc Polishing
2017-07-20 12:19:17 -04:00
Gary Russell
6c62af53f4 INT-4309 Http Header Mapper VarArgs Instead of []
JIRA: https://jira.spring.io/browse/INT-4309

More convenient for Java Config.

*Upgrade to Reactor 3.1 B-S, Reactor-Netty 0.7 B-S and Security 5.0 B-S.
Otherwise we are not compatible with the latest SF
2017-07-05 13:38:20 -04:00
Artem Bilan
b7801f6311 Fix CookieTests for the latest SF
https://build.spring.io/browse/INT-MASTER-679/
2017-05-24 15:31:06 -04:00
Artem Bilan
9543877c0c Fix FluxMessageChannel for Multi Sources
* Rename `ReactiveConsumer` to `ReactiveStreamsConsumer`
* Rename `FluxSubscribableChannel` to `ReactiveStreamsSubscribableChannel`
* Remove the `processor` functionality from the `FluxMessageChannel`
in favor of internal `FluxSink` as it is recommended by the Project Reactor:
> Most of the time, you should try to avoid using a Processor.
They are harder to use correctly and prone to some corner cases.

* Make connectable, upstream publishers for the `FluxMessageChannel` as
bridges to the internal `sink` via `this::send`.
This way we are able to receive data from multi sources.
When the source is completed (e.g. `Mono` in case of WebFlux response),
the downstream flow isn't completed.
* Rework `MessageChannelReactiveUtils#PollableChannelPublisherAdapter`
to be based on the `Flux.create()` and `onRequest()` to poll channel for messages
* Add one more request to the `ReactiveHttpRequestExecutingMessageHandler`
to be sure that we consume different `Mono`s by the `FluxSubscribableChannel`
properly without completion
* Upgrade to the `spring-io-plugin:0.0.7.RELEASE`

Add `IntegrationConsumer` implementation to the `ReactiveStreamsConsumer`
2017-05-10 14:02:35 -04:00
Gary Russell
572467b1c4 INT-4260: MessagePublishingErrorHandler Orig. Msg
JIRA: https://jira.spring.io/browse/INT-4260

MPEH: Populate the `ErrorMessage.originalMessage`,
if available and not the same as the `failedMessage`.

Polishing - rename exception to `MessagingExceptionWrapper`;
 make `MPEH` a subclass of `ErrorMessagePublisher`

PR Comments

Polishing - PR Comments
2017-05-03 16:32:49 -04:00
Gary Russell
ca231763a3 Rename ReactiveChannel
- as discussed last week

TODO:
- should we take the channel outside of the `AbstractMessageChannel` hierarchy?
  - avoid blocking interceptors
  - we would lose channel metrics though
- rename `ReactiveConsumer` ?

Polishing some missed renaming
2017-05-01 13:45:35 -04:00
Artem Bilan
a9aeff3ae1 Fix HTTP Reactive support according latest SF 2017-04-25 11:51:24 -04:00
Artem Bilan
9e175054d0 Upgrade to the SF and SA BUILD-SNAPSHOTs
* Upgrade to Jackson-2.9.0 to align with SF
* Fix `ReactiveHttpRequestExecutingMessageHandler` to use latest `WebClient`
* Introduce `Supplier<URI> uriSupplier` to evaluate the `realUri` on demand.
In case of `WebClient` use `.uri(Function)` to perform `uriSupplier`
* Move `doNext()` for the `WebClientException` out of `one-way` block.
According the `RestTemplate` logic the erroneous response is handled
before returning from the `exchange()`.
Therefore both request/reply and one-way scenarios must have the same
error handling logic
* Some refactoring to the `AbstractHttpRequestExecutingMessageHandler`
and `AbstractHttpRequestExecutingMessageHandler` according a new `uriSupplier`
2017-04-08 08:46:13 -04:00
Artem Bilan
19c5402079 INT-4208: Add WebFlux-Based HttpMessageHandler
JIRA: https://jira.spring.io/browse/INT-4208

Since `AsyncRestTemplate` is deprecated in Spring 5.0, it doesn't make
sense to promote that feature via our new `AsyncHttpRequestExecutingMessageHandler`
component

* Rework (and rename) `AsyncHttpRequestExecutingMessageHandler` to
`ReactiveHttpRequestExecutingMessageHandler` and make it based on the
WebFlux `WebClient`
* Fix Java DSL (`ReactiveHttpMessageHandlerSpec`) and all tests according a new
logic in the `ReactiveHttpRequestExecutingMessageHandler`
* Fix XML namespace support to use new `ReactiveHttpRequestExecutingMessageHandler`
and don't expose unused options like `converters` and `request-factory`
* Fix `What's New` and `http.adoc`
* To remain with `async` mode for the `ReactiveHttpRequestExecutingMessageHandler`
behavior support fix `AbstractMessageProducingHandler` to adapt reply `Mono`
to the `SettableListenableFuture`
* Introduce new `reactive` behavior for the `AbstractMessageProducingHandler`
when `outputChannel` is `ReactiveSubscribableChannel` and perform
`.subscribeTo(Publisher)` for `Publisher` reply
* Upgrade to Spring AMQP `2.0 M3`
* Downgrade to Spring Security `4.2.2`

Address PR comments

Add async error handling to the one-way case

Minor polishing and checkstyle fix
2017-04-05 13:00:50 -04:00
Artem Bilan
75fe5d0f72 Fix HTTP out DSL for uri variables propagation
Since `AbstractHttpRequestExecutingMessageHandler` does a copy of
the provided `uriVariableExpressions`, we lose a coupling propagating
from the ctor.

* Move `uriVariableExpressions` propagation from the ctor to the
`getComponentsToRegister()`
2017-03-28 11:33:00 -04:00
Artem Bilan
9208fa52d6 INT-4242: Don't send body for HEAD and TRACE, too
JIRA: https://jira.spring.io/browse/INT-4242
Fixes spring-projects/spring-integration#2085

According to the RFC7231 (https://tools.ietf.org/html/rfc7231), the `HEAD` is fully similar to `GET` and its body does not have sense.
The `TRACE` method can't have body at all.
The `OPTIONS` may have body, but that is already custom target server logic to parse it properly

* Modify `AbstractHttpRequestExecutingMessageHandler` do not include `payload` as a request body for `GET`, `HEAD` and `TRACE`

Also see https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-4.3-to-5.0-Migration-Guide
2017-03-08 16:27:17 -05:00
Gary Russell
37683f1b80 INT-4219: Test Polishing
JIRA: https://jira.spring.io/browse/INT-4219

- Use `AdditionalAnswers.returnFirstArgument` instead of lambda to return first arg
- Enable CheckStyle `AvoidStaticImport` for tests
- Fix static import violations in tests
2017-03-06 11:13:39 -05:00
Shiliang Li
802061985c INT-4208: Support AsycRest in HTTP Module
https://jira.spring.io/browse/INT-4208
https://jira.spring.io/browse/INT-4076

Add `AsyncRestTemplate` support in `HttpRequestExecutingMessageHandler` and corresponding config/dsl support

* Polishing Docs
2017-02-03 10:16:01 -05:00
Artem Bilan
c886b3bf68 Fix HttpDslTests for proper Mock request handling
https://build.spring.io/browse/INT-MASTER-513

See https://jira.spring.io/browse/SPR-15116
2017-01-13 14:15:11 -05:00
Artem Bilan
54654546b9 INT-4206: Upgrade to Mockito 2.5
JIRA: https://jira.spring.io/browse/INT-4206

* Fix unnecessary dependency resolution in BOM module
* Fix `MessagingMethodInvokerHelper` to handle `$MockitoMock$` generated classed which isn't CGLib `Proxies` any more
* Provide fixes for test classes according upgrade to Mockito `2.5`
* Fix Ceckstyle do not allow static imports for deprecated Mockito classes
2017-01-09 18:39:25 -05:00
Artem Bilan
b60e1dcb50 INT-4172: canWrite(mediaType) in SerializingHttpMC
JIRA: https://jira.spring.io/browse/INT-4172

The `SerializingHttpMessageConverter` which can be customized via `setSupportedMediaTypes()`, but at the same time `canWrite(Class<?> clazz, MediaType mediaType)` consult only default `APPLICATION_JAVA_SERIALIZED_OBJECT`

The target application really may face different media types for the `Serialized` objects not just built-in `application/x-java-serialized-object`

Since we can customize `SerializingHttpMessageConverter` via  `setSupportedMediaTypes()` that will be fully consistent to consult `canWrite(mediaType)`
2016-11-28 16:51:42 -05:00
Artem Bilan
6c4d9b2111 INT-4156: Merge HTTP Java DSL and Some Refinements
JIRA: https://jira.spring.io/browse/INT-4156

* Copy `Http` Java DSL from with some fixes to the `HttpMessageHandlerSpec` and Java 8 style
* Port `HttpDslTests` and "de-Boot" it with the Mock MVC
* Upgrade to Spring Security 4.2.0
* Make `spring-integration-security` as a dependency for HTTP module for better test coverage for Security from SI Web perspective

No need in `AuthenticationManager` bean

JavaDocs for HTTP DSL components and some JavaDocs improvements for `HttpRequestHandlingEndpointSupport` and `HttpRequestExecutingMessageHandler`

Restore optional ROME dependency for proper HTTP module compilation

Add missed JavaDoc and mark all HTTP tests with `@DirtiesContext`

Add JavaDocs for `Http` factory methods
2016-11-12 13:31:55 -05:00
Gary Russell
c5fbd93787 Mockito Polishing
`$ find spring-integration-* | grep '\.java$' | xargs sed -E -i '' -e 's/(\(?)\(([^<()]*)\) *invocation.getArguments\(\)\[([0-9]*)\]/\1invocation.getArgumentAt(\3, \2.class)/'`
2016-10-28 11:06:05 -04:00
Gary Russell
c865d38576 More Lambdas
Also, make inner ctors package rather than private to avoid the synthetic class and method
the compiler has to create.

See: http://stackoverflow.com/questions/921025/eclipse-warning-about-synthetic-accessor-for-private-static-nested-classes-in-jav

JMX Lambdas

Polishing - clean up

More
2016-10-26 09:54:49 -04:00
Gary Russell
3c284871c3 INT-4139: Add CORS Config to Graph Annotation
JIRA: https://jira.spring.io/browse/INT-4139

Doc Polishing

Polishing - Fix CORS Test and Revert XML

- Use standard CORS configuration with XML.
2016-10-17 14:49:30 -04:00
Artem Bilan
53d80b5694 INT-3903: user prefix as "" for HTTP headers
JIRA: https://jira.spring.io/browse/INT-3903

According to RFC-6648, the "X-" prefix has been deprecated and now any use-specific headers can be mapped without any prefix

* Fix `DefaultHttpHeaderMapper` for the `""` as a `userDefinedHeaderPrefix` by default

Document `X-` changes
2016-10-10 16:58:12 -04:00
Artem Bilan
f9e93e0a72 INT-4135: Ignore case check for HTTP Content-Type
JIRA: https://jira.spring.io/browse/INT-4135

The incoming `Content-Type` HTTP header can be in any arbitrary case.

Fix `DefaultHttpHeaderMapper` `Content-Type` header re-mapping to the `MessageHeaders.CONTENT_TYPE` via `equalsIgnoreCase()` comparison

**Cherry-pick to 4.3.x**
2016-10-10 11:30:15 -04:00
Artem Bilan
12fb590b95 Mainly Checkstyle Violation Fixes
* Upgrade to Checkstyle `7.1`
* Relax `RequireThis` rule a bit. Right now it does the effort only in case of overlapping. See https://github.com/checkstyle/checkstyle/issues/2362 for more info
* Enable some annotation rules and provide fixes for violations
* Enable `tabs indents` rule. This was the biggest fix in this PR
* Resolve `TODO` in the `MessagingMethodInvokerHelper` and fix tests to meet `IllegalStateException` now

Remain Checkstyle version `6.16.1` and reinstate `RequireThis` rule

The latest Checkstyle has a bug with local scope variables if they have the same names as property.

Revert some literals splitting

Fix some line length exceeding and code style
2016-09-22 13:23:51 -04:00
Gary Russell
8e3622757d File Cleanup - Event to JMX 2016-06-04 11:39:43 -04:00
Artem Bilan
d57db56a39 INT-4035, INT-4008: Docs for Integration Graph
JIRA: https://jira.spring.io/browse/INT-4035, https://jira.spring.io/browse/INT-4008

Polishing
2016-05-25 09:29:00 -04:00
Artem Bilan
6b6a38f8cb INT-4017: Fix If-None-Match HTTP header tests
JIRA: https://jira.spring.io/browse/INT-4017

According RFC 7232 (https://tools.ietf.org/html/rfc7232#section-2.3) the ETag headers must be in the pattern:
```
ETag       = entity-tag

     entity-tag = [ weak ] opaque-tag
     weak       = %x57.2F ; "W/", case-sensitive
     opaque-tag = DQUOTE *etagc DQUOTE
     etagc      = %x21 / %x23-7E / obs-text
                ; VCHAR except double quotes, plus obs-text
```
Therefore the regexp like `HttpHeaders.ETAG_HEADER_VALUE_PATTERN`
2016-04-28 20:00:06 -04:00
Artem Bilan
47d7a67bda Some various upgrades, fixes and refactoring
* Upgrade to SA and SF snapshots
* Address TODOs regarding those upgrades
* Resolve some other TODOs
* Replace `PropertyPlaceholderConfigurer` beans with the `<context:property-placeholder>`
* Upgrade to Spring Social Twitter 1.1.2 and resolve deprecations via mocks (https://github.com/spring-projects/spring-social-twitter/issues/91)
* Upgrade to Curator `3.1.0` and resolve deprecation in the `ZookeeperMetadataStore`
2016-04-25 23:32:14 -04:00
Artem Bilan
854a504a95 Revert S-AMQP and SF to the latest Milestones
See TODOs in the code of this change
2016-04-25 14:37:24 -04:00
Gary Russell
2370296b95 INT-3967: Add contentDescriptor to Object Model
JIRA: https://jira.spring.io/browse/INT-3967

Polishing

Polishing

Polishing - remove componentName
2016-04-25 13:11:22 -04:00
Artem Bilan
8df487c96f INT-3991: Add IntegrationGraphController
JIRA: https://jira.spring.io/browse/INT-3991

* Add `IntegrationGraphController` `@RestController` over `IntegrationGraphServer` bean
* Add `@EnableIntegrationGraphController` and `<int-http:graph-controller>` to register
`IntegrationGraphController` if the `DispatcherServlet` is in classpath.
* Also register the `IntegrationGraphServer` bean from the same place, if that isn't presented in the application context yet.
* Allow to configure the "root" `path` for the `IntegrationGraphController` as a placeholder value via
`spring.integration.graph.controller.request.mapping.path` property
* Add tests for both `@EnableIntegrationGraphController` and `<int-http:graph-controller>` cases based on the `MockMvc`
2016-04-22 17:34:21 -04:00
Gary Russell
4027b38da8 Remove System.out/.err Calls From All Tests 2016-04-14 16:22:45 -04:00
Gary Russell
57f96bb759 checkstyle Misc Rules
checkstyle Nesting

checkstyle GenericWhitespace

checkstyle MethodParamPad

checkstyle NoWhiteSpace

checkstyle ParenPad Script

checkstyle ParenPad
2016-04-05 17:21:29 -04:00
Gary Russell
05cc7be644 checkstyle WhiteAround
WhiteAroundCheck script
2016-04-05 13:50:11 -04:00
Artem Bilan
2b0598291c RequireThis rule and fixThis Gradle task
* `gradlew clean check -x test --parallel --continue` - to collect reports
* `gradlew fixThis --parallel` - to fix all possible vulnerabilities. With `-Dfile.encoding=UTF-8` on Windows

Since the `RequireThisCheck` doesn't see parents for anonymous classes (e.g. `Runnable` callback), its report doesn't contains the outer class name with `this.`,
therefore we still have to fix those cases manually.
Thanks to the wrong `replacer` just with `this.` we have uncompilable code enough easy to find problems.
Not so easy to fix for good readability though...

* Upgrade to Grade 2.12
* Upgrade to SonarQube native plugin

The fix contains at about 300 files. So, will be done on merge.

Fix `fixThis.gradle` according PR comments

Apply `fixThis` and also `fixModifiers` for test classes.
 Fix some `this.` inner issues manually.
 Make code polishing for long lines after `fixThis`

Fix conflicts and vulnerabilities after the rebase
2016-03-22 20:18:27 -04:00
Artem Bilan
ef40a939cf Add check header rule and fixHeaders task
Add "new line" in the header end

* Optimization for the `fixHeaders.gradle`
* Apply the `fixHeaders` for the affected classes
2016-03-07 15:08:51 -05:00
Gary Russell
5fe827a3dd Checkstyle - Phase I - Unused Imports
I copied the checkstyle config from spring-boot and commented
out most of the rules.

Over time, we should uncomment each rule and fix violations.
2016-03-04 15:50:08 -05:00
Artem Bilan
c66632a3a0 Fix CrossOriginTestsfor SF-4.3 compatibility
https://build.spring.io/browse/INT-MJATS41-524

Since SF-4.3 (see https://jira.spring.io/browse/SPR-13130) the
`OPTIONS` request, which isn't CORS one (without `HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD`),
is handled by new internal `HttpOptionsHandler`, which just responds with `Allow` header.
2016-01-25 15:00:54 -05:00
Artem Bilan
f4cb9e8e46 Fix HTTP test: provide URL for mock Request
The latest SF changes relies on the `request.getRequestURL()`.
We end up with the `NPE` if mock `ServletRequest`isn't supplied with `requestURL`.

 * Add the Mockito answer for the `request.getRequestURL()` in the `MultipartAsRawByteArrayTests`

  **Cherry-pick to 4.2.x**
2016-01-21 09:57:52 -05:00
Artem Bilan
c0784bf6ef INT-3933: HTTP & WS Inbound Lifecycle Handling
JIRA: https://jira.spring.io/browse/INT-3933

Previously the HTTP and WS Inbound Endpoint haven't handled the `stopped` state properly.

* Add `lifecycle` parsing to the `HttpInboundEndpointParser`
* Handle `!isRunning()` state and throw an appropriate `503 Service Unavailable` HTTP response
* Expose `lifecycle` options for the `<int-ws:inbound-gateway>`
* Introduce `ServiceUnavailableException` `WebServiceException` to indicate `stopped` state for the WS Inbound Endpoint
* Fix tests for the new logic

INT-3933: PR comments: `OrderlyShutdownCapable` for `AbstractWebServiceInboundGateway`
2016-01-19 14:23:21 -05:00
Gary Russell
c97afe92fe INT-3934: HTTP Requests Without Content-Type
JIRA: https://jira.spring.io/browse/INT-3934

Coerce a missing Content-Type to `application/octet-stream`.
2016-01-18 11:28:05 -05:00
Artem Bilan
f5781bfff8 INT-3918: Use MockMvc instead of Sun HttpServer
JIRA: https://jira.spring.io/browse/INT-3918
2016-01-04 15:21:03 -05:00
Gary Russell
d16cd9748c INT-799: Remove Core Deps from s-i-test
JIRA: https://jira.spring.io/browse/INT-799

Some test classes (e.g. `TestUtils`) were duplicated in core to avoid cyclic
dependency.

Now that core messaging has been moved to spring-messaging, it is possible
to remove the dependencies on `spring-integration-core` from `spring-integration-test`.

A few minor test cases have been moved to `spring-integration-core`.

The simple polishing to the `build.gradle` and `ServiceActivatorOnMockitoMockTests`
2015-12-07 20:39:00 -05:00
Gary Russell
4f648a7e4f INT-3818: Multipart Pass Through Converter
JIRA: https://jira.spring.io/browse/INT-3818

INT-3818: Fix Pre JDK8 Syntax

Polishing - PR Comments

Add author name
2015-09-03 21:00:56 -04:00
Artem Bilan
c86141cff7 INT-3813: HTTP module improvements
JIRA: https://jira.spring.io/browse/INT-3813
2015-09-01 12:50:44 -04:00
Gary Russell
9944e54ce5 INT-3781: Configure HTTP GW Timeout Status Code
JIRA: https://jira.spring.io/browse/INT-3781

- Add mechanisms to set status code on an inbound gateway timeout.
- Send a message to the error channel if configured.

Polishing - Add failedMessage to MTE

Fix Schema Docs; Timeout Detection on Error Flow

Add Zookeeper Leadership Logs

Fix typo in the `SmartLifecycleRoleController`
2015-07-24 18:37:26 -04:00
Artem Bilan
178c86faa4 INT-3683: Fix typo in schema.sql.vpp
JIRA: https://jira.spring.io/browse/INT-3683

* In addition fix `inputs` for the Gradle `generateSql` task and regenerate all SQLs
to apply the typo fix.
The previous way to generate sql scripts doesn't work properly. It is always as `UP-TO-DATE`.
Adding `inputs` to the `generateSql` show the correct behaviour.
From other side that makes `cleanSql` task as redundant.
* Applying the Travis config fix to this commit as well.

Fix HTTP test timeout

https://build.spring.io/browse/INT-B41-346

Fix `ProducerAndConsumerAutoStartupTests`

https://build.spring.io/browse/INT-B41-346

Fix `DelayerUsageTests` `time` bean scope bug

https://build.spring.io/browse/INT-B41-347

Fix `HttpInboundGatewayParserTests.java` generics Java < 8 compiler warnings

Increase Tomcat response timeout for WebSocket tests

https://build.spring.io/browse/INT-B41-349

Increase timeout in the `AsyncMessagingTemplateTests#executionException()`

Fix `ClassCastException` for the `StandardWebSocketClient#userProperties`

Increase Delay to 2 Seconds in DelayHandlerTests
2015-07-24 16:10:05 -04:00
Artem Bilan
580ecddcc0 INT-3714: Add HTTP CORS Support
JIRA: https://jira.spring.io/browse/INT-3714

Docs and change Reactor dependency to `RELEASE`

AMQP -> `1.5.0.M1` and rebase

Doc Polishing
2015-05-08 11:31:41 +01:00
Artem Bilan
2aac4414df INT-3698: HTTP MH: Remove Internal Converters
JIRA: https://jira.spring.io/browse/INT-3698

The `HttpRequestExecutingMessageHandler` added two internal `Converters` to the `ConversionService` before.
In case of parent-child environment it causes memory leak: closing of child context doesn't release
`HttpRequestExecutingMessageHandler` instances, because those internal `Converters` aren't `static`, hence bounded to outer instance.

Actually after introduction since `4.0` version to the `HttpRequestExecutingMessageHandler` the code like:

```
Assert.isTrue(expectedResponseType instanceof Class<?>
					|| expectedResponseType instanceof String
					|| expectedResponseType instanceof ParameterizedTypeReference,
					"'expectedResponseType' can be an instance of 'Class<?>', 'String' or 'ParameterizedTypeReference<?>'.");
if (expectedResponseType instanceof String && StringUtils.hasText((String) expectedResponseType)){
				expectedResponseType = ClassUtils.forName((String) expectedResponseType, ClassUtils.getDefaultClassLoader());
}
```

These converters are redundant.

In addition remove the `expected type` for the `uriVariablesExpression` evaluation to avoid `MapToMapConverter`.

**Cherry-pick to 4.1.x, 4.0.x**

INT-3698: Provide robust logic for the `uriExpression` and `httpMethodExpression`

Make some polishing around `Assert`s, when `IllegalStateException` must be presented instead of `IllegalArgumentException`
for the expression evaluation results.

Polishing
2015-04-16 15:26:23 +01:00
Artem Bilan
3e851d2e1b INT-3697: Map contentType to HTTP Response
JIRA: https://jira.spring.io/browse/INT-3697

Since Spring Integration 4.0 the `MessageHeaders` had been moved to the Spring Messaging module
and `MessageHeaders.CONTENT_TYPE` had been changed from `content-type` name to the `contentType`.

Previously the automatic mapping of `contentType` to the HTTP Request `Content-Type` has been introduced
for the `HttpRequestExecutingMessageHandler`.

This fix do the same for the HTTP Response in case of HTTP Inbound Endpoint.
This allows to transfer HTTP headers automatically from underlying HTTP Outbound Endpoint for HTTP Proxy scenario.
The response from that external HTTP service maybe changed during a downstream flow before sending HTTP Response from the HTTP Inbound Endpoint.
Before this we was forced to map `contentType` to `Content-Type` manually or just rely on the `HttpMessageConverter`s.

**Cherry-pick to 4.1.x**
2015-04-13 13:58:26 +03:00
Gary Russell
113716effd INT-3526 Used Expanded URI In Exception Message
JIRA: https://jira.spring.io/browse/INT-3526

Previously, the URI in the exception message is the raw
URI with placeholders, if present.

Use the expanded URI in the message instead.
2014-10-04 10:11:59 +01:00