Nov 6th, 2012, 01:38 PM
ActiveMQ Spring - Persistence
I am using Spring in conjunction with activemq. What happens when I turn activemq off in the middle of sending messages is that messages stop being published to the topic. This is understandable, however, the functionality that i am looking for is for the messages to be written to a file via persistence and then when the connection is re-established, the messages that were written to the file are sent to the consumer as well as the stream i am sending
I have the following code which allows me to send messages via activemq.
<bean id="myTopic" class="org.apache.activemq.command.ActiveMQTopic">
<property name="physicalName" value="feed.topic" />
<bean id="myConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFacto ry">
<property name="brokerURL" value="failover:tcp://localhost:61616" />
<bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="myConnectionFactory" />
<property name="defaultDestination" ref="myTopic" />
<bean id="sender" class="com.feed.publish.PublishMessages">
<property name="jmsTemplate" ref="myJmsTemplate" />
I somehow need to setup the persistance side of things, but i am unsure exactly how to do this? Does anyone no how or what modifications need to be done in my spring config file to allow this functionality?
Tags for this Thread