wasp / eureka

Async Eureka Client (Netflix OSS, Spring Cloud Service Discovery)
Apache License 2.0
19 stars 8 forks source link

Problem with Spring netflix Eureka #7

Closed WThamira closed 7 years ago

WThamira commented 7 years ago

I try to config this library with my django app. In this case it occur this error

from wasp_gateway import EurekaClient
ImportError: No module named 'wasp_gateway'

Then I copy and past library to my app and i run it. but now it comes like this error

  File "/home/user/Documents/code/Python/website2/website/wasp_eureka/client.py", line 158, in register
    return await self._do_req(url, method='POST', data=json.dumps(payload))
  File "/home/user/Documents/code/Python/website2/website/wasp_eureka/client.py", line 249, in _do_req
    await resp.text())
wasp_eureka.exc.EurekaException

how can i solve this. i think in Spring Cloud bundled eureka stack hasn't POST, GET method.

mattrasband commented 7 years ago

It looks like it's a documentation error on my part in the readme, you should use:

from wasp_eureka import EurekaClient  # instead of from wasp_gateway ...

Sorry about that, I will fix it now

mattrasband commented 7 years ago

I am using this against the embedded Eureka as well, against Brixton.SR6 (tested with SR4-6).

For example:

python -m wasp_eureka --ip <my_local_ip> --port <my_app_port> --eureka http://service-discovery.mycompany.com/ --name my_app_name
Creating a client session outside of coroutine
client_session: <aiohttp.client.ClientSession object at 0x100e76860>
2017-01-05 01:11:53   INFO :: Registered with eureka as d08fffae-d654-4672-987f-ab96829e2169:me:8080
2017-01-05 01:11:53   INFO :: Running
2017-01-05 01:12:23   INFO :: Lease renewed
2017-01-05 01:12:53   INFO :: Lease renewed
2017-01-05 01:13:23   INFO :: Lease renewed