Does anyone know if it is feasible to write a Generic JMS client – ie. one that works with JMS from different providers (eg. Sonic, IBM SIB, Jboss etc)?
Every time I’ve written JMS client code it is always very implementation specific with dependent JARs and Context classes.
Thanks.
Well, one best practice (at least for me) is to use the non-arg
InitialContextconstructor and to put provider specific stuff (like the initial context factory and the provider url) in ajndi.propertiesfile on the class path instead of hard coding these things. You’ll also need to put the “right” JMS provider JARs on the class path.In other words, you can have generic code but you still need to configure the runtime environment (unless you run your client code in a container like Spring).