Scaling out a Jetlang app - Design q

Skip to first unread message

Abraham Menacherry

Jun 16, 2011, 12:19:30 PM6/16/11
to jetlang-dev
I am doing an evented game server as a project which uses Jetlang for
its internal in-vm messaging. Below is the normal program flow.

1) I get socket data tcp/udp from clients
2) After going through a bunch of decoders the socket data gets sent
to a player session's onEvent(IEvent event) method.(Events are like
login, logout, data_in etc)
3) Each session has an event dispatcher written in Jetlang, the
session on recieving the event will call the fireEvent method on the
dispatcher, which basically publishes the event to the dispatcher's
3) The dispatcher's fiber will pick up the event and send it to the
SessionEventHandlers based on their event type. datain goes to datain
handler, data out goes to data out handler and so on.
4) The event handlers would contain player and game related
information for e.g. a players current score, life left etc etc.

The question I have is, how do I "scale-out" this architecture? Should
I push my sessions to a data grid (hazelcast, infispan)??. Will it
work? I am asking due to the Event dispatchers connected to the
session and the event handlers connected to the dispatcher.

As a beginning, I would just be satisfied with High Availability,
meaning one machine crashes and the other one would transparently take

The modified work flow would be.
step 1 same as above
step 2 after decoding client data, do a lookup session from the
distributed map and call onEvent on it. -> Is this step practical?
rest of the steps.


Mike Rettig

Jul 9, 2011, 3:21:49 PM7/9/11

Sorry for the slow response but I've been on vacation.

I don't have any real answers for you. I haven't worked on a gaming
architecture. The implementation details you have provided all sound

Jetlang remoting might be a viable option for a simple distribution
mechanism. It doesn't provide failover, but I've already thought about
how that could be implemented. It already detects disconnects and
automatically reconnects, so I would just have to add some round
robining reconnects. Subscriptions are persistent so the reconnect can
be transparent to the client. Let me know if that is of interest and I
can provide you with a build.


> --
> You received this message because you are subscribed to the Google Groups "jetlang-dev" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Abraham Menacherry

Aug 8, 2011, 2:37:15 AM8/8/11
to jetlang-dev

Jetlang remoting could definitely be viable. The link for examples on
Remoting are not going through, hence I am unable to check them out
for now.

> > For more options, visit this group at Hide quoted text -
> - Show quoted text -
Reply all
Reply to author
0 new messages