activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Biscuit128 <>
Subject Can't make topic persistent
Date Tue, 06 Nov 2012 17:29:44 GMT

I am using Spring in conjunction with activemq. What happens when I turn
activemq off in the middle of sending messages is that messages stopped
being publiched 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 before
accepting the new messages that 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"
	<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, and have seen a
tutorial on your website which shows something like this;

<amq:broker useJmx="true" persistent="true" brokerName="localhost">
        <amq:kahaPersistenceAdapter directory="activemq-data"
            maxDataFileLength="33554432" />
        <amq:transportConnector name="vm" uri="vm://localhost" />

but i am unsure exactly how i merge the two approaches. Would it be possible
to get some help and advice please?


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message