Yea, it is a simple in memory hash map configured from the environment. I was thinking of a new property, xa=true|false that could trigger the creation of an XA variant of the connection factory. I think doing XA by default may upset clients what check for an XA connection factory, transaction wrappers and the like. Can you raise a jira issue for this enhancement and attach your changes to that so that they are not lost.
On 18 March 2010 18:39, edan <edan_idze...@premierinc.com> wrote: > > > Gary Tully wrote: > > > > you need to change > > the > > > org.apache.activemq.jndi.ActiveMQInitialContextFactory.createConnectionFactory(Hashtable) > > method to optionally create an ActiveMQXAConnectionFactory > > I think it would be a sensible default but having a property that can > > ensure > > that a particular factory is xa would be a nice addition. > > have a look > > at > > > org.apache.activemq.jndi.ActiveMQInitialContextFactory.createConnectionFactory(String, > > Hashtable) to see the naming convention for how additional properties are > > specified. > > > > Thanks for the quick response, Gary! I think a stumbling block for me was > that I assumed the openwire connector had some magic JNDI code inside--I > didn't realize the JNDI connectionfactory lookup was really all on the > client side :) > > I didn't quite understand how to modify > ActiveMQInitialContextFactory.createConnectionFactory() to optionally > create > an ActiveMQXAConnectionFactory, though, since it returns an > ActiveMQConnectionFactory. Are you suggesting it could always return > ActiveMQXAConnectionFactory and let people cast it to a plain > ConnectionFactory when they don't want XA? > > My quick patch which seems to be working was to modify the > getInitialContext(environment) method to create a > ActiveMQXAConnectionFactory when the "name" from the environment equals > "XAConnectionFactory" and I copied the two createConnectionFactory() > methods > and made createXAConnectionFactory methods, so it looks like: > http://old.nabble.com/file/p27949733/ActiveMQInitialContextFactory.java > ActiveMQInitialContextFactory.java > > I suppose it would be less duplicated code to always return an > ActiveMQXAConnectionFactory, but I wasn't sure about that part. I'll think > about it some more, let me know what you think of my current hack ;) > > Thanks again. > -- > View this message in context: > http://old.nabble.com/ActiveMQ%27s-JNDI-does-not-resolve-XAConnectionFactory-tp27936255p27949733.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- http://blog.garytully.com Open Source Integration http://fusesource.com