You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jumbro <ju...@fortress.com> on 2010/03/17 21:02:36 UTC

AMQ persistence not working for me

Hello,

I have been trying to get persistence working and have been humbled by the
experience.

Here is my setup:

* AMQ 5.3
* Monitoring via AMQ web console deployed in jetty
* Using Spring.NET 1.2 / Apache.NMS
* Tried each of the available AMQ persistence schemes (see attached
activemq.xml)
* Set both NmsTemplate.Persistent = true and
Apache.NMS.Message.NMSPersistent = true on the producer
* My preference is to use  journaledJDBCAdaptor against Sql Server 2008

Test performed:
* start AMQ
* start my message producer (creates dynamic topic by default)
* observe messages enqueued to topic via web console
* stop and start AMQ

Here are the issues I'm having (consider journaledJDBC case):

1) I first noticed that nothing appears to be getting written to my journal
2) When restarting AMQ, the output tells me (when starting the journal
persistence adapter): "Journal Recovered: 0 message(s) in transactions
recovered" http://old.nabble.com/file/p27937557/activemq.xml activemq.xml 
3) When AMQ restarts, the topic and messages have been deleted

I did do some tests (days/weeks ago) where I saw some messages being logged
to Sql Server. But at no time did I have a successful test of recycling AMQ
and seeing the existing queue/topic with pending messages populated.

Live message production/consumption works great for me, both pub/sub and
request reply. I just can't get persistence working. Please help!

activemq.xml attached.

thanks in advance.
jonah




-- 
View this message in context: http://old.nabble.com/AMQ-persistence-not-working-for-me-tp27937557p27937557.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: AMQ persistence not working for me

Posted by jumbro <ju...@fortress.com>.
Aha!!! This finally makes it clear...

I had durable subscription working a week or two ago. But I had never tested
the "persistence" piece of that, i.e. taking the broker down with unconsumed
messages on a topic which has a registered durable subscriber. I just did
that test and see that it works!

I researched persistence vs. durable subscription a couple weeks back, and
thought I fully understood the distinction. The missing piece for me was
this "persistence test" which I see now is configured slightly differently
depending on whether you're working with topics (durable subscribers) or
queues (persistent producers).

Thank you very much for the education. Hopefully this thread will save
someone else some time and frustration!



bsnyder wrote:
> 
> On Thu, Mar 18, 2010 at 12:15 PM, jumbro <ju...@fortress.com> wrote:
>>
>> I just tested persistence using a QUEUE and... it works!
>>
>> So my question is: do topics offer this same functionality? If not, then
>> why?
>>
>> If topics do support persistence, then I'm still missing something..
> 
> Topics support durability which is slightly different. But with
> topics, messages will only be persisted if a durable subscription
> exists on the topic. Below is a description of durability vs.
> persistence that I wrote for chapter 2
> of the forthcoming ActiveMQ In Action book:
> 
> Two points within JMS that are often confused are message durability
> and message persistence. Though they are similar, there are some
> semantic differences but each has its specific purpose. Message
> durability can only be achieved with the pub/sub domain. When clients
> connect to a topic, they can do so using a durable or a non-durable
> subscription. Consider the differences between the two:
> 
> Durable Subscription - A durable subscription is infinite. It is
> registered with the topic to tell the JMS provider to preserve the
> subscription state in the event that the subscriber disconnects. If a
> durable subscriber disconnects, the JMS provider will hold all
> messages until that subscriber connects again.
> 
> Non-Durable Subscription - A non-durable subscription is finite. It's
> subscription state is not preserved by the JMS provider in the event
> that the subscriber disconnects. If a subscriber disconnects, it
> misses all messages during the disconnection period and the JMS
> provider will not hold them.
> 
> Message persistence is independent of the message domain. Message
> persistence is a quality of service property used to indicate the JMS
> application's ability to handle missing messages in the event of a JMS
> provider failure.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder
> 
> 

-- 
View this message in context: http://old.nabble.com/AMQ-persistence-not-working-for-me-tp27937801p27949953.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ persistence not working for me

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, Mar 18, 2010 at 12:15 PM, jumbro <ju...@fortress.com> wrote:
>
> I just tested persistence using a QUEUE and... it works!
>
> So my question is: do topics offer this same functionality? If not, then
> why?
>
> If topics do support persistence, then I'm still missing something..

Topics support durability which is slightly different. But with
topics, messages will only be persisted if a durable subscription
exists on the topic. Below is a description of durability vs.
persistence that I wrote for chapter 2
of the forthcoming ActiveMQ In Action book:

