I am very new to the microservices and trying to run the code from link: https://dzone.com/articles/advanced-microservices-security-with-spring-and-oa . When I simply run th
Look for the filterType() in ZuulLoggingFiler.java. I had the same problem. Then i saw my filter was returning null. so I changed it to "post" and it worked.
@Override
public String filterType() {
// TODO Auto-generated method stub
return "post";
}
You need to create Eureka Registry Server which is another microservice. It's main class incase of an SpringBoot application, should have @EnableEurekaServer annotation.
Then in your Eureka Client you will have to mention the Registry server URL in appliation.yml as below :
spring:
application:
name: stock-service
server:
port: 8083
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://localhost:8084/eureka/
instance:
hostname: localhost
where defaultzone should hold the value of your Eureka Registry.
Once you do all these configurations you need to Get the Eureka Registry microservice up and then you can get the Eureka client up. Once your Registry is up you will not face this exception.
Similar error will be thrown when you have misspelled anything in the value of defaultZone. For ex: someone has misspelled eureka to euraka. Double check it.
defaultZone : http://localhost:8761/eureka
I find I have to add these two applications to the appllication.properties,it can work.Only one is not enough.
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
for me its working after connecting to internet because it need to download some dependence first time.
This particular message is just a warning. Your application is attempting to register with Eureka but Eureka is not responding. You can either start an instance of Eureka or disable the automatic registration by adding the following to your application.yml.
eureka:
client:
register-with-eureka: false