Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing redis-route-definition-repository property metadata #3299

Closed
cxhello opened this issue Mar 14, 2024 · 14 comments
Closed

Missing redis-route-definition-repository property metadata #3299

cxhello opened this issue Mar 14, 2024 · 14 comments
Milestone

Comments

@cxhello
Copy link

cxhello commented Mar 14, 2024

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.3</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>top.cxhello</groupId>
    <artifactId>spring-cloud-gateway-example</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>spring-cloud-gateway-example</name>
    <description>spring-cloud-gateway-example</description>

    <properties>
        <java.version>17</java.version>
        <spring-cloud.version>2023.0.0</spring-cloud.version>
        <spring-clou-alibaba.version>2023.0.0.0-RC1</spring-clou-alibaba.version>
    </properties>

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

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

    <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-loadbalancer</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
        </dependency>

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        </dependency>

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

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
        </dependency>

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

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

</project>

image

This is my project pom.xml. but in application.yml spring.cloud.gateway.redis-route-definition-repository.enabled not found. so i'm confused.

@spencergibb spencergibb changed the title RedisRouteDefinitionRepository problem Missing redis-route-definition-repository property metadata Mar 14, 2024
@spencergibb spencergibb added this to the 4.1.2 milestone Mar 14, 2024
@cxhello
Copy link
Author

cxhello commented Mar 14, 2024

@spencergibb When will the fixed version be released? I can't load routes using redis now.

@spencergibb
Copy link
Member

spencergibb commented Mar 14, 2024

The property still works, just doesn't have auto-completion metadata. Watch https://github.com/spring-cloud/spring-cloud-release/milestones or https://calendar.spring.io for release dates

@cxhello
Copy link
Author

cxhello commented Mar 14, 2024

I set this property and configured the redis connection, but the route still cannot be queried in redis. Am I missing other configurations?

@spencergibb
Copy link
Member

I don't know. You've provided only dependencies. I'd need an error or logs or better provide a complete, minimal, verifiable sample (something that we can unzip attached to this issue or git clone, build, and deploy) that reproduces the problem.

@cxhello
Copy link
Author

cxhello commented Mar 15, 2024

Thanks for your answer. This is my minimal sample, route is not loaded into redis after the application is started. Did I do something incorrectly?
https://github.com/cxhello/spring-cloud-gateway-sample.git

@spencergibb
Copy link
Member

spencergibb commented Mar 15, 2024

Can you provide the redis command you use to insert a route? And the url you try for that route?

@cxhello
Copy link
Author

cxhello commented Mar 15, 2024

I thought that if spring.cloud.gateway.redis-route-definition-repository.enabled=true was configured, the spring-cloud-gateway application would automatically store the routing configuration in yml into redis, but that's not actually the case, is it?

@spencergibb
Copy link
Member

No. It reads route information from redis.

@cxhello
Copy link
Author

cxhello commented Mar 15, 2024

I understand, we actually need to manually use redis to insert routes. Is this just automatically read?

@spencergibb
Copy link
Member

Yes, that is correct.

@cxhello
Copy link
Author

cxhello commented Mar 15, 2024

Thank you very much for your help.

@spencergibb
Copy link
Member

spencergibb commented Mar 15, 2024

You're welcome

@cxhello
Copy link
Author

cxhello commented Mar 15, 2024

We recently used spring-cloud-gateway for dynamic routing. I may be more active in the community, so please don't find me annoying, haha.

@spencergibb
Copy link
Member

Welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants