Skip to content

Commit d2285ff

Browse files
committed
Fix creating RSocket client. Reformat.
1 parent aca304d commit d2285ff

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/interfaceclients/rsocket/RSocketInterfaceClientsAutoConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232
* @author Olga Maciaszek-Sharma
3333
*/
3434
@AutoConfiguration(after = RSocketRequesterAutoConfiguration.class)
35-
@ConditionalOnClass({ RSocketRequester.class, io.rsocket.RSocket.class, HttpServer.class,
36-
TcpServerTransport.class, RSocketServiceProxyFactory.class })
35+
@ConditionalOnClass({ RSocketRequester.class, io.rsocket.RSocket.class, HttpServer.class, TcpServerTransport.class,
36+
RSocketServiceProxyFactory.class })
3737
@EnableConfigurationProperties(RSocketInterfaceClientsProperties.class)
3838
@ConditionalOnProperty(value = "spring.interfaceclients.enabled", havingValue = "true")
3939
@Import(RSocketInterfaceClientsImportRegistrar.class)
4040
public class RSocketInterfaceClientsAutoConfiguration {
41+
4142
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/interfaceclients/rsocket/RSocketInterfaceClientsBaseProperties.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public class RSocketInterfaceClientsBaseProperties {
3535
*/
3636
private Integer port;
3737

38-
3938
/**
40-
* URI used to create a Websocket connection for RSocketRequester. By default, set to null.
39+
* URI used to create a Websocket connection for RSocketRequester. By default, set to
40+
* null.
4141
*/
4242
private URI uri;
4343

@@ -64,4 +64,5 @@ public URI getUri() {
6464
public void setUri(URI uri) {
6565
this.uri = uri;
6666
}
67+
6768
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/interfaceclients/rsocket/RSocketInterfaceClientsFactoryBean.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.springframework.boot.autoconfigure.interfaceclients.AbstractInterfaceClientsFactoryBean;
2323
import org.springframework.boot.autoconfigure.interfaceclients.QualifiedBeanProvider;
2424
import org.springframework.messaging.rsocket.RSocketRequester;
25-
import org.springframework.messaging.rsocket.RSocketStrategies;
2625
import org.springframework.messaging.rsocket.service.RSocketServiceProxyFactory;
2726

2827
/**
@@ -35,18 +34,19 @@ public class RSocketInterfaceClientsFactoryBean extends AbstractInterfaceClients
3534
@Override
3635
public Object getObject() throws Exception {
3736
RSocketRequester requester = rsocketRequester();
38-
return RSocketServiceProxyFactory.builder(requester).build();
37+
RSocketServiceProxyFactory factory = RSocketServiceProxyFactory.builder(requester).build();
38+
return factory.createClient(this.type);
3939
}
4040

4141
private RSocketRequester rsocketRequester() {
4242
RSocketRequester userProvidedRequester = QualifiedBeanProvider
43-
.qualifiedBean(this.applicationContext.getBeanFactory(), RSocketRequester.class, this.clientId);
43+
.qualifiedBean(this.applicationContext.getBeanFactory(), RSocketRequester.class, this.clientId);
4444
if (userProvidedRequester != null) {
4545
return userProvidedRequester;
4646
}
4747

4848
RSocketRequester.Builder userProvidedRSocketRequesterBuilder = QualifiedBeanProvider
49-
.qualifiedBean(this.applicationContext.getBeanFactory(), RSocketRequester.Builder.class, this.clientId);
49+
.qualifiedBean(this.applicationContext.getBeanFactory(), RSocketRequester.Builder.class, this.clientId);
5050
if (userProvidedRSocketRequesterBuilder != null) {
5151
return toRequester(userProvidedRSocketRequesterBuilder);
5252
}
@@ -63,7 +63,7 @@ private RSocketRequester toRequester(RSocketRequester.Builder requesterBuilder)
6363
// If the user wants to set the baseUrl directly on the builder,
6464
// it should not be set in properties.
6565
RSocketInterfaceClientsProperties properties = this.applicationContext
66-
.getBean(RSocketInterfaceClientsProperties.class);
66+
.getBean(RSocketInterfaceClientsProperties.class);
6767
if (properties.getHost() != null && properties.getPort() != null) {
6868
return requesterBuilder.tcp(properties.getHost(), properties.getPort());
6969
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/interfaceclients/rsocket/RSocketInterfaceClientsImportRegistrar.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ protected Class<? extends Annotation> getAnnotation() {
3434
protected Class<?> getFactoryBeanClass() {
3535
return RSocketInterfaceClientsFactoryBean.class;
3636
}
37+
3738
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/interfaceclients/rsocket/RSocketInterfaceClientsProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ public RSocketInterfaceClientsBaseProperties getProperties(String clientId) {
4545
// unless overridden, is in `clientsProperties`
4646
return this.getClients().get(clientId);
4747
}
48+
4849
}

0 commit comments

Comments
 (0)