Two points within JMS that are often confused are message durability
and message persistence. Though they are similar, there are some
semantic differences but each has its specific purpose. Message
durability can only be achieved with the pub/sub domain. When clients
connect to a topic, they can do so using a durable or a non-durable
subscription. Consider the differences between the two:

Durable Subscription - A durable subscription is infinite. It is
registered with the topic to tell the JMS provider to preserve the
subscription state in the event that the subscriber disconnects. If a
durable subscriber disconnects, the JMS provider will hold all
messages until that subscriber connects again.

Non-Durable Subscription - A non-durable subscription is finite. It's
subscription state is not preserved by the JMS provider in the event
that the subscriber disconnects. If a subscriber disconnects, it
misses all messages during the disconnection period and the JMS
provider will not hold them.

Message persistence is independent of the message domain. Message
persistence is a quality of service property used to indicate the JMS
application's ability to handle missing messages in the event of a JMS
provider failure.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Re: AMQ persistence not working for me

Posted by jumbro <ju...@fortress.com>.
I just tested persistence using a QUEUE and... it works!

So my question is: do topics offer this same functionality? If not, then
why?

If topics do support persistence, then I'm still missing something..



jumbro wrote:
> 
> I traced the message send within Spring.net. Setting
> NmsTemplate.Persistent = true propagates that property to the
> MessageProducer. I also set NmsTemplate.ExplicitQosEnabled = true which
> leads to:
> 
> producer.Send(message, persistent, priority, timeToLive);
> 
> where producer is an Apache.NMS.ActiveMQ.MessageProducer.
> 
> I've observed persistent to be true to this stage. This really should
> work. Based on this, it would seem that the problem lives within the
> Apache.NMS code (seems unlikely but I'm running out of ideas). The next
> step seems to be adding Apache.NMS source to my solution and debugging
> further... 
> 
> Thanks for offering your help. Any more suggestions are welcomed!
> 
> 
> 
> Timothy Bish wrote:
>> 
>> On Thu, 2010-03-18 at 08:55 -0700, jumbro wrote:
>>> Thanks for your reply.
>>> 
>>> I tested your suggestion and it works. I see now that it's the producer
>>> that
>>> determines the persistence.
>>> 
>>> Do you know off hand how to configure this same behavior using Spring?
>>> I'm
>>> using the NmsTemplate and allowing Spring to manage the underlying
>>> messaging
>>> context. I'm setting NmsTemplate.Persistent = true. I expected that to
>>> do
>>> it, but no dice. 
>> 
>> I'd expect that to work but I don't know much about the NmsTemplate so
>> I'd have to look at their source.  What version are you using and what
>> version of NMS and NMS.ActiveMQ does it include?
>> 
>>> 
>>> I also tested setting NMSPersistent = true like this:
>>> 
>>> ...
>>> template.ConvertAndSendWithDelegate(requestMessage, delegate(IMessage
>>> message)
>>>                 {
>>>                     message.NMSPersistent = true;
>>>                     return message;
>>>                 });
>> 
>> Setting the property on the message will have no effect as it going to
>> be overwritten by the MessageProducer during the send operation.  To
>> override the producer you need to call the MessageProducer send method
>> that accepts a deliveryMode parameter.  
>> 
>> Regards
>> Tim.
>> 
>>> 
>>> but that didn't do it either.
>>> 
>>> I'm going to look into it further now, but if you have the answer that
>>> would
>>> be outstanding.
>>> 
>>> Thanks again.
>>> 
>>> 
>>> bsnyder wrote:
>>> > 
>>> > On Wed, Mar 17, 2010 at 2:02 PM, jumbro <ju...@fortress.com> wrote:
>>> >>
>>> >> Hello,
>>> >>
>>> >> I have been trying to get persistence working and have been humbled
>>> by
>>> >> the
>>> >> experience.
>>> >>
>>> >> Here is my setup:
>>> >>
>>> >> * AMQ 5.3
>>> >> * Monitoring via AMQ web console deployed in jetty
>>> >> * Using Spring.NET 1.2 / Apache.NMS
>>> >> * Tried each of the available AMQ persistence schemes (see attached
>>> >> activemq.xml)
>>> >> * Set both NmsTemplate.Persistent = true and
>>> >> Apache.NMS.Message.NMSPersistent = true on the producer
>>> >> * My preference is to use  journaledJDBCAdaptor against Sql Server
>>> 2008
>>> >>
>>> >> Test performed:
>>> >> * start AMQ
>>> >> * start my message producer (creates dynamic topic by default)
>>> >> * observe messages enqueued to topic via web console
>>> >> * stop and start AMQ
>>> >>
>>> >> Here are the issues I'm having (consider journaledJDBC case):
>>> >>
>>> >> 1) I first noticed that nothing appears to be getting written to my
>>> >> journal
>>> >> 2) When restarting AMQ, the output tells me (when starting the
>>> journal
>>> >> persistence adapter): "Journal Recovered: 0 message(s) in
>>> transactions
>>> >> recovered" http://old.nabble.com/file/p27937557/activemq.xml
>>> activemq.xml
>>> >> 3) When AMQ restarts, the topic and messages have been deleted
>>> >>
>>> >> I did do some tests (days/weeks ago) where I saw some messages being
>>> >> logged
>>> >> to Sql Server. But at no time did I have a successful test of
>>> recycling
>>> >> AMQ
>>> >> and seeing the existing queue/topic with pending messages populated.
>>> >>
>>> >> Live message production/consumption works great for me, both pub/sub
>>> and
>>> >> request reply. I just can't get persistence working. Please help!
>>> > 
>>> > I know that you are using .NET, but have you walked through the Java
>>> > examples first? Just to make sure you understand how it should work.
>>> > Here is some info about the examples:
>>> > 
>>> > http://activemq.apache.org/examples.html
>>> > 
>>> > The examples are very simple and straightforward. The only change you
>>> > will need to make in order to send persistent messages is to use the
>>> > following command when sending:
>>> > 
>>> > $ ant producer -Ddurable=true
>>> > 
>>> > The ProducerTool class will pick up the durable property and mark the
>>> > messages as persistent when it sends them. This will allow you to shut
>>> > down ActiveMQ, start up ActiveMQ and still see the 2000 messages in
>>> > the queue.
>>> > 
>>> > Bruce
>>> > -- 
>>> > perl -e 'print
>>> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>>> > );'
>>> > 
>>> > ActiveMQ in Action: http://bit.ly/2je6cQ
>>> > Blog: http://bruceblog.org/
>>> > Twitter: http://twitter.com/brucesnyder
>>> > 
>>> > 
>>> 
>> 
>> -- 
>> Tim Bish
>> 
>> Open Source Integration: http://fusesource.com
>> ActiveMQ in Action: http://www.manning.com/snyder/
>> 
>> Follow me on Twitter: http://twitter.com/tabish121
>> My Blog: http://timbish.blogspot.com/
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/AMQ-persistence-not-working-for-me-tp27937801p27949458.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ persistence not working for me

