GH-653 Make consistent priority order of function definition in RSocket

With this commit spring.cloud.function.routing-expression property takes precedence over all, then route(<function.definition>) and then spring.cloud.function.definition property
This commit is contained in:
Oleg Zhurakousky
2021-02-22 11:11:12 +01:00
parent 1f2c3d8017
commit 57776c6b0c
3 changed files with 51 additions and 39 deletions

View File

@@ -57,6 +57,16 @@ public class RSocketAutoConfigurationRoutingTests {
RSocketRequester.Builder rsocketRequesterBuilder =
applicationContext.getBean(RSocketRequester.Builder.class);
rsocketRequesterBuilder.tcp("localhost", port)
.route("uppercase")
.metadata("{\"func_name\":\"echo\"}", MimeTypeUtils.APPLICATION_JSON)
.data("hello")
.retrieveMono(String.class)
.as(StepVerifier::create)
.expectNext("hello")
.expectComplete()
.verify();
rsocketRequesterBuilder.tcp("localhost", port)
.route("")
.metadata("{\"func_name\":\"echo\"}", MimeTypeUtils.APPLICATION_JSON)
@@ -69,13 +79,23 @@ public class RSocketAutoConfigurationRoutingTests {
rsocketRequesterBuilder.tcp("localhost", port)
.route(RoutingFunction.FUNCTION_NAME)
.metadata("{\"func_name\":\"uppercase\"}", MimeTypeUtils.APPLICATION_JSON)
.metadata("{\"func_name\":\"echo\"}", MimeTypeUtils.APPLICATION_JSON)
.data("hello")
.retrieveMono(String.class)
.as(StepVerifier::create)
.expectNext("HELLO")
.expectNext("hello")
.expectComplete()
.verify();
// rsocketRequesterBuilder.tcp("localhost", port)
// .route(RoutingFunction.FUNCTION_NAME)
// .metadata("{\"func_name\":\"uppercase\"}", MimeTypeUtils.APPLICATION_JSON)
// .data("hello")
// .retrieveMono(String.class)
// .as(StepVerifier::create)
// .expectNext("HELLO")
// .expectComplete()
// .verify();
}
}