activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jumbro <jum...@fortress.com>
Subject Re: AMQ persistence not working for me
Date Thu, 18 Mar 2010 18:15:32 GMT

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 <jumbro@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.


Mime
View raw message