Issue with Spring Cloud Kubernetes

I’m trying to switch from using Spring Cloud Netflix (Eureka) to Spring Cloud Kubernetes as we are running on OpenShift. Only problem is that KubernetesRegistration.getMetadata() returns null. This causes a NullPointerException in SpringCloudCommandRouter.updateMembership() when invoked from SpringCloudHttpBackupCommandRouter.updateMembership().

It seems like people are using Spring Cloud Kubernetes out there. How did you get around this problem?

I should add that I’m using Axon v3.3.5 and Spring Cloud Kubernetes v1.0.1.RELEASE. Also, when I say that KubernetesRegistration.getMetadata() returns null, I mean it is explicitly returning null. From their github:

`
public class KubernetesRegistration implements Registration, Closeable {
.
.
.
@Override
public Map<String, String> getMetadata() {
return null;
}
.
.
.
}

`

Hi Michael,

Sorry for the late reply on your user group question.
Times are quite busy at AxonIQ, so we quick resolution of questions here does not always have priority.
Regardless, I have seen your issue on GitHub, for which we’re entering a happy state for resolution as far as I know.

I’d however like to point out that the issue you’ve opened is resolving it for the Spring Cloud Extension.
You’re stating that you utilize Axon 3 however.

In Axon 3, the Spring Cloud Command Router is still part of the main Axon Framework repository.

If you’d thus require this change to be part of Axon 3.x, that justifies another PR in that repository too.
A more pragmatic, quick resolution in your project might be to include your own SpringCloudCommandRouter implementation which resolve the missing implementation of ServiceInstance#getMetadata() in Spring Cloud Kubernetes.

Hope this helps you out further Michael, and that it might serve as a reference for other readers experiencing the same issues.

Cheers,
Steven