admin管理员组文章数量:1287934
I am working with an AI chat agent system in node js and typescript. The system currently processes requests for the agents in memory as part of the request thread, and streams responses back via socket io. This setup is less than ideal, and we want to improve it. The goal is to move the processing of requests to backrgound jobs with rabbit mq consumers, but we want to still be able to stream from the consumers to the frontend via websocket interface. What is the best high level architecture to stream from a rabbit mq consumer to a websocket frontend?
What I am considering right now is setting up .js and pushing the responses to a queue that is then consumed by the web browser. The problem is that I'm not sure how to set up the connection tracking so that only the results from a particular agent are sent back to the browser. Is there a better architecture I could use?
Maybe something like setting up a websocket entpoint that is itself a consumer for the output from the worker queue that handles disseminating the messages/preserving logs/writing to db?
本文标签:
版权声明:本文标题:typescript - How to stream messages from a consumer for rabbit mq to a browser frontend via websockets? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741298682a2370963.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论