消息
如何远程给OpenClaw发送消息
· ☕ 1 分钟
1. 配置 hooks 在 openclaw.json 中配置 hooks 1 2 3 4 5 6 7 "hooks": { "enabled": true, "token": "xxx", "path": "/openclaw/hooks", "allowRequestSessionKey": true, "allowedAgentIds": ["*"] }, 参考 https://docs.openclaw.ai/automation/webhook 这里的 token 不能与 gateway 的 token 相同。 2. 发送消息 1 2 3 4 5 6 7 8 9 10 11 12 curl --location 'https://xxx.com/openclaw/hooks/agent' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer xxx' \ --data '{ "message": "介绍下自己,将消息发送到 https://xxx.com/api/v1/webhook/send?key=xxx", "agentId": "main", "sessionKey": "hooks-api-002", "wakeMode": "now", "deliver": true, "thinking": "low", "timeoutSeconds": 120 }' 由于以上请求是异步的

RabbitMQ 消息队列
· ☕ 4 分钟
1. 消息队列的适用场景 1.1 异步处理 应用场景:用户注册后,需要发注册邮件和注册短信。同步的处理方法,系统的性能(并发量,吞吐量,响应时间)会有瓶颈。 1.2 应用解耦 应用场景:用户下单后,订单系统需要通知库存系统。传统的做法是,订单系统调用库存系统的接口