4
votes

I just installed a Spring Cloud Gateway server (Greenwich.SR2) with Boot Actuator starter dependency, but can't reach any /actuator/gateway or /gateway API

I tried to activate and publish the endpoint, without success : management.endpoint.gateway.enabled=true management.endpoints.web.exposure.include=health,gateway

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.1.6.RELEASE com.example gateway 0.0.1-SNAPSHOT gateway Demo project for Spring Boot

<properties>
    <java.version>11</java.version>
    <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-gateway</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
    </dependency>
</dependencies>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

I acknowledge that this is a WebFlux+Netty server, but this is not supposed to make any difference from what I read. I must have missed something, though.

Any experience to share, someone?

1
Note that /actuator endpoint is alive : { "_links": { "self": { "href": "localhost:8090/actuator", "templated": false }, "health": { "href": "localhost:8090/actuator/health", "templated": false }, "health-component-instance": { "href": "localhost:8090/actuator/health{component}/{instance}", "templated": true }, "health-component": { "href": "localhost:8090/actuator/health{component}", "templated": true }, "gateway": { "href": "localhost:8090/actuator/gateway", "templated": false } } }Thomas Escolan
What are your routesspencergibb
What does can't reach mean?spencergibb
Thanks for your guidelines, it took me some time to realize that the root endpoint is blank and that I had to go on with API syntaxThomas Escolan

1 Answers

6
votes

Ok, here goes the shame moment... There is no API at /actuator/gateway ; the API is at /actuator/gateway/routes and so on !