vert-x3 / vertx-service-discovery

Some tools one can use for doing microservices with Vert.x
Apache License 2.0
115 stars 67 forks source link

issue-96 #97

Closed cescoffier closed 6 years ago

cescoffier commented 6 years ago

Fix issue un the Kubernetes discovery.

When a service is deleted, 2 events are fired: MODIFIED and DELETED. This PR makes sure these events are reflected into the backend and so the record is correctly removed.

cescoffier commented 6 years ago

@daka1510 can you test with this PR?

daka1510 commented 6 years ago

@cescoffier - thanks for your quick turnaround. I tested the scenario with the updated version of KubernetesServiceImporter.java from the pull request and confirm that it works :).

Please find the corresponding traces below:

Nov 03, 2018 3:41:09 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Modifying service hello-minikube
Nov 03, 2018 3:41:09 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Kubernetes service unregistered from the vert.x registry: {"location":{"endpoint":"http://10.105.55.190:8080","host":"10.105.55.190","port":8080,"root":"","ssl":false},"metadata":{"run":"hello-minikube","kubernetes.namespace":"default","kubernetes.name":"hello-minikube","kubernetes.uuid":"567f1db0-df7e-11e8-a8ee-0800274f8294"},"name":"hello-minikube","registration":"98b3d3c9-59b1-4008-9f40-6e00019de675","status":"UP","type":"http-endpoint"}
Nov 03, 2018 3:41:09 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Kubernetes service published in the vert.x service registry: {"location":{"endpoint":"http://10.105.55.190:8080","host":"10.105.55.190","port":8080,"root":"","ssl":false},"metadata":{"run":"hello-minikube","kubernetes.namespace":"default","kubernetes.name":"hello-minikube","kubernetes.uuid":"567f1db0-df7e-11e8-a8ee-0800274f8294"},"name":"hello-minikube","registration":"d0817953-5152-4e9f-8009-4e3f3c6566d3","status":"UP","type":"http-endpoint"}
Nov 03, 2018 3:41:09 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Removing service hello-minikube
Nov 03, 2018 3:41:09 PM io.vertx.servicediscovery.kubernetes.KubernetesServiceImporter
INFO: Kubernetes service unregistered from the vert.x registry: {"location":{"endpoint":"http://10.105.55.190:8080","host":"10.105.55.190","port":8080,"root":"","ssl":false},"metadata":{"run":"hello-minikube","kubernetes.namespace":"default","kubernetes.name":"hello-minikube","kubernetes.uuid":"567f1db0-df7e-11e8-a8ee-0800274f8294"},"name":"hello-minikube","registration":"d0817953-5152-4e9f-8009-4e3f3c6566d3","status":"UP","type":"http-endpoint"}
cescoffier commented 6 years ago

Thanks for the feedback!