-
1. Re: Best practice for managing connections in JMS Publishers
clebert.suconic Jun 18, 2008 10:37 AM (in response to sonicfab)I read on the Wiki that the JCA-managed connection factory caches connections, so is it ok to simply open and close a connection for each message ?
It is okay if you use JmsXA which is the JCA adapter for JMS, but if you use a regular JMS Connection if you open/close your connection on every send you will have serious performance problems.
I don't know any links.. (besides what you would find with a google search on wiki.jboss.org). But this caching thing is pretty much what I can think now as a best practice on Connections.
I believe you will find a FAQ on JBM about Spring, as it produces messages by closing and opening a JMS connection on every send. -
2. Re: Best practice for managing connections in JMS Publishers
sonicfab Jun 18, 2008 10:44 AM (in response to sonicfab)Thanks Clebert.
How do I make sure I am using that JCA based connection factory ?
Is its JNDI name java:/JmsXA ?
Does the JNDI name ConnectionFactory map to it ? -
3. Re: Best practice for managing connections in JMS Publishers
clebert.suconic Jun 18, 2008 10:49 AM (in response to sonicfab)You just have to use java:/JmsXA in your JNDI (I'm not sure about the JNDI URL in top of my head now, please google for the right one :-) )
The JCA is defined by the JCA adapter, usually on jms-ds.xml (unless you changed it in your config).
Look for this:<tx-connection-factory> <jndi-name>JmsXA</jndi-name> <xa-transaction/> <rar-name>jms-ra.rar</rar-name> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property> <max-pool-size>20</max-pool-size> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory>
-
4. Re: Best practice for managing connections in JMS Publishers
timfox Jun 18, 2008 1:32 PM (in response to sonicfab)Pretty much all the info you have asked for is available on the wiki. Please have a look.
-
5. Re: Best practice for managing connections in JMS Publishers
sonicfab Jun 19, 2008 7:01 AM (in response to sonicfab)I did check out the Wiki AND the JBM documentation, but there are still some open points for me.
The page that discusses the issue of JmsTemplates and connection open/close says to use the JCA-managed connection factory with JNDI name java:/JmsXA.
(http://wiki.jboss.org/wiki/JBMSpringJMSTemplateNotes).
Now, when I look at chapter 6.7 of the JBM user guide (http://www.jboss.org/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.4.0.SP3/html/configuration.html#conf.connectionfactory), it mentions JNDI names ConnectionFactory and XAConnectionFactory, but says nothing about whether these global namespace JNDI names actually map or not to a JCA-managed connection factory such as java:/JmsXA.