33 xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
44 xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd" >
55
6- <bean id =" messageDestination" class =" org.apache.activemq.command.ActiveMQQueue" >
7- <constructor-arg value =" messageQueue1" />
8- </bean >
9- <bean id =" jmsTemplate" class =" org.springframework.jms.core.JmsTemplate" >
10- <property name =" connectionFactory" ref =" connectionFactory" />
11- <property name =" receiveTimeout" value =" 10000" />
12- </bean >
13-
6+ <bean id =" amqConnectionFactory" class =" org.apache.activemq.ActiveMQConnectionFactory" >
7+ <constructor-arg index =" 0" value =" tcp://localhost:61616" />
8+ </bean >
9+
10+ <!-- ConnectionFactory Definition -->
11+ <bean id =" connectionFactory"
12+ class =" org.springframework.jms.connection.CachingConnectionFactory" >
13+ <constructor-arg ref =" amqConnectionFactory" />
14+ </bean >
15+
16+ <bean id =" destinationQueue" class =" org.apache.activemq.command.ActiveMQQueue" >
17+ <constructor-arg index =" 0" value =" IN_QUEUE" />
18+ </bean >
19+
20+ <!-- JmsTemplate Definition -->
21+ <bean id =" jmsTemplate" class =" org.springframework.jms.core.JmsTemplate" >
22+ <property name =" connectionFactory" ref =" connectionFactory" />
23+ <property name =" defaultDestination" ref =" destinationQueue" />
24+ </bean >
1425 <bean id =" SampleJmsMessageSender" class =" com.baeldung.spring.jms.SampleJmsMessageSender" >
15- <property name =" destination " ref =" messageDestination " />
26+ <property name =" queue " ref =" destinationQueue " />
1627 <property name =" jmsTemplate" ref =" jmsTemplate" />
1728 </bean >
1829
2334 <bean id =" jmsContainer"
2435 class=" org.springframework.jms.listener.DefaultMessageListenerContainer" >
2536 <property name =" connectionFactory" ref =" connectionFactory" />
26- <property name =" destination " ref = " messageDestination " />
37+ <property name =" destinationName " value = " IN_QUEUE " />
2738 <property name =" messageListener" ref =" messageListener" />
28- <property name =" jmsTemplate" ref =" jmsTemplate" />
2939 </bean >
30- </beans >
40+ </beans >
0 commit comments