You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by alexandry <gr...@gmail.com> on 2012/01/26 13:11:22 UTC

how to enable persistent message store?

Hi, i trying to figure out how to enable persistent storage at ActiveMQ.
My configuration say  <broker xmlns="http://activemq.apache.org/schema/core"
brokerName="firstbroker" dataDirectory="${activemq.base}/data" 
persistent="true"> that it should be persistent.

But in following scenario it not seems to be persistent (i am at FreeBSD)
1. I start ActiveMQ (/usr/local/etc/rc.d/activemq forcerestart)
2. now i send message to it and confirm it it sent.
3. restart ActiveMQ (/usr/local/etc/rc.d/activemq forcerestart)
4. check ActiveMQ to see if it has frame to read and it return false.

I check the permissions on kanadb and is all seems good. But all messages
erased after ActiveMQ restart

--
View this message in context: http://activemq.2283324.n4.nabble.com/how-to-enable-persistent-message-store-tp4330162p4330162.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: how to enable persistent message store?

Posted by alexandry <gr...@gmail.com>.
Thank you!
i was try it before, but it was not working.
To whom it can be interested correction is to submit 'true' as string at
php, not as boolean value.
So headers will look like $headers = array('persistent' => 'true');  not
$headers = array('persistent' => true);
May be that will safe time to someone other.

--
View this message in context: http://activemq.2283324.n4.nabble.com/how-to-enable-persistent-message-store-tp4330162p4333191.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: how to enable persistent message store?

Posted by "Martin C." <ma...@gmx.at>.
Hi,

expiration and persistence are something different. A persistent
message can still expire, a non-expiring message can still be
non-persistent.

The difference is: if a message is persistent, it will be available
even if the broker restarts, if a message has an expiration, it will
be deleted if the expiration time is found.

Regarding STOMP and persistence, have a look at
http://activemq.apache.org/stomp.html: there is stated that:
Persistence of Stomp messages
By default, Stomp produced messages are set to non-persistent. You
have to explicitly tell your Stomp library to add "persistent:true" to
all SEND requests, for any messages that you want to persist across
ActiveMQ restarts. This is the opposite of the default for JMS
submitted messages.

Best regards,
Martin

On Fri, Jan 27, 2012 at 9:54 AM, alexandry <gr...@gmail.com> wrote:
>
> http://activemq.2283324.n4.nabble.com/file/n4332902/test_s.php test_s.php
> http://activemq.2283324.n4.nabble.com/file/n4332902/activemq.xml
> activemq.xml
>
> Here is my script at php and activemq.xml config file.
> to run at php to send message i do "php test_s.php send", to read what can
> be read "php test_s.php"
> so stack of commands look like:
> php test_s.php send //send message to queue
> php test_s.php  //confirm it still in queue
> /usr/local/etc/rc.d/activemq forcerestart //fully restart activemq
> php test_s.php // now message is not here.
>
> I am newbe to ActiveMQ, but at headers message showed as expired:0 (assume
> it mean it will never expire), and when i try to set additinal headers to
> send message like 'persistent => true' it not take any effect.
> And all what i was found about persistent is lot of manuals how to make it
> NOT persistent, so i assume it should be persistent by default. But seems to
> not work with me.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/how-to-enable-persistent-message-store-tp4330162p4332902.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: how to enable persistent message store?

Posted by alexandry <gr...@gmail.com>.
http://activemq.2283324.n4.nabble.com/file/n4332902/test_s.php test_s.php 
http://activemq.2283324.n4.nabble.com/file/n4332902/activemq.xml
activemq.xml 

Here is my script at php and activemq.xml config file.
to run at php to send message i do "php test_s.php send", to read what can
be read "php test_s.php"
so stack of commands look like:
php test_s.php send //send message to queue
php test_s.php  //confirm it still in queue
/usr/local/etc/rc.d/activemq forcerestart //fully restart activemq
php test_s.php // now message is not here.

I am newbe to ActiveMQ, but at headers message showed as expired:0 (assume
it mean it will never expire), and when i try to set additinal headers to
send message like 'persistent => true' it not take any effect.
And all what i was found about persistent is lot of manuals how to make it
NOT persistent, so i assume it should be persistent by default. But seems to
not work with me.

--
View this message in context: http://activemq.2283324.n4.nabble.com/how-to-enable-persistent-message-store-tp4330162p4332902.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: how to enable persistent message store?

Posted by Gary Tully <ga...@gmail.com>.
persistence is an attribute of each message, how are you sending the messages?
And you need to be sending to a queue or use durable subscriptions on a topic.

have a go with the examples, ant consumer, and producer to get started.

On 26 January 2012 12:11, alexandry <gr...@gmail.com> wrote:
> Hi, i trying to figure out how to enable persistent storage at ActiveMQ.
> My configuration say  <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="firstbroker" dataDirectory="${activemq.base}/data"
> persistent="true"> that it should be persistent.
>
> But in following scenario it not seems to be persistent (i am at FreeBSD)
> 1. I start ActiveMQ (/usr/local/etc/rc.d/activemq forcerestart)
> 2. now i send message to it and confirm it it sent.
> 3. restart ActiveMQ (/usr/local/etc/rc.d/activemq forcerestart)
> 4. check ActiveMQ to see if it has frame to read and it return false.
>
> I check the permissions on kanadb and is all seems good. But all messages
> erased after ActiveMQ restart
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/how-to-enable-persistent-message-store-tp4330162p4330162.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com