NAT的组和主题为:
subject:
svc.croupier.croupier
queue:
croupier
如何用python向nats服务器发送消息
四、尝试:
import asyncio
from nats.aio.client import Client as NATS
from stan.aio.client import Client as STAN
import json
data = json.dumps({"symbol": "GOOG", "price": 1200 }).encode()
nc = NATS()
await nc.connect("127.0.0.1:4222")
response = await nc.request("svc.croupier.croupier",data, timeout=10)
print("Received response: {message}".format(
message=response.data.decode()))
print(response)
向该队列和主题发送消息(特别是json)的正确方式是什么
问候
目前没有回答
相关问题 更多 >
编程相关推荐