Posted by jumbro <ju...@fortress.com>.
I traced the message send within Spring.net. Setting NmsTemplate.Persistent =
true propagates that property to the MessageProducer. I also set
NmsTemplate.ExplicitQosEnabled = true which leads to:

producer.Send(message, persistent, priority, timeToLive);

where producer is an Apache.NMS.ActiveMQ.MessageProducer.

I've observed persistent to be true to this stage. This really should work.
Based on this, it would seem that the problem lives within the Apache.NMS
code (seems unlikely but I'm running out of ideas). The next step seems to
be adding Apache.NMS source to my solution and debugging further... 

Thanks for offering your help. Any more suggestions are welcomed!



Timothy Bish wrote:
> 
> On Thu, 2010-03-18 at 08:55 -0700, jumbro wrote:
>> Thanks for your reply.
>> 
>> I tested your suggestion and it works. I see now that it's the producer
>> that
>> determines the persistence.
>> 
>> Do you know off hand how to configure this same behavior using Spring?
>> I'm
>> using the NmsTemplate and allowing Spring to manage the underlying
>> messaging
>> context. I'm setting NmsTemplate.Persistent = true. I expected that to do
>> it, but no dice. 
> 
> I'd expect that to work but I don't know much about the NmsTemplate so
> I'd have to look at their source.  What version are you using and what
> version of NMS and NMS.ActiveMQ does it include?
> 
>> 
>> I also tested setting NMSPersistent = true like this:
>> 
>> ...
>> template.ConvertAndSendWithDelegate(requestMessage, delegate(IMessage
>> message)
>>                 {
>>                     message.NMSPersistent = true;
>>                     return message;
>>                 });
> 
> Setting the property on the message will have no effect as it going to
> be overwritten by the MessageProducer during the send operation.  To
> override the producer you need to call the MessageProducer send method
> that accepts a deliveryMode parameter.  
> 
> Regards
> Tim.
> 
>> 
>> but that didn't do it either.
>> 
>> I'm going to look into it further now, but if you have the answer that
>> would
>> be outstanding.
>> 
>> Thanks again.
>> 
>> 
>> bsnyder wrote:
>> > 
>> > On Wed, Mar 17, 2010 at 2:02 PM, jumbro <ju...@fortress.com> wrote:
>> >>
>> >> Hello,
>> >>
>> >> I have been trying to get persistence working and have been humbled by
>> >> the
>> >> experience.
>> >>
>> >> Here is my setup:
>> >>
>> >> * AMQ 5.3
>> >> * Monitoring via AMQ web console deployed in jetty
>> >> * Using Spring.NET 1.2 / Apache.NMS
>> >> * Tried each of the available AMQ persistence schemes (see attached
>> >> activemq.xml)
>> >> * Set both NmsTemplate.Persistent = true and
>> >> Apache.NMS.Message.NMSPersistent = true on the producer
>> >> * My preference is to use  journaledJDBCAdaptor against Sql Server
>> 2008
>> >>
>> >> Test performed:
>> >> * start AMQ
>> >> * start my message producer (creates dynamic topic by default)
>> >> * observe messages enqueued to topic via web console
>> >> * stop and start AMQ
>> >>
>> >> Here are the issues I'm having (consider journaledJDBC case):
>> >>
>> >> 1) I first noticed that nothing appears to be getting written to my
>> >> journal
>> >> 2) When restarting AMQ, the output tells me (when starting the journal
>> >> persistence adapter): "Journal Recovered: 0 message(s) in transactions
>> >> recovered" http://old.nabble.com/file/p27937557/activemq.xml
>> activemq.xml
>> >> 3) When AMQ restarts, the topic and messages have been deleted
>> >>
>> >> I did do some tests (days/weeks ago) where I saw some messages being
>> >> logged
>> >> to Sql Server. But at no time did I have a successful test of
>> recycling
>> >> AMQ
>> >> and seeing the existing queue/topic with pending messages populated.
>> >>
>> >> Live message production/consumption works great for me, both pub/sub
>> and
>> >> request reply. I just can't get persistence working. Please help!
>> > 
>> > I know that you are using .NET, but have you walked through the Java
>> > examples first? Just to make sure you understand how it should work.
>> > Here is some info about the examples:
>> > 
>> > http://activemq.apache.org/examples.html
>> > 
>> > The examples are very simple and straightforward. The only change you
>> > will need to make in order to send persistent messages is to use the
>> > following command when sending:
>> > 
>> > $ ant producer -Ddurable=true
>> > 
>> > The ProducerTool class will pick up the durable property and mark the
>> > messages as persistent when it sends them. This will allow you to shut
>> > down ActiveMQ, start up ActiveMQ and still see the 2000 messages in
>> > the queue.
>> > 
>> > Bruce
>> > -- 
>> > perl -e 'print
>> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> > );'
>> > 
>> > ActiveMQ in Action: http://bit.ly/2je6cQ
>> > Blog: http://bruceblog.org/
>> > Twitter: http://twitter.com/brucesnyder
>> > 
>> > 
>> 
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/AMQ-persistence-not-working-for-me-tp27937801p27949131.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ persistence not working for me

Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2010-03-18 at 08:55 -0700, jumbro wrote:
> Thanks for your reply.
> 
> I tested your suggestion and it works. I see now that it's the producer that
> determines the persistence.
> 
> Do you know off hand how to configure this same behavior using Spring? I'm
> using the NmsTemplate and allowing Spring to manage the underlying messaging
> context. I'm setting NmsTemplate.Persistent = true. I expected that to do
> it, but no dice. 

