Coder Social home page Coder Social logo

Comments (6)

shareisall avatar shareisall commented on May 18, 2024 2

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);
}

from alibaba-rsocket-broker.

shareisall avatar shareisall commented on May 18, 2024

rsocket.broker.topology=gossip
rsocket.broker.seeds=192.168.1.2,192.168.1.3,192.168.1.4

from alibaba-rsocket-broker.

amondnet avatar amondnet commented on May 18, 2024

@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.

from alibaba-rsocket-broker.

shareisall avatar shareisall commented on May 18, 2024

Sorry for last reply. But it works for me.

Envirements:

  • SpringBoot 3.1.4
  • Alibaba RSocket Broker version: 1.1.5
  • Operating System version: Mac
  • Java version: 17

Code:

rsocket:
  brokers:
    - tcp://127.0.0.1:9999
    - tcp://127.0.0.1:9999
  jwt-token: None

from alibaba-rsocket-broker.

shareisall avatar shareisall commented on May 18, 2024

Array indentation should be 2 space in your yaml file.

from alibaba-rsocket-broker.

amondnet avatar amondnet commented on May 18, 2024

@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.

https://github.com/alibaba/alibaba-rsocket-broker/blob/master/alibaba-rsocket-spring-boot-starter/src/main/java/com/alibaba/spring/boot/rsocket/RSocketBrokerHealthIndicator.java

public RSocketBrokerHealthIndicator rsocketBrokerHealth(RSocketEndpoint rsocketEndpoint, UpstreamManager upstreamManager, @Value("${rsocket.brokers}") String brokers) {

In the yaml, if rsocket.brokers is a list, then RSocketBrokerHealthIndicator is not registered.

  1. 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"}}
  1. 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

-->

from alibaba-rsocket-broker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.