如何配置spring与activemq持久性消息存储数据库
1个回答
展开全部
<!-- ActiveMQ destinations to use -->
<amq:queue id="destination" physicalName="org.apache.activemq.spring.Test.spring.embedded"/>
<!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
<amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
<!-- Spring JMS Template -->
<bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory">
<!-- lets wrap in a pool to avoid creating a connection per send -->
<bean class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory">
<ref local="jmsFactory"/>
</property>
</bean>
</property>
<property name="defaultDestination">
<ref local="destination"/>
</property>
<property name="messageConverter" ref="messageConverter"/>
<amq:queue id="destination" physicalName="org.apache.activemq.spring.Test.spring.embedded"/>
<!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
<amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
<!-- Spring JMS Template -->
<bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory">
<!-- lets wrap in a pool to avoid creating a connection per send -->
<bean class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory">
<ref local="jmsFactory"/>
</property>
</bean>
</property>
<property name="defaultDestination">
<ref local="destination"/>
</property>
<property name="messageConverter" ref="messageConverter"/>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询