Hi Thanks for sharing your solution.
On Mon, May 7, 2012 at 10:34 PM, bxkrish <[email protected]> wrote: > Hi Claus, > > Apologies for the delayed reply. > > 1. For your second comment, "sometimes in Services industry we can only > recommend a particular software to our customers, however we have to settle > with what is available in hand at the customer/client place." > > 2. Your first comment was helpful to make my search better on the internet. > I am posting the Spring configurations and Custom Bean (should be in the > classpath) for someone that comes across this topic. > > > > <bean id="jms" class="org.apache.camel.component.jms.JmsComponent"> > <property name="connectionFactory" ref="mqConnectionFactory"/> > </bean> > > <bean id="mqConnectionFactory" > factory-bean="customFactoryBean" > factory-method="createConnectionFactory"> > </bean> > > <bean id="customFactoryBean" class="my.package.OpenMQFactoryBean"> > <property name="configuration"> > <props> > <prop key="imqAddressList">HOST:PORT</prop> > <prop key="imqDefaultPassword">username</prop> > <prop key="imqDefaultUsername">password</prop> > </props> > </property> > </bean> > > Custom Bean > > import java.util.Properties; > import javax.jms.JMSException; > import com.sun.messaging.ConnectionFactory; > > public class OpenMQFactoryBean { > > private Properties configuration; > > public void setConfiguration(Properties configuration) { > this.configuration = configuration; > } > > public ConnectionFactory createConnectionFactory(){ > com.sun.messaging.ConnectionFactory cf = new > com.sun.messaging.ConnectionFactory(); > try{ > for(Object key: configuration.keySet()){ > cf.setProperty((String) key, (String) > configuration.get(key)); > } > } catch (JMSException e){ > throw new RuntimeException("Error configuring > ConnectionFactory", e); > } > return cf; > } > } > > Thanks. > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Apache-Camel-Integration-with-Open-MQ-Glassfish-tp5678620p5692096.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
