Question

I am going to write a client/server card game for learning/practice purposes, and intend to use Java for both the client and server to begin with. In the future I will be looking to continue to use this project for learning, and thus will want write additional clients in other languages such as C and C++.

The main detail I am unsure about is whether I need to use a MOM with a message broker, or if I can get away without using one.

My initial thought was I could handle the failure to send/receive a message on both sides, prompting an attempt to re-send the message resulting into the game being ended if the amount of attempts reaches a maximum.

However, instead of just having the game client and game server I was thinking about having a client, lobby server and game server. This way I would need the message broker to route the correct messages to the correct server, however I am unsure whether apart from that if I have any need for message broker, as I'm not sure if I really need to have any facility for message persistency.

I am leaning towards going for a MOM with a message broker, but I would welcome anymore lightweight solutions if I am doing so unnecessarilly. That said, if I did what would be a suitable cross-language MOM to use? I have seen quite a few suggested on SO before, but I'm not sure what would best meet my needs.

Was it helpful?

Solution

For cross language MOM - I suggest you use Apache ActiveMQ. It complies to the JMS spec and also has a robust C++ client library. It is open source (Apache license)

Yes the other lightweight option you could explore is HTTP. esp. for the client to server communication. (Since clients may need to connect to the server across firewalls etc - HTTP port is easiest to access etc).

For lobby server - game server communication - I like your idea of MOM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top