I'd expect that to work but I don't know much about the NmsTemplate so
I'd have to look at their source.  What version are you using and what
version of NMS and NMS.ActiveMQ does it include?

> 
> I also tested setting NMSPersistent = true like this:
> 
> ...
> template.ConvertAndSendWithDelegate(requestMessage, delegate(IMessage
> message)
>                 {
>                     message.NMSPersistent = true;
>                     return message;
>                 });

Setting the property on the message will have no effect as it going to
be overwritten by the MessageProducer during the send operation.  To
override the producer you need to call the MessageProducer send method
that accepts a deliveryMode parameter.  

Regards
Tim.

> 
> but that didn't do it either.
> 
> I'm going to look into it further now, but if you have the answer that would
> be outstanding.
> 
> Thanks again.
> 
> 
> bsnyder wrote:
> > 
> > On Wed, Mar 17, 2010 at 2:02 PM, jumbro <ju...@fortress.com> wrote:
> >>
> >> Hello,
> >>
> >> I have been trying to get persistence working and have been humbled by
> >> the
> >> experience.
> >>
> >> Here is my setup:
> >>
> >> * AMQ 5.3
> >> * Monitoring via AMQ web console deployed in jetty
> >> * Using Spring.NET 1.2 / Apache.NMS
> >> * Tried each of the available AMQ persistence schemes (see attached
> >> activemq.xml)
> >> * Set both NmsTemplate.Persistent = true and
> >> Apache.NMS.Message.NMSPersistent = true on the producer
> >> * My preference is to use  journaledJDBCAdaptor against Sql Server 2008
> >>
> >> Test performed:
> >> * start AMQ
> >> * start my message producer (creates dynamic topic by default)
> >> * observe messages enqueued to topic via web console
> >> * stop and start AMQ
> >>
> >> Here are the issues I'm having (consider journaledJDBC case):
> >>
> >> 1) I first noticed that nothing appears to be getting written to my
> >> journal
> >> 2) When restarting AMQ, the output tells me (when starting the journal
> >> persistence adapter): "Journal Recovered: 0 message(s) in transactions
> >> recovered" http://old.nabble.com/file/p27937557/activemq.xml activemq.xml
> >> 3) When AMQ restarts, the topic and messages have been deleted
> >>
> >> I did do some tests (days/weeks ago) where I saw some messages being
> >> logged
> >> to Sql Server. But at no time did I have a successful test of recycling
> >> AMQ
> >> and seeing the existing queue/topic with pending messages populated.
> >>
> >> Live message production/consumption works great for me, both pub/sub and
> >> request reply. I just can't get persistence working. Please help!
> > 
> > I know that you are using .NET, but have you walked through the Java
> > examples first? Just to make sure you understand how it should work.
> > Here is some info about the examples:
> > 
> > http://activemq.apache.org/examples.html
> > 
> > The examples are very simple and straightforward. The only change you
> > will need to make in order to send persistent messages is to use the
> > following command when sending:
> > 
> > $ ant producer -Ddurable=true
> > 
> > The ProducerTool class will pick up the durable property and mark the
> > messages as persistent when it sends them. This will allow you to shut
> > down ActiveMQ, start up ActiveMQ and still see the 2000 messages in
> > the queue.
> > 
> > Bruce
> > -- 
> > perl -e 'print
> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> > );'
> > 
> > ActiveMQ in Action: http://bit.ly/2je6cQ
> > Blog: http://bruceblog.org/
> > Twitter: http://twitter.com/brucesnyder
> > 
> > 
> 

