English 中文(简体)
Game服务器网关设计
原标题:Game server gateway design

我正试图建立一个通用的服务器,以便始终以相关客户为服务。

结构由4个主要组成部分组成。

  • Stateful App Servers
  • Stateless Gateway Servers
  • Clients
  • Queueing Systems and brokers

流程流量

  1. Client connects to a gateway
  2. Gateway accepts as sends a session id back to client
  3. Client sends a message to gateway
  4. The Gateway writes the request to a Message / Task Queue
  5. A daemon reads the messages on the Queue and forwards them to the App Server(s) s listening socket
  6. The App Servers runs the message through its business logic
  7. The App Server then at a later point sends a related message to the client into the gateway queue
  8. A thread on the gateway reads the messages in its inbound queue and then sends messages back to clients as identified in the message.
  9. The gateway maintains a map of Client Session Id to the Client Socket object to forward incoming messages to the Client Sockets

我正在使用 Java网关。 上诉服务器也设在 Java。

我倾向于说,设计像Mongrel2,但我并不完全相信。 我要说的是,这更符合城市航空业中海ium前沿服务器设计(http://urbanairship.com/blog/ 201008/24/c500k-in-action-at-urban-airship/)

My question is: - Is using a thread for reading messages from the inbound queue and then forwarding them to clients a good idea? Is there a better way to handle this?

问题回答

你可能知道,这种应用在云层服务方面已经存在,因此,你不必重新发明轮轮。 • 搜索hp.com网站。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签