[RF4.3.1] A4j:push/atmosphere recommandations about TopicKey creation, configuration, resources?
jadtn Mar 9, 2013 11:38 AMHi,
I don't found information in Richfaces Developper Guide or Component Reference about how many threads are used when you create a Topic a supbtopic or what are the recommandations usage or configuration for a4j:push.
I'm 'reserved'/'anxious' about the resources (threads...) that the push (atmosphere) can take on the jvm .
0/Context
Environnement :
Versions : RF4.3.1Final and JBoss 7.
'Simple' push in pure JSF ( no jms, no cdi)
Configuration by default of richfaces
To clarify my usage of a4j: push, and it is more easy to take a use case : I use a4j:push for a private chat, like 'msn' (the chat is not based 'on room' but private conversation).
So, currently, I use 1 TopicKey per user (or session): each user in his chat popup receive all his messages.
1/Threads resources
a) 1 TopicKey by user / session
Actually I create 1 TopicKey for each user (session ), each TopicKey is listen only by one user .
{code}
//somewhere in a SESSION bean for the user x
TopicsContext topicsContext=TopicsContext.lookup();; //class attribute in session backbean
TopicKey topicKey = new TopicKey(jsessionid);//class attribute in session backbean
//...
public void sendMessage(String message){
topicsContext.publish(jsessionid,message);
}
{code}
If I ve 500 users connected (500 TopicKey) : how many Threads (richfaces + atmosphere) will use be?
How richfaces map a Topic in atmosphere?
b)Vs 1 subTopic by user / session and 1 Topic for the 'chat'
If I create 1 Topic for t
{code}
//somewhere at APPLICATION LEVEL:
TopicsContext topicsContext=TopicsContext.lookup();;//class attribute in a application backbean
TopicKey topicKey = new TopicKey("rootChat");//class attribute in a application backbean
//And somewhere in a SESSION bean for the user x
TopicsContext topicsContext=TopicsContext.lookup();;//class attribute in session backbean
TopicKey topicKey = new TopicKey("rootChat@"+jsessionid); //class attribute in session backbean
//
//...
public void sendMessage(String message){
topicsContext.publish("rootChat@"+jsessionid,message);
}
{code}
How many threads this will take in this case (richfaces + atmosphere) ? Less ?
c)Configuration
I've found some link about atmosphere configuration, but, it is need to do something with richfaces?
- https://github.com/Atmosphere/atmosphere/wiki/Configuring-Atmosphere-for-Performance
- Preventing out of memory: https://github.com/Atmosphere/atmosphere/wiki/Understanding-Broadcaster
Thanks for any remarks, critics, or response :-)
Adrien