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.

Reply via email to