Online customer service technical solution

Source: Internet
Author: User

Online customer service requirements:
Involved personnel: Customer Service personnel, common customers
Customer Service personnel: you can log on with a fixed employee ID. You can select customer service personnel. You can set the maximum number of chat users for each customer service personnel. When the customer service personnel are not online, they cannot chat.
Common customers: Anonymous logon. Common customers cannot chat with each other. You can select customer service personnel.
A chat can be initiated by a customer service or a common customer.
Online customer service only supports sending chat information. Registration, status, registration, and other functions are not supported.

The online customer service technology mainly includes the following solutions (I only know ):
1 socket technology
It is mainly used for browser plug-ins such as flash and applet.
2 comet Technology
Including Ajax-based long polling technology and server push technology
Ajax long polling: The most common web im technology: the browser uses Ajax for service requests and maintains a TCP connection until the connection times out. After the connection is closed, the client keeps a connection.
Advantage: no plug-ins need to be installed. The development is simple and can meet the needs of online customer service.
Disadvantage: keep persistent connections and occupy connection resources and thread resources. You must limit the number of connections and use a new thread pool. The default Thread Pool cannot be used.

Server push technology:
It is actually asynchronous Servlet technology. When there is an event, it is pushed directly to the client.
Advantage: It can release thread resources and reduce resource usage.
Disadvantage: Only Tomcat and jetty are supported. weblogic8 is not supported, and persistent connections are also required.

3 streaming technology
It is mainly used for live broadcast technology and does not involve client interaction. In general, the IFRAME technology is hidden synchronously to keep TCP connections, and the server continues to push information. IE is not supported.
4 Chat Server Technology
Currently, XMPP-based IM technology is popular. There are open source server and clients similar to QQ, xep-0124 also supports bosh technology, the relevant open source software is chat + JHB.
Advantages: mature open-source servers and clients, open-source protocols, support for high concurrency, support for complex operation requirements, such as status synchronization, registration, chat, rename, Group Sending, chat rooms and other operations.
Disadvantage: it does not meet the business needs of online customer service. If used, it is difficult to modify the server and client.

5. Screen Flushing Technology at regular intervals, the previous technology.

Solution Selection: Ajax-based long polling technology.

Key Points of specific technical solutions:
1. Use ajax to maintain persistent connections and reconnect after the server responds

Pseudocode:
While (true)
{
Try {
Connecttoserver (); // Blocking
} Catch (E)
{

}
}

Append of chat information using innerhtml.

Chat initiated by the customer: Click the chat button and select customer service personnel. Chat notification: use polling technology to notify Customer Service personnel.
Chat initiated by customer service: the chat window is automatically displayed for customer service personnel who have activities.
Stop chat: no response for a long time, quit the website. Either party closes the chat window.

2 Server
Chat Session: A chat process becomes a session, different from a session in JSP. The session ID is used to indicate the session. When the window of both parties is closed, the session will expire. Each session has a response queue. That is, a chat corresponds to two queues.
Handling process: both the customer and customer service personnel interact directly with WebLogic, and there is no direct connection between them. After the message is sent, it is forwarded to the queue of the affected session. Obtain data from the receiving queue, return to the client, disconnect, and reconnect.

To maintain thread and connection, you must limit the number of concurrent chats and configure a separate thread pool.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.