Pega Customer Service Chat engine architecture
Pega Customer Service Chat engine architecture supports synchronous communication between customers and customer service representatives(CSRs), withstanding multiple concurrent users and messages. You can further scale this architecture as the number of users increases.
The following figure shows a layered chat engine architecture and explains how the data flows between a customer and a CSR through multiple layers and components:
The chat engine architecture primarily consists of the following parts:
- Chat client
- Chat server engine
- A multitenant server that is a combination of multiple servers responsible for handling the entire message communication between a customer and a CSR.
The chat server has the following components:
- WebSocket Server
- Extensible Messaging and Presence Protocol (XMPP) Server
- Web Server(Express)
- Object Interface
The chat engine uses the layered architecture that contains the following layers:
|Presentation layer||This layer handles the incoming data to the server from the CSR and the outgoing data from the server to the customer and in the opposite direction. The presentation layer for the CSR is the Interaction Portal, and the presentation layer for the customer is a web chatbot on the website.|
This layer handles all the business logic that takes place in the chat server. The layer is responsible for maintaining all the complex communications of WebSocket and XMPP, processing the chat events, and sending that information to the presentation layer.
This layer handles the data storage in the database. Apart from containing the object-relational database, this layer also includes the cache that stores a subset of data.
When a customer initiates a chat, the chat message goes to the WebSocket client from
where the message passes over a TCP connection to the WebSocket server. The
WebSocket server redirects the message to the chat event handlers that are
responsible for processing all chat events. The chat event handlers broadcast the
request through sockets to the XMPP server. The
Custom to XMPP
file in the XMPP server converts the message to a stanza and sends the converted
text to the CSR.
When the CSR responds, the XMPP server receives a ping (response) in the form of a
XMPP to Custom file converts the stanza into a
message and then broadcasts the message to the WebSocket from where the message
reaches the WebSocket server. Finally, the WebSocket server sends this message over
the socket connection to the WebSocket client that resides in the customer's