carnellj / spmia-chapter6

Spring Microservices in Action Chapter 6
40 stars 121 forks source link

serviceUrl incorrect in .yml files #3

Open paulfrench opened 6 years ago

paulfrench commented 6 years ago

In client yaml files you have:

eureka:
  client:
  serviceUrl:
    defaultZone: http://localhost:8761

I believe it should be...

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761

You get away with it in your examples since the default zone is http://localhost:8761 I had issues when I tried to use a different port. What worked for me was...

Eureka server yaml should have:

server:
  port: 8761
eureka:
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: http://localhost:${server.port}/eureka/

...where as client yaml should have...

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

I've really enjoyed the book by the way. It's an excellent read. Cheers