From: jeljer te Wies Date: 2010-02-15T16:31:12+09:00 Subject: Re: how to detect used protocol (SOAP, JSON, XML etc.) > Then you're not just squirting the object over a raw TCP socket; you're > adding your own proprietary encapsulation/framing protocol around it. > And if you're going to do that, you might as well add another field > which says whether it's JSON or XML or whatever, and hence the problem > is solved. Yes you are right. I could use an extra field. But I need the ability to add more "adapters" when the esb gets more connections!.. so it's not so much what i am getting in but how I am able to detect what is getting in. >> I know that if (for example a web browser needs more requests it has to >> initiate a new connection for every request). > > No, it doesn't. With HTTP/1.1 the client can hold open a single TCP > connection and send a series of requests one after the other. See RFC > 2616 for more details. Yes i know... but read what i wrote above that sentence: >>this way you could have persistent connections (believe me it works I >>have tried it). I am not using this though. My current setup is just one >>request per tcp connection (the server wil just close it afther one >>request). sorry if this was confussing :P ( As a graduate student I do know my protocols) > It won't necessarily be SLLOOOWW; it depends what you're doing. If > you're using HTTP, you can use one of the many excellent HTTP servers > (e.g. mongrel, unicorn, rainbow to name a few), which contain C for the > most important code paths; or something like Phusion Passenger under > Apache or Nginx, which is basically an Apache module for running a Ruby > Rack app. (Rack is the pluggable way to write a fast low-level HTTP > service in Ruby) Yes you are totally right ! but it is not really the Ruby who is slow but the many sql database connections who are need by every request (see the attachment for a quick overview) this weekend I build the ESB and know for every adapter there is a port. this way I do know what is coming and i have the flexibility. (also because all the adapters are in threads. if one crashes the others don't! ) As soon as i have finished it in Ruby i will be making it opensource (of course ! ) .. though i don't think anybody would use such a complex system :P Thanxs Brian ! Attachments: http://www.ruby-forum.com/attachment/4486/ESB.png -- Posted via http://www.ruby-forum.com/.