locka
locka

Reputation: 6029

ActiveMQ example which shows client-server 2 way communication?

I want to write a Java SE client application that talks to a Java server. Imagine something akin to an online game where there is a lot of traffic and potentially multiple clients connected to the same server.

  1. Constant communication between client and server
  2. Communication will be out of order, out of band so neither end knows nor expects what message it might receive next or when.
  3. The server doesn't know the client IP and cannot establish comms back to the client (because there may be NAT in the way). So any open ports must be initiated from the client side.
  4. Actual payload will be serialized bytes. I intend to use Protocol Buffers to marshal messages into bytes onto the wire so that the transport envelope must be lightweight too.
  5. Client is Java SE, but potentially some day it could be C++.

ActiveMQ seems to be a suitable choice here but since I have never used it like this I am not sure if it has the performance or characteristics.

Can someone advise if it is suitable, what pitfalls I may encounter and perhaps suggest a tutorial which demonstrates something similar to what I am considering?

Upvotes: 2

Views: 2151

Answers (1)

Hiram Chirino
Hiram Chirino

Reputation: 4091

Yeah, I highly recommend ActiveMQ, it's fast, easy to install, it can handle all your requirements nicely. It's tight encoding option will really compress the message envelope size and it even supports a 'useCompression' option to compress the message bodies for you. It also has a nice C++ client

Upvotes: 5

Related Questions