Network online game development experience (server side) (six)

xiaoxiao2021-03-06  38

Sixth, asynchronous messages

In the process of user playing, there are many things that need to be recorded, such as recording users' points, grade changes, record playing logs for data statistics, when the number of users is large, record this information in the database will cost resource, The user will wait for a long time after playing a game. The method of solving this problem is to use J2EE's message bean to provide an asynchronous communication mechanism. When you need to record data, the system will encapsulate a value object, send it to the J2EE container. This action is very fast. After completion, return, users can Continue, do not worry about when the message is processed. J2EE's message framework has the following characteristics:

◇ The message will be read, and only read once. The JMS frame has its own algorithm that buffers the message to the hard disk, even if the J2EE server is dead, the message will not be lost.

◇ The system uses a point-to-point Queue message queue to ensure advanced news of the same priority.

In JBoss 4.0, the deployment message bean and queue queue are easier than WebLogic 8.1, just declare message destinations in jboss.xml, if JBoss discovers that the destination does not exist, it will automatically establish one, it is very simple. . Regarding the development and deployment of the message bean, I have a special article description (see my blog: http://blog.9cbs.net/bromon). Next: System startup and exit

转载请注明原文地址:https://www.9cbs.com/read-68889.html

New Post(0)