Hi,
On Mon, Mar 4, 2013 at 10:18 PM, Anqing Xu <
anqi...@gmail.com> wrote:
> Hi,
>
> I want to add some real time features to a web portal that is relatively
> well established. The server is JEE based and we use Websphere v7. The UI
> is mostly Ext JS based. In other words the team is pretty savvy with both
> java and javascript.
>
> Now we need to add some real time trading features to the platform and I
> need some advice on which technology to adopt. It seems that websocket is
> the future but I don't see websocket as a realistic option because my
> customer base is enterprise and enterprise mostly uses IE.
> It seems that websocket is only supported on IE 10 and it will take years
> for IE 10 to be widely adopted in enterprise. So I need a technology that
> fills the gap.
>
> After some study, I've narrowed down my choices to cometd and
socket.io. I'm
> new to both technologies. Here is my understanding:
>
> 1). Both cometd and
socket.io support websocket if both server and browser
> supports it. If not, they both have fallback options such as flex socket,
> long polling etc. They are not that different in the aspect.
>
> 2). On the server side, it seems that cometd goes well with jetty, maybe
> with Tomcat 7 which has asynchronous servlet support but definitely not
> Websphere 7. So I may have to switch to a totally different web server such
> as Jetty. We use both Websphere and Tomcat 7 in our environment and feel
> comfortable with both but Jetty is a different story although I'm sure we
> can get up to speed with Jetty if needed.
Yes. The concepts behind are the same, so it should not take long to
get up to speed with Jetty.
> Can I expect mission critical
> quality real time features if we use Cometd inside Tomcat 7? Or it is
> better to just go with Jetty + Cometd if I choose to go with Cometd?
Tomcat has shown so far a less robust Servlet 3 implementation, with
several bugs reported, just browse this list's archives for more
information.
Jetty has been really stable for years now (since Jetty has been the
introducer of the async servlet technology).
See benchmarks here:
http://webtide.intalio.com/2011/09/cometd-2-4-0-websocket-benchmarks/.
We're working on an updated benchmark with Jetty 9 and CometD 3, but
it will take some more time.
> 3). On the browser side, most of our customers use IE, either IE 7, IE 8 or
> IE 9. Can I expect REAL real time performance with IE since it does not
> support websocket? My understanding is that websocket needs both server and
> browser support. If I go with Jetty + cometd, which will support websocket
> on the server side, but if we browser is IE 8 or IE 9, what should I expect?
> I guess websocket is out, right?
Correct.
> What kind of performance should I expect?
> This is a real time financial trading system so it is really mission
> critical.
It depends a lot on how you have implemented the JS application that
runs on the browser.
I have seen implemented a number of tricks here: since you're dealing
with humans, if the price changes every 10 ms, there is no point in
sending updates every 10 ms: the human eye will not be able to see it.
Depending on the use case, you can send messages to clients every 500
ms or 1 second.
On server side, CometD has shown to be able to process hundreds of
thousands of messages per second without problems.
So it's not much the client side performance that you should worry
about... even IE7 is probably able to display 1-2 messages/s.
Depending on your numbers, you want to scale on server-side.
> 4). My understanding is that
socket.io is deployed in its own standalone
> node.js server. You can't embed it inside a JEE web server. The problem is
> that my platform is JEE based and I can't afford to rewrite everything in
> node.js.
I'm no expert in node.js, but at conferences it was kind of
interesting seeing node.js sessions presenting numbers like 1k users
at 100 messages/s, while we were presenting 100k users at 50k
messages/s.
Be totally sure that node.js scales for your needs - you might not
find what you expect.
--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.