forked from spring-projects/spring-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
1 parent
1e1346d
commit b5ec98f
Showing
16 changed files
with
960 additions
and
19 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...ain/java/org/springframework/integration/webflux/config/WebFluxInboundEndpointParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2018 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.integration.webflux.config; | ||
|
||
import org.w3c.dom.Element; | ||
|
||
import org.springframework.beans.factory.support.BeanDefinitionBuilder; | ||
import org.springframework.beans.factory.xml.ParserContext; | ||
import org.springframework.integration.config.xml.IntegrationNamespaceUtils; | ||
import org.springframework.integration.http.config.HttpInboundEndpointParser; | ||
import org.springframework.integration.webflux.inbound.WebFluxInboundEndpoint; | ||
|
||
/** | ||
* @author Artem Bilan | ||
* | ||
* @since 5.0.1 | ||
*/ | ||
public class WebFluxInboundEndpointParser extends HttpInboundEndpointParser { | ||
|
||
public WebFluxInboundEndpointParser(boolean expectReply) { | ||
super(expectReply); | ||
} | ||
|
||
@Override | ||
protected Class<?> getBeanClass(Element element) { | ||
return WebFluxInboundEndpoint.class; | ||
} | ||
|
||
@Override | ||
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { | ||
super.doParse(element, parserContext, builder); | ||
|
||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "codec-configurer"); | ||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "requested-content-type-resolver"); | ||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reactive-adapter-registry"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...java/org/springframework/integration/webflux/support/ClientHttpResponseBodyExtractor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2018 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.integration.webflux.support; | ||
|
||
import org.springframework.http.client.reactive.ClientHttpResponse; | ||
import org.springframework.web.reactive.function.BodyExtractor; | ||
|
||
/** | ||
* The {@link BodyExtractor} identity function implementation | ||
* which just returns the provided {@link ClientHttpResponse}. | ||
* | ||
* @author Artem Bilan | ||
* | ||
* @since 5.0.1 | ||
*/ | ||
public class ClientHttpResponseBodyExtractor implements BodyExtractor<ClientHttpResponse, ClientHttpResponse> { | ||
|
||
@Override | ||
public ClientHttpResponse extract(ClientHttpResponse response, Context context) { | ||
return response; | ||
} | ||
|
||
} |
Oops, something went wrong.