camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiram Chirino" <hi...@hiramchirino.com>
Subject Re: How camel resolve JNDI End point
Date Thu, 04 Oct 2007 13:54:16 GMT
Hi Bob,

I just committed a change so that the DestiantionResolver property is
supported on the camel JMS component.  So once you pick up that
updated.  You should be able to do the following:

<beans>
       <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
               <property name="packages" value="com.abc.poc.camel.jms"/>
       </bean>

       <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
          <property name="connectionFactory"
ref="internalJmsQueueConnectionFactory"/>
          <property name="destinationResolver" ref="jmsDestinationResolver"/>
       </bean>

       <!-- JMS Destination Resolver -->
      <bean id="jmsDestinationResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver">
       <property name="jndiTemplate" ref="jndiTemplate"/>
       <property name="cache" value="true"/>
      </bean>

      <!-- JMS Queue Connection Factory -->
      <bean id="internalJmsQueueConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
       <property name="jndiTemplate" ref="jndiTemplate"/>
       <property name="jndiName"> <value>jms/myConFactory</value>  </property>
      </bean>

      <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
               <property name="environment">
                       <props><prop key="java.naming.factory.initial">

com.ibm.websphere.naming.WsnInitialContextFactory
                               </prop>
                       </props>
               </property>
       </bean>
</beans>

I have also made the JMS component support auto wiring the
destinationResolver property so that the above example should also
work even if you don't define the "jms" component explicitly.  But I
figure being explicit is sometimes more clear.

Please let me know if this fixes it for you.

On 10/4/07, Bob G. <aerosteak@hotmail.com> wrote:
>
> Hello
>
> I am trying to configure Camel to use JMS end point into Websphere 6.1
> (was). My end point cannot be found because of some Spring JNDI lookup
> problem.
>
> Some question :
> -  How do I tell Camel to use my Spring JndiTemplate or
> JndiDestinationResolver so that my jms queue will be resolved properly?
>
> In the documentation, it says that Camel uses Spring JmsTemplate. How can I
> tell Camel to use my JmsTemplate configured for Websphere?
>
> There is my config:
>
> <beans>
>         <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
>                 <property name="packages" value="com.abc.poc.camel.jms"/>
>         </bean>
>
>
>          <!-- ?? My JmsTemplate is not injected or Used in any Camel Classes ?? -->
>         <bean id="jmsQueueTemplate"
> class="org.springframework.jms.core.JmsTemplate">
>           <property name="connectionFactory"
> ref="internalJmsQueueConnectionFactory"/>
>           <property name="destinationResolver" ref="jmsDestinationResolver"/>
>           <property name="pubSubDomain"> <value>false</value>  </property>
>           <property name="receiveTimeout"> <value>20000</value> </property>
>         </bean>
>
>     <!-- JMS Destination Resolver -->
>     <bean id="jmsDestinationResolver"
> class="org.springframework.jms.support.destination.JndiDestinationResolver">
>         <property name="jndiTemplate" ref="jndiTemplate"/>
>         <property name="cache" value="true"/>
>     </bean>
>
>   <!-- JMS Queue Connection Factory -->
>   <bean id="internalJmsQueueConnectionFactory"
> class="org.springframework.jndi.JndiObjectFactoryBean">
>         <property name="jndiTemplate" ref="jndiTemplate"/>
>     <property name="jndiName"> <value>jms/myConFactory</value>  </property>
>   </bean>
>
>   <bean id="jndiTemplate"               class="org.springframework.jndi.JndiTemplate">
>                 <property name="environment">
>                         <props><prop key="java.naming.factory.initial">
>                                         com.ibm.websphere.naming.WsnInitialContextFactory
>                                 </prop>
>                         </props>
>                 </property>
>         </bean>
> </beans>
>
>
> Thank you.
>
>
> --
> View this message in context: http://www.nabble.com/How-camel-resolve-JNDI-End-point-tf4568653s22882.html#a13039322
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Mime
View raw message