jboss 5.1.0 GA JmsXA vs XAConnectionFactory
testrot Jun 17, 2010 6:27 AMHello,
although I read a lot of documentation and wiki pages, I still don't know when to use which ConnectionFactory. So here is my guess and I would be very grateful if somebody can confirm that this guess is right.
1) The connection factories definied in deploy\messaging\jms-ds.xml (default config only defines JmsXA) should be used for message producers inside EJBs (Session Beans, MDBs). If you use JmsXA, JMS operations are part of the transaction started by the Session Bean and the connections are pooled.
2) MDBs as message consumers automatically use JmsXA. (Where is the corresponding configuration or is it hard coded?)
3) The connection factories definied in deploy\messaging\connection-factories-services.xml (default config defines ConnectionFactory, XAConnectionFactory, ClusteredConnectionFactoroy and ClusteredXAConnectionFactory) should be used by external clients only.
If my guesses are right I still got two questions:
Q1) What is the meaning of the following 3 attributes in the JMSProviderLoader configuration (cf. jms-ds.xml)
<attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
<attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
<attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
obviously these attributes refer to the XAConnectionFactory defined in connection-factories-services.xml but for what reason? Are there situations in which the should point to ClusteredXAConnetionFactory?
Q2) Is the following comment obsolet (cf. jms-ds.xml)
<!--
The JMS provider loader. Currently pointing to a non-clustered ConnectionFactory. Need to
be replaced with a clustered non-load-balanced ConnectionFactory when it becomes available.
See http://jira.jboss.org/jira/browse/JBMESSAGING-843.
-->
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
<attribute name="ProviderName">DefaultJMSProvider</attribute>
[...]
Perhaps this question is already answered by the answer of Q1, but if the configuration in jms-ds.xml is only used by message consumers and producers inside the application server a failover in case of a cluster node failure would be nonsense because the client (the EJB) and the ConnectionFactory are running on the same cluster node and both fail at the same time.
Thanks for any help.