broker rpc
This commit is contained in:
parent
a033ef54ce
commit
3c5ea1fefa
2 changed files with 7 additions and 7 deletions
|
|
@ -103,10 +103,7 @@ def handle_request(requet_bytes, handler):
|
|||
}
|
||||
|
||||
response = handler(envirnment)
|
||||
print(response.content)
|
||||
# print(response.data)
|
||||
print(dir(response))
|
||||
# print(views.TestApiView().dispatch(request).data)
|
||||
# print(response.content)
|
||||
return response
|
||||
|
||||
|
||||
|
|
@ -130,7 +127,7 @@ def get_rpc_broker_consumer():
|
|||
exchange="",
|
||||
routing_key=props.reply_to,
|
||||
properties=pika.BasicProperties(correlation_id=props.correlation_id),
|
||||
body=str(response.content),
|
||||
body=response.content,
|
||||
)
|
||||
ch.basic_ack(delivery_tag=method.delivery_tag)
|
||||
|
||||
|
|
|
|||
|
|
@ -62,5 +62,8 @@ request = Request(method=method, url=url, json={'key_1': 'requests_lib'})
|
|||
rpc = RpcClient()
|
||||
|
||||
print(" [x] Requesting ...")
|
||||
for i in range(1000):
|
||||
response = rpc.call(request)
|
||||
print(response)
|
||||
# print(response.decode())
|
||||
# print(type(response.decode()))
|
||||
print(i)
|
||||
Loading…
Add table
Reference in a new issue