Open amondnet opened 1 year ago
rsocket.broker.topology=gossip rsocket.broker.seeds=192.168.1.2,192.168.1.3,192.168.1.4
@shareisall
rsocket.broker.topology=gossip rsocket.broker.seeds=192.168.1.2,192.168.1.3,192.168.1.4
The above properties are used by the alibaba-rsocket-server
. This issue occurs in alibaba-rsocket-spring-boot-starter.
.
@Bean
@ConditionalOnProperty("rsocket.brokers")
public RSocketBrokerHealthIndicator rsocketBrokerHealth(RSocketEndpoint rsocketEndpoint, UpstreamManager upstreamManager, @Value("${rsocket.brokers}") String brokers) {
return new RSocketBrokerHealthIndicator(rsocketEndpoint, upstreamManager, brokers);
}
If you use application.properties
or application.yaml
+ string, the RSocketBrokerHealthIndicator
will be registered without any problems.
rsocket.brokers=tcp://localhost:9999
rsocket:
brokers: tcp://localhost:9999
However, if you use an array of strings, it won't register.
rsocket:
brokers:
- tcp://localhost:9999
This is fine for practical use, but kubernetes scheduler can't perform health checks properly because the health indicator is not registered.
Sorry for last reply. But it works for me.
rsocket:
brokers:
- tcp://127.0.0.1:9999
- tcp://127.0.0.1:9999
jwt-token: None
Array indentation should be 2 space in your yaml file.
@shareisall
I've been using alibaba-rsocket-broker
in production for over a year. I'm not talking about the rsocket app not working, I'm talking about the health indicator not registering.
In the yaml, if rsocket.brokers is a list, then RSocketBrokerHealthIndicator is not registered.
use string
rsocket:
brokers: tcp://127.0.0.1:9999
jwt-token: None
management:
endpoint:
health:
show-details: always
curl http://localhost:8080/actuator/health/rsocketBrokerHealth
{"status":"UP","details":{"brokers":"tcp://127.0.0.1:9999","localServiceStatus":"Serving"}}
use array
rsocket:
brokers:
- tcp://127.0.0.1:9999
jwt-token: None
management:
endpoint:
health:
show-details: always
curl http://localhost:8080/actuator/health/rsocketBrokerHealth
-->
You are right, there's a bug in the method rsocketBrokerHealth of class com.alibaba.spring.boot.rsocket.RSocketAutoConfiguration.
CODE:
@Bean
@ConditionalOnProperty("rsocket.brokers")
public RSocketBrokerHealthIndicator rsocketBrokerHealth(
RSocketEndpoint rsocketEndpoint,
UpstreamManager upstreamManager,
@Value("${rsocket.brokers}") String brokers
) {
return new RSocketBrokerHealthIndicator(rsocketEndpoint, upstreamManager, brokers);
}
Describe the bug
In the yaml, if
rsocket.brokers
is a list, thenRSocketBrokerHealthIndicator
is not registered.If it is a string, then
RSocketBrokerHealthIndicator
is registered.Environment
Steps to reproduce this issue
http://localhost:8080/actuator/health
Pls. provide GitHub address to reproduce this issue.
https://github.com/alibaba/alibaba-rsocket-broker/blob/fdd39b328b6ed69d7b2e320d8384f29bdc189569/alibaba-rsocket-spring-boot-starter/src/main/java/com/alibaba/spring/boot/rsocket/RSocketAutoConfiguration.java#L166
Expected Result
Actual Result