Java-side implementation of cloud-melting

Source: Internet
Author: User

To use the cloud for instant messaging, here are the steps to implement:

1, Registered Appkey secret, this is the first step;

2, download cloud Java client Https://github.com/rongcloud/server-sdk-java;

3, integrated into their own projects. This is the download, the directory is very simple

We took two bags to our project and two jars into our own project LIB, so we can do it.

4. Since our business is only for a single chat and one-to-two business, the client can only implement these features:

1. Get token

2 messages, I see that the cloud provides real-time routing, and Message history, feel no use, because the message is called the client, so when the message is sent to our current database, when the user clicks into the chat, will be instant access to chat with us, look at my database design

A table is used to store the message:

USER_ID is sender, be_user_id, addressee, contentId, session record ID, two person only one session record, generate policy:

is to judge the size of the small put in front (this is because our business needs), content, whether unread read.

3, Send message:

Basically has realized the function.

Of course

Java-side implementation of cloud-melting

Related Article

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.