node.js - How to make two NODE.js servers communicate each other over RabbitMQ?
问题描述
I wanted to create two servers in Node.js and make full-duplex communication with each other over rabbitMQ. I am new to messagebrokers or event-driven development, I just want to make one server serve API to the front-end another one just a chat server? Is that even a good approach?
解决方案
Working directly with a broker is a bad idea. Typically, a gateway is added between the clients and the broker as an abstract layer. In this case, it will be easier for you to change the broker (for example, from rabbit to kafka, etc.), and you do not need to copy the client <-> broker logic in different languages. As example I just add this link reddwarf. Simple demo service is service and client is client
推荐阅读
- android - 构建过程因无效数据而失败,块必须是字符串或缓冲区,而不是对象
- python - 无法使用 Firefox WebDriver 打开新标签页
- webhooks - Slack Incoming Webhook 作为我的用户发送
- laravel - Laravel Scout 队列性能
- c# - Web api 上的 Azure 预热不起作用
- python - 用德语月份名称解析日期
- android - 当我调用启动画面时,它会在被授予 tru 后检查授予它一次又一次地调用我的应用程序
- mysql - MySQL 键值模式,返回必须匹配多个键的结果
- python - 在 django 和 MySQL 中检索 null 作为 JSON 默认值
- c# - 对使用 Azure 云服务的代码进行单元测试