Skip to content

Commit 7bcafab

Browse files
author
Dave Syer
committed
Fix for another API change
1 parent 3ce3769 commit 7bcafab

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/RestConfiguration.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@
3232
import org.springframework.http.server.reactive.HttpHandler;
3333
import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter;
3434
import org.springframework.util.StringUtils;
35-
import org.springframework.web.reactive.function.RequestPredicates;
36-
import org.springframework.web.reactive.function.RouterFunction;
37-
import org.springframework.web.reactive.function.RouterFunctions;
38-
import org.springframework.web.reactive.function.ServerRequest;
39-
import org.springframework.web.reactive.function.ServerResponse;
35+
import org.springframework.web.reactive.function.server.RequestPredicates;
36+
import org.springframework.web.reactive.function.server.RouterFunction;
37+
import org.springframework.web.reactive.function.server.RouterFunctions;
38+
import org.springframework.web.reactive.function.server.ServerRequest;
39+
import org.springframework.web.reactive.function.server.ServerResponse;
4040

41-
import static org.springframework.http.codec.BodyExtractors.toFlux;
42-
import static org.springframework.http.codec.BodyInserters.fromPublisher;
41+
import static org.springframework.web.reactive.function.BodyExtractors.toFlux;
42+
import static org.springframework.web.reactive.function.BodyInserters.fromPublisher;
4343

4444
import reactor.core.publisher.Flux;
45+
import reactor.core.publisher.Mono;
4546
import reactor.ipc.netty.NettyContext;
4647
import reactor.ipc.netty.http.server.HttpServer;
4748

@@ -72,7 +73,7 @@ public HttpHandler httpHandler(FunctionRegistry registry) {
7273
: registry.composeFunction(
7374
StringUtils.commaDelimitedListToStringArray(name));
7475
FunctionInvokingHandler handler = new FunctionInvokingHandler(function);
75-
RouterFunction<Publisher<String>> route = RouterFunctions.route(
76+
RouterFunction<ServerResponse> route = RouterFunctions.route(
7677
RequestPredicates.POST(webProperties.getPath())
7778
.and(RequestPredicates.contentType(MediaType.TEXT_PLAIN)),
7879
handler::handleText);
@@ -92,7 +93,7 @@ private FunctionInvokingHandler(Function<Flux<String>, Flux<String>> function) {
9293
this.function = function;
9394
}
9495

95-
private ServerResponse<Publisher<String>> handleText(ServerRequest request) {
96+
private Mono<ServerResponse> handleText(ServerRequest request) {
9697
Flux<String> input = request.body(toFlux(String.class));
9798
Publisher<String> output = this.function.apply(input);
9899
return ServerResponse.ok().body(fromPublisher(output, String.class));

0 commit comments

Comments
 (0)