Revert "Temporarily disable rsocket-routing-broker integration"
This reverts commit 63f655fb45.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<!-- <rsocket-routing.version>0.0.2-SNAPSHOT</rsocket-routing.version> -->
|
||||
<rsocket-routing.version>0.0.2-SNAPSHOT</rsocket-routing.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -42,12 +42,12 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-function-context</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>io.rsocket.routing</groupId> -->
|
||||
<!-- <artifactId>rsocket-routing-client-spring</artifactId> -->
|
||||
<!-- <version>${rsocket-routing.version}</version> -->
|
||||
<!-- <optional>true</optional> -->
|
||||
<!-- </dependency> -->
|
||||
<dependency>
|
||||
<groupId>io.rsocket.routing</groupId>
|
||||
<artifactId>rsocket-routing-client-spring</artifactId>
|
||||
<version>${rsocket-routing.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
@@ -63,12 +63,12 @@
|
||||
<artifactId>reactor-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>io.rsocket.routing</groupId> -->
|
||||
<!-- <artifactId>rsocket-routing-broker-spring</artifactId> -->
|
||||
<!-- <version>${rsocket-routing.version}</version> -->
|
||||
<!-- <scope>test</scope> -->
|
||||
<!-- </dependency> -->
|
||||
<dependency>
|
||||
<groupId>io.rsocket.routing</groupId>
|
||||
<artifactId>rsocket-routing-broker-spring</artifactId>
|
||||
<version>${rsocket-routing.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -16,6 +16,15 @@
|
||||
|
||||
package org.springframework.cloud.function.rsocket;
|
||||
|
||||
import io.rsocket.routing.client.spring.RoutingClientAutoConfiguration;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.cloud.function.context.FunctionProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.rsocket.RSocketConnectorConfigurer;
|
||||
|
||||
/**
|
||||
@@ -25,14 +34,14 @@ import org.springframework.messaging.rsocket.RSocketConnectorConfigurer;
|
||||
* @author Spencer Gibb
|
||||
* @since 3.1
|
||||
*/
|
||||
//@Configuration(proxyBeanMethods = false)
|
||||
//@ConditionalOnClass(RoutingClientAutoConfiguration.class)
|
||||
//@ConditionalOnProperty(name = FunctionProperties.PREFIX + ".rsocket.enabled", matchIfMissing = true)
|
||||
//@AutoConfigureBefore(RoutingClientAutoConfiguration.class)
|
||||
//@AutoConfigureAfter(RSocketAutoConfiguration.class)
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(RoutingClientAutoConfiguration.class)
|
||||
@ConditionalOnProperty(name = FunctionProperties.PREFIX + ".rsocket.enabled", matchIfMissing = true)
|
||||
@AutoConfigureBefore(RoutingClientAutoConfiguration.class)
|
||||
@AutoConfigureAfter(RSocketAutoConfiguration.class)
|
||||
class RSocketRoutingAutoConfiguration {
|
||||
|
||||
// @Bean
|
||||
@Bean
|
||||
public RSocketConnectorConfigurer functionRSocketConnectorConfigurer(
|
||||
FunctionRSocketMessageHandler handler) {
|
||||
return connector -> connector.acceptor(handler.responder());
|
||||
|
||||
@@ -18,8 +18,8 @@ package org.springframework.cloud.function.rsocket;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import io.rsocket.routing.client.spring.RoutingMetadata;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.StepVerifier;
|
||||
@@ -39,7 +39,6 @@ import org.springframework.util.SocketUtils;
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 3.1
|
||||
*/
|
||||
@Disabled
|
||||
public class RoutingBrokerTests {
|
||||
|
||||
ConfigurableApplicationContext functionContext;
|
||||
@@ -78,19 +77,19 @@ public class RoutingBrokerTests {
|
||||
|
||||
@Test
|
||||
public void testRoutingWithMessage() throws Exception {
|
||||
// this.setup(false);
|
||||
// RSocketRequester requester = clientContext.getBean(RSocketRequester.class);
|
||||
// RoutingMetadata metadata = clientContext.getBean(RoutingMetadata.class);
|
||||
// Mono<String> result = requester.route("uppercase") // used to find function
|
||||
// .metadata(metadata.address("samplefn"))
|
||||
// .data("\"hello\"")
|
||||
// .retrieveMono(String.class);
|
||||
//
|
||||
// StepVerifier
|
||||
// .create(result)
|
||||
// .expectNext("HELLO")
|
||||
// .expectComplete()
|
||||
// .verify();
|
||||
this.setup(false);
|
||||
RSocketRequester requester = clientContext.getBean(RSocketRequester.class);
|
||||
RoutingMetadata metadata = clientContext.getBean(RoutingMetadata.class);
|
||||
Mono<String> result = requester.route("uppercase") // used to find function
|
||||
.metadata(metadata.address("samplefn"))
|
||||
.data("\"hello\"")
|
||||
.retrieveMono(String.class);
|
||||
|
||||
StepVerifier
|
||||
.create(result)
|
||||
.expectNext("HELLO")
|
||||
.expectComplete()
|
||||
.verify();
|
||||
}
|
||||
|
||||
private void setup(boolean routingWithProperty) {
|
||||
|
||||
Reference in New Issue
Block a user