spring-cloud-kubernetes: Spring Cloud Gateway's Service Discovery with Spring Cloud Kubernetes not working in Greenwich.M3?

I’ve been trying to get Spring Cloud Gateway working with Spring Security and so I’ve moved to Greenwitch M3. I’ve managed to get security working but now I’m unable to get the gateway to correctly pick up all my downstream services.

Visiting one of my downstream services endpoints gets me a 500 error. No exceptions are thrown on my logs.

I’ve tried to printout all the services that the DiscoveryClient finds like so:

@Bean
CommandLineRunner discoveryClientRunner(DiscoveryClient client) {
	return new CommandLineRunner() {
	    @Override
	    public void run(String... args) throws Exception {
		System.out.println("Available Services:");
		client.getServices().forEach(System.out::println);
	    }
	};
}

I get a nice list of all my services.

For debugging purposes I’ve enabled /actuator/gateway/routes and when I visit it I get a:

There was an unexpected error (type=Internal Server Error, status=500).

No stack traces on my logs.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 42 (24 by maintainers)

Commits related to this issue

Most upvoted comments

NPE was solved.

Thank you.

This works!

Both the actuator/gateway/routes and communicating to the downstream services works as expected! 👍