Subscribe/Publish messages to/from SocketIO/nodejs server from Java application?
I made something similar recently for teaching (node.js server, java client in publish/subscribe).
Actually, you should consider Faye : http://faye.jcoglan.com/ You can attach a websocket and/or bayeux server in a node.js instance using faye.
You can then connect any client that implement one or both of these protocol.
I successfully used it in the past for a lab with students in which a server is node.js publishing information, and a java client subscribe to faye using the cometd library (http://cometd.org/).
Source code of :
- this server with faye but also traditional http server is located at : https://github.com/cgravier/WI-UCLab/blob/master/context-server-nodejs/simulateArduino.js
- the java client using Cometd : https://github.com/cgravier/WI-UCLab/tree/master/context-client-java (sorry it is a library hell, it is designed for student that I was explicitly told were not familiar with maven (or equivalent), and it is 3h lab... anyway.)
Although the document is in French, I guess the figure at page 4 in https://github.com/cgravier/WI-UCLab/blob/master/lab%20document/context-awareness.pdf is self explanable.