-
1. Re: Port Listener Services on JBoss
dimitris Feb 23, 2005 4:39 AM (in response to sandeep_multani)With that number of threads/requests you'll almost certainly need a thread pool.
I don't think there is some "official" JBoss API exposed for this kind of stuff, but you could use as starting points:
common/src/main/org.jboss.util.threadpool.BasicThreadPool.java
This is a re-usable simple thread pool implementation. It is used, for example, by:
naming/src/main/org/jnp/server/Main, NamingServer.java
which is the embedded JNDI naming server running within JBoss.
You'll need a basic undestanding of loading your own services in JBoss as MBeans, so read the 2nd chapter of the JBoss Documentation.
Usually, there is a lot of useful information in the wiki, as well, eg:
http://www.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX
Good luck -
2. Re: Port Listener Services on JBoss
sandeep_multani Feb 23, 2005 5:04 AM (in response to sandeep_multani)Thanx for the thread pool thing.... Little help with connection to the port part and integration of the service as a JBoss service would be highly appreciated ...
-
3. Re: Port Listener Services on JBoss
opiegai Feb 24, 2005 2:52 AM (in response to sandeep_multani)With 5000 simultaneous connections/threads, I guess you'll kill every os! This is why java NIO selector was introduced - you'll have a small thread pool (10) to handle the connections.
-
4. Re: Port Listener Services on JBoss
sandeep_multani Feb 24, 2005 4:41 AM (in response to sandeep_multani)We will be implementing this as a clustered app ... i think that should be capable of that kind of load(5000 connections) ... any ideas ?
-
5. Re: Port Listener Services on JBoss
dimitris Feb 24, 2005 4:47 AM (in response to sandeep_multani)You need to clarify the reasons you want your application to be clustered. Clustering for high availability usually reduces performance due to state replication among cluster nodes. What you need is probably load balancing, but again you need to decide if there is any shared state. In many cases the whole thing depends on the access protocol (http, rmi, other?) and your use cases...
-
6. Re: Port Listener Services on JBoss
dimitris Feb 28, 2005 4:33 PM (in response to sandeep_multani)You may also want to have a look at the JBoss remoting framework.
-
7. Re: Port Listener Services on JBoss
leonardosalvatore Apr 21, 2005 10:42 AM (in response to sandeep_multani)For thread pool i suggest you to try
pool = Executors.newCachedThreadPool();
or
pool = Executors.newFixedThreadPool(poolSize);
You have to implement class Handler implements Runnable
and
serverSocket = new ServerSocket(port);
pool.execute(new Handler(serverSocket.accept()));
For network communication i also suggest you Jgroups 2