[jboss-user] [EJB 3.0] - Re: Newbie: how to interface EJB code with external librarie
Nopik
do-not-reply at jboss.com
Sat Aug 9 17:30:13 EDT 2008
First of all, thanks for the reply, it has been insightful, really.
Unfortunately it do not answer my main concern - how to interface with external libraries. In meantime I am progressing with reading the mentioned book, and I am after chapter describing JMS basics. I thought, that it provides solution to my problem.. I was thinking about something like this:
Right now I do link with some external jar and create one of its objects, lets call it Server. This object does internally open some sockets, run threads and so on, all hidden from me. Then, I register listener on its events and eventually start receive events by my listeners. In meantime I call some methods there to invoke some operations. While I call like up to 100 methods per second, I need to receive like 1000+ events per second, all from external thread.
Now, how should I approach this specific problem (being abstract from jsf etc. for a moment)?
I thought I will use JMS. Actually, it do give me all required functionality. I just create two message channels and create standalone application outside of JBoss to interface with my library. The events from the lib will be converted to JMS message, so would be my calls (well, ok I would end up reinventing RMI, nevermind, in theory I would be able to call RMI one side and get JMS in the other direction). But, when I made some quick tests (based on exercises from the book), the amount of overhead is overwhelming (well, 2 separate java vm processes communicating via tcp cannot be so fast): I was able to process like 40 messages per second on my machine. So, about 20-30 times slower than I need. Not to mention, that current, 'native', solution does not use more than 10% cpu... So, is there any better way of solving my problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169742#4169742
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169742
More information about the jboss-user
mailing list