-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/


Re: AMQ persistence not working for me

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, Mar 18, 2010 at 9:55 AM, jumbro <ju...@fortress.com> wrote:
>
> Thanks for your reply.
>
> I tested your suggestion and it works. I see now that it's the producer that
> determines the persistence.
>
> Do you know off hand how to configure this same behavior using Spring? I'm
> using the NmsTemplate and allowing Spring to manage the underlying messaging
> context. I'm setting NmsTemplate.Persistent = true. I expected that to do
> it, but no dice.
>
> I also tested setting NMSPersistent = true like this:
>
> ...
> template.ConvertAndSendWithDelegate(requestMessage, delegate(IMessage
> message)
>                {
>                    message.NMSPersistent = true;
>                    return message;
>                });
>
> but that didn't do it either.
>
> I'm going to look into it further now, but if you have the answer that would
> be outstanding.

I would think that the persistent property should do it. But given
that's not what you're seeing, I'm at a loss since I've never written
any .NET code. We need the opinion of someone who is familiar with the
.NET client for ActiveMQ and Spring .NET.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Re: AMQ persistence not working for me

Posted by jumbro <ju...@fortress.com>.
Thanks for your reply.

I tested your suggestion and it works. I see now that it's the producer that
determines the persistence.

Do you know off hand how to configure this same behavior using Spring? I'm
using the NmsTemplate and allowing Spring to manage the underlying messaging
context. I'm setting NmsTemplate.Persistent = true. I expected that to do
it, but no dice. 

I also tested setting NMSPersistent = true like this:

...
template.ConvertAndSendWithDelegate(requestMessage, delegate(IMessage
message)
                {
                    message.NMSPersistent = true;
                    return message;
                });

but that didn't do it either.

I'm going to look into it further now, but if you have the answer that would
be outstanding.

Thanks again.


