[jboss-dev-forums] [JBoss ESB Development] New message: "Re: Smooks problem"

Maurice Zeijen do-not-reply at jboss.com
Wed Jan 20 02:19:16 EST 2010


JBoss development,

A new message was posted in the thread "Smooks problem":

http://community.jboss.org/message/520978#520978

Author  : Maurice Zeijen
Profile : http://community.jboss.org/people/mzeijen

Message:
--------------------------------------------------------------
Hi Gilles,
 
I am glad that you solved the problem and that there is no bug in the Smooks Persistence code .
 
*One important note:* I see in you code that you create a new Smooks instance for every message. This is a performance killer. You should make the Smooks a field of the GillesSmooksAction object and instantiate it in the '*http://www.jboss.org/jbossesb/docs/4.7/javadoc/esb/org/jboss/soa/esb/actions/AbstractActionLifecycle.html#initialise%28%29*' method. Then don't forget to close the Smooks object in the '*http://www.jboss.org/jbossesb/docs/4.7/javadoc/esb/org/jboss/soa/esb/actions/AbstractActionLifecycle.html#destroy%28%29*() ' method. The Smooks object is thread safe, however the ExecutionContext not. So the ExectionContext needs to be created in the 'process' method, but that is very cheap. For more tips to boost the performance of Smooks take a look here: http://www.smooks.org/mediawiki/index.php?title=V1.2:Smooks_v1.2_User_Guide#Performance_Tuning. If you process a lot of messages concurrently then you should certainly upgrade to the latest 1.2 version of Smooks and use the new feature to pool the reader instances. You need to create a pool with the same size as the number of threads that are used to execute the action.
 
Regards,
 
Maurice

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/520978#520978




More information about the jboss-dev-forums mailing list