Description
Hello everyone!
I use RocketChat as a live agent system for my bot platform, all messages go through my bots and RocketChat is only called when I need to contact an agent
I have a doubt regarding rocketchat queues. Currently I don’t use the rocket queue system, I put users to service with agents using the Rest service(I do the detailed explanation in the additional information).
What is my problem right now?
My main problem is that as “STEP 2” is developed, it consumes a lot of memory/CPU because I keep polling to check a room.
How would I like to resolve this?
RocketChat has a queue system and I would like to use it by placing users in that queue and letting RocketChat manage it, is this possible?
My idea is based on other services I know I can put an external queue on RocketChat, however the documentation about this service is not very good which complicates
Any suggestions on how to solve this “problem” are welcome.
Thank you guys!!
Server Setup Information
- Version of Rocket.Chat Server: 4.1.2
- Operating System: Ubuntu
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog:
- NodeJS Version: v12.18.4
- MongoDB Version: v4.4.10
- Proxy: nginx
- Firewalls involved: no
Any additional Information
I do the following steps to put a user in contact with the agent:
STEP 1 (Register a new visitor with department name)
POST /api/v1/livechat/visitor/
STEP 2 (Poll to request a room)
GET /api/v1/livechat/room?token=userToken
STEP 3 (Listen to events)
Use node library @rocket.chat/sdk:
- driver login
- subscribe to events
- Handle agent messages and disconnection from agent
STEP 4
- send agent message
POST /api/v1/livechat/message - Send disconnection from user
POST /api/v1/livechat/room.close