bsnyder wrote:
> 
> On Wed, Mar 17, 2010 at 2:02 PM, jumbro <ju...@fortress.com> wrote:
>>
>> Hello,
>>
>> I have been trying to get persistence working and have been humbled by
>> the
>> experience.
>>
>> Here is my setup:
>>
>> * AMQ 5.3
>> * Monitoring via AMQ web console deployed in jetty
>> * Using Spring.NET 1.2 / Apache.NMS
>> * Tried each of the available AMQ persistence schemes (see attached
>> activemq.xml)
>> * Set both NmsTemplate.Persistent = true and
>> Apache.NMS.Message.NMSPersistent = true on the producer
>> * My preference is to use  journaledJDBCAdaptor against Sql Server 2008
>>
>> Test performed:
>> * start AMQ
>> * start my message producer (creates dynamic topic by default)
>> * observe messages enqueued to topic via web console
>> * stop and start AMQ
>>
>> Here are the issues I'm having (consider journaledJDBC case):
>>
>> 1) I first noticed that nothing appears to be getting written to my
>> journal
>> 2) When restarting AMQ, the output tells me (when starting the journal
>> persistence adapter): "Journal Recovered: 0 message(s) in transactions
>> recovered" http://old.nabble.com/file/p27937557/activemq.xml activemq.xml
>> 3) When AMQ restarts, the topic and messages have been deleted
>>
>> I did do some tests (days/weeks ago) where I saw some messages being
>> logged
>> to Sql Server. But at no time did I have a successful test of recycling
>> AMQ
>> and seeing the existing queue/topic with pending messages populated.
>>
>> Live message production/consumption works great for me, both pub/sub and
>> request reply. I just can't get persistence working. Please help!
> 
> I know that you are using .NET, but have you walked through the Java
> examples first? Just to make sure you understand how it should work.
> Here is some info about the examples:
> 
> http://activemq.apache.org/examples.html
> 
> The examples are very simple and straightforward. The only change you
> will need to make in order to send persistent messages is to use the
> following command when sending:
> 
> $ ant producer -Ddurable=true
> 
> The ProducerTool class will pick up the durable property and mark the
> messages as persistent when it sends them. This will allow you to shut
> down ActiveMQ, start up ActiveMQ and still see the 2000 messages in
> the queue.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder
> 
> 

-- 
View this message in context: http://old.nabble.com/AMQ-persistence-not-working-for-me-tp27937801p27947479.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ persistence not working for me

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Mar 17, 2010 at 2:02 PM, jumbro <ju...@fortress.com> wrote:
>
> Hello,
>
> I have been trying to get persistence working and have been humbled by the
> experience.
>
> Here is my setup:
>
> * AMQ 5.3
> * Monitoring via AMQ web console deployed in jetty
> * Using Spring.NET 1.2 / Apache.NMS
> * Tried each of the available AMQ persistence schemes (see attached
> activemq.xml)
> * Set both NmsTemplate.Persistent = true and
> Apache.NMS.Message.NMSPersistent = true on the producer
> * My preference is to use  journaledJDBCAdaptor against Sql Server 2008
>
> Test performed:
> * start AMQ
> * start my message producer (creates dynamic topic by default)
> * observe messages enqueued to topic via web console
> * stop and start AMQ
>
> Here are the issues I'm having (consider journaledJDBC case):
>
> 1) I first noticed that nothing appears to be getting written to my journal
> 2) When restarting AMQ, the output tells me (when starting the journal
> persistence adapter): "Journal Recovered: 0 message(s) in transactions
> recovered" http://old.nabble.com/file/p27937557/activemq.xml activemq.xml
> 3) When AMQ restarts, the topic and messages have been deleted
>
> I did do some tests (days/weeks ago) where I saw some messages being logged
> to Sql Server. But at no time did I have a successful test of recycling AMQ
> and seeing the existing queue/topic with pending messages populated.
>
> Live message production/consumption works great for me, both pub/sub and
> request reply. I just can't get persistence working. Please help!

I know that you are using .NET, but have you walked through the Java
examples first? Just to make sure you understand how it should work.
Here is some info about the examples:

http://activemq.apache.org/examples.html

The examples are very simple and straightforward. The only change you
will need to make in order to send persistent messages is to use the
following command when sending:

$ ant producer -Ddurable=true

The ProducerTool class will pick up the durable property and mark the
messages as persistent when it sends them. This will allow you to shut
down ActiveMQ, start up ActiveMQ and still see the 2000 messages in
the queue.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder