You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Hiram Chirino <hi...@hiramchirino.com> on 2007/11/04 21:55:34 UTC

Looking for feed back on AMQNET-75: Enhance NMSFactory so that it's config is not hard coded.

Hi Guys,

If you get a chance coudl you review that patches I've attached to AMQNET-75:
https://issues.apache.org/activemq/browse/AMQNET-75

I 've modified the NMSFactory class so that it dynamically looks up
the right implementation of IConnectionFactory of a given Uri scheme.
NMS implementations just need to create a specially crafted resource
file that the NMSFactory  will look for.  This is very similar to the
META-INF service discovery stuff we do with the Java stuff.  Please
let me know what you think.

An additional enhancement, I made NMSFactory implement
IConnectionFactory and it just delegates to the actual implementation
discovered.  So most folks just need to do stuff like:

factory = new NMSFactory("tcp://localhost:616161");
factory.CreateConnection();

But they want to modify the factory properties they can still access
that delegate via the ConnectionFactory property:

factory = new NMSFactory("tcp://localhost:616161");
((Apache.NMS.ActiveMQ.ConnectionFactory)factory.ConnectionFactory).ClientId
= "foo";
factory.CreateConnection();

Also, it seems to me that a better name for NMSFactory is
NMSConnectionFactory.  Anybody mind a rename?


-- 
Regards,
Hiram

Blog: http://hiramchirino.com