Axon 4.2 with Spring Cloud Extension with Eureka

Hello,

I’m new to Axon. I’m following the documentation on the web site and I’ve successfully deployed Kafka with Axon.

I’m trying now to use the Spring-Cloud extension. I’ve try the configurations indicated in https://docs.axoniq.io/reference-guide/extensions/spring-cloud, with and without “fallback”, but I still have this message : org.axonframework.commandhandling.NoHandlerForCommandException: No node known to accept [com.ssg.demo.api.CreateContractCmd]

What do I miss ?

Thanks,

David

Hi David,

I assume you’ve taking a look at it, but I am gonna reiterate it any how.

Have you tried setting things up with Axon Server too?

It will greatly simplify any configuration stuff you’d have to do to attach event streams (through Kafka) and command handling (through the Spring Cloud extension), thus getting you back in to providing business functionality instead.

Regardless, to the issue at hand, using the Spring Cloud solution to distributing command you should be aware that an Axon Client node’s awareness of the cluster is only updated on the heartbeat event of your application.
At the heartbeat event the SpringCloudCommandRouter will check with the Discovery Service provided by Spring Cloud to deduce which nodes can handle what commands.
This means there is by definition a short time window where nodes cannot find one another when using Spring Cloud.

Other than that, I’d likely verify whether your Eureka Server actually shows the connected Eureka Clients.
The latter being your Axon applications in this scenario.
If the server doesn’t show them to be connected, well, then you’ve got the culprit there.

When it comes to correctly configuring Eureka, granted if that’s the issue, I would suggest you to check FAQ’s from their side.

Concluding, as said earlier, Axon Server would greatly simplify your situation here.
Regardless, I hope my above info helps you out to resolve the issue at hand!

Cheers,

Steven van Beelen

Axon Framework Lead Developer

AxonIQ
Axon in Action Award 2019 - Nominate your project

Hello Steven,

Yes I’ve tested the Axon Server, and yes it’s work fine out of box. I’m just evaluating different approach to integrate the Axon Framework in my ecosystem.

My Eureka client show the REST Web service exposed but no Axon services for the Bus Command seems to be registred on the server side. Any advice on this ?

Thanks,

David

Hi David,

That is completely fair, of course you should evaluate all the options available!

Towards your issue, if your Axon application are not seen as “Eureka Clients” in your “Eureka Server”, then to me that signals they are:

  1. Not set up as Eureka Clients
  2. Cannot connect to the Eureka Server (host/port issues maybe, or security)

How I’ve typically set up Axon with Eureka as the Spring Cloud solution, is by adding the [spring-cloud-starter-netflix-eureka-client](https://search.maven.org/search?q=a:spring-cloud-starter-netflix-eureka-client) to my project.

Added, if I recall correctly, I had to set the @EnableDiscoveryClient annotation on the Spring Boot application to actually make it into a Eureka Client.

Hope this guidance helps you out David!

Cheers,
Steven