-
-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
call service not using py.test. rpc process can't get response. #286
Comments
Your server script starts and then immediately stops the service https://github.com/jiamo/nameko_research/blob/master/test_service_server.py#L32 You don't need to create a $ nameko run test_service_server --config nameko_server.conf
('config is ', {'AMQP_URI_CONFIG_KEY': 'amqp://guest:guest@localhost', 'max_workers': 10, 'AMQP_URI': 'amqp://guest:guest@localhost', 'parent_calls_tracked': 10, 'rpc_exchange': 'nameko-rpc'})
starting services: helloworld
Connected to amqp://guest:**@127.0.0.1:5672// Also there is no need to implement the service client as you have. Just use the nameko command line: nameko shell --config nameko_server.conf
>>> n.rpc.helloworld.hello(name='John')
u'Hello, John!' |
Thanks. Some times we need run without |
You need to both apply the eventlet monkey patch and call index e764db8..8597563 100644
--- a/test_service_server.py
+++ b/test_service_server.py
@@ -1,3 +1,6 @@
+import eventlet
+eventlet.monkey_patch()
+
from nameko.rpc import rpc
from nameko.runners import ServiceRunner
from nameko.testing.utils import get_container
@@ -29,7 +32,7 @@ def main():
# start both services
runner.start()
- runner.stop()
+ runner.wait()
# container = ServiceContainer(HelloWorldService, config=config)
# service_extensions = list(container.extensions)
# print ("service_extensions is ", service_extensions) You should really consider using the code from I'm going to close this issue now. If you have more questions about how to use nameko please post them to the (new!) google group. |
I write a test_server and test_client to simple use nameko:
here is my repo : https://github.com/jiamo/nameko_research
python test_service_server.py
The test_service_client.py get some codes from cli module.
python test_service_client.py
can't get response.
So is there some misunderstandings in my repo.
The text was updated successfully, but these errors were encountered: