What are the best practices to have two applications on the same host, one J2EE and the other Java standalone, communicate one with the other?
More infos:
- The j2ee application will be deplyed in Wildfly AS
- The Java stand alone is a Netty NIO Server
EDIT ONE
Even more infos:
- The Netty server is a cardgame server that will hold the business logic for the game itself and will allow players to play synchronously one with the other (up to four players per game, up to a max amount of games allowed from my hw server resources)
- The J2ee application (deployed in Wildly) will take care of authentication&authorization
- The J2ee application will take care of the DB connection and Persistence
- The J2ee application will have to forward to the java standalone server the remote-socket-address of the authenticated player and eventually an object holding the state of that player
- The J2ee application will potentially be the one triggering the communication although for my current flow, i am in need of a full duplex communication from both ends (hence my fear about a WS or Rest, isn't it kind of asymmetrical for a full duplex communication channel?)
- The Netty server may be seen as a background task of the AS that will start it (and eventually other cardgame servers) in an attempt of pseudo horizzontal scalability
Have one open a socket and communicate to the other.
You could do more exotic stuff, but if anything about the environment changes, it will break. For a few ideas of "exotic stuff"
- Write and read from named pipes
- Set up a shared memory buffer, or two.
etc ...