I need to lookup a JMS connection factory from jndi
and inject the connection factory into another bean
(a JMS Template).
I can do this manually in Java; however, I'd like
to use j2ee:jndi-lookup bean configuration support.
I am not clear on how to use this from the Appendix
A2.3.1 of Spring tutorial.
This is what I have:
I would like to convert this to something like (I hope):Code:<bean id="jmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory" p:brokerURL="tcp://localhost:61616" /> <bean id="messageDispatchTemplate" class="org.springframework.jms.core.JmsTemplate" p:connectionFactory-ref="jmsFactory" />
I am assuming that the syntax I have given the second snippet aboveCode:<jee:jndi-lookup id="jmsFactory" jndi-name="jms/AmqConnectionFactory"/> <bean id="messageDispatchTemplate" class="org.springframework.jms.core.JmsTemplate" p:connectionFactory-ref="jmsFactory" />
is approximate - if this syntax would work as is, I'd be delighted;
of course, in this case, I would like to know how Spring figures
out the type of "jmsFactory".
Any suggestions?
Thanks,
/U


Reply With Quote