spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
805 stars 543 forks source link

Without web dependency, the project cannot be registered in consul #791

Closed herestars closed 1 year ago

herestars commented 1 year ago

Items cannot be registered in consul because I follow your comments. I observed that consul was based on the HTTP protocol, so I tried to join the springboot-web dependency and run successfully. But this is not explained in the README file, who can tell me why. This is dependency :

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-consul-discovery</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
weir2010 commented 1 year ago

4.0.0-M3 me too

spencergibb commented 1 year ago

consul discovery tries to register using a port that is gathered from the web server. Have you tried setting spring.cloud.consul.discovery.port? What are you using for requests if not web?

spring-cloud-issues commented 1 year ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 1 year ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.