Spring Cloud Eureka with Python Django client

4.7k Views Asked by At

Can we discover python Django micro service from spring Eureka registry (without using Site car or any java library)?

I tried this also but I haven't got any success yet.

from eureka.client import EurekaClient
import logging

logging.basicConfig()

ec = EurekaClient("MyApplication",eureka_domain_name="python_client",region="127.0.0.1",
                  vip_address="http://192.168.120.14:8761/eureka",port=8761, )

print ec.get_zones_from_dns()
print ec.get_eureka_urls()
print ec.register()
print ec.update_status("UP")  # Or ec.register("UP")
print ec.heartbeat()
1

There are 1 best solutions below

0
On

I assume your are trying to add your python-microservice in spring-boot framework. Eureka client should discover your service . please check if you have updated the bootstrap.properties file with entry like:

spring.application.name=EmployeeEurekaServer

eureka.client.serviceUrl.defaultZone:http://localhost:8761/

`server.port=8761`
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false

This will allow your application on the Eureka-Guestlist. Hope this answers!!