first of all: there are websocket implementations for websockets in java: https://www.google.com/search?q=websockets+java&aq=0&oq=websockets+jav&aqs=chrome.1.57j0l3j62l2.3243j0&sourceid=chrome&ie=UTF-8 consider them first :)
the other thing, to learn js and increase development speed. it depends on your requirements. it can make sense to separate http and tcp parts, especially to achieve better reliability. but it may increase latency. it's a tradeoff you have to make. it may be make even more sense to separate your jobs into another service you don't need socket.io to push from tcp to http server. just use tcp, it's bidirectional by default. Am Mittwoch, 24. April 2013 01:28:55 UTC+2 schrieb [email protected]: > > Hello, > > I am building a web application to manage print jobs. In the past I have > worked with Java based back-ends with the following architecture. > > 1. A standalone Java application running as a daemon which reads/writes > from/to a DB, and sends out messages to tomcat (any subscribed clients) > containing printer/job state changes. > 2. A tomcat server for request/response with Comet for push and > > I am researching to see if I can replace the Java back-end pieces with > Node js. The main reason is to use WebSockets or a lib like socket.iowithin > the web app for real time updates. It was a lot of work to do push > from tomcat/cometd. Other reasons include being able to learn/write > Javascript code within the entire app, faster development once I get past > the learning curve. > > Can someone comment if I am heading in the right direction with the > following? > > > Node js > <------------------> MongoDB > TCP server > ^ > | > UI in Browser | RPC > ^ | > | | > | | > -------------------------------> Node js > HTTP server > + > Socket.IO > > UI Talks to Node JS HTTP Server using a request/response style. Updates > will be pushed to UI using socket.io. > > The Node JS TCP Server will communicate with a DB. It will also do other > tasks - monitor directories to look for new files. > > Anytime the Node JS HTTP Server gets a request, it will use RPC to talk to > Node JS TCP Server. Socket.IO maybe used in the TCP Server to push updates > to Node JS HTTP > > Does it make sense to have a seperate TCP Server or should I do all the > above in the HTTP Server? > > Thanks, > KK > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
