activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Cappa <capparobe...@gmail.com>
Subject Re: Persistence without spooling, memory limit, eviction policies
Date Sat, 11 Dec 2010 15:57:44 GMT
Thanks, It seems to work but...
When the maximum of memory is reached the producer throws an exception
(ok)... But when messages are consumed, the producer remains blocked because
the memory isn't deallocated, so the producer remains blocked forever (also
if the queue became empty!). Is there a way to force queue resizing?

Thanks.

2010/12/11 Stan Lewis <slewis@fusesource.com>

> You probably need to turn off producer flow control and then also
> enable sendFailIfNoSpace or sendFailIfNoSpaceAfterTimeout, there's a
> bunch of information here:
>
> http://activemq.apache.org/producer-flow-control.html
>
> On Sat, Dec 11, 2010 at 6:52 AM, Roberto Cappa <capparoberto@gmail.com>
> wrote:
> > Hi,
> >
> > I'm evaluating the possibility to use ActiveMQ in my project to manage a
> > persistent queue. I've done some tests, but I've encountered some issues.
> > These are my requirements:
> >
> > - All queues in my broker must be persistent, because I cannot loose
> pending
> > messages if the system goes down. This is the code, and it is ok, it
> works:
> >
> > BrokerService jmsBroker = new BrokerService();
> > jmsBroker.setPersistent(true);
> >
> > - I've to set a memory (or messages number) limit, in order to prevent
> too
> > high memory usage by the queue on my VM. This is the code:
> >
> > List<PolicyEntry> entries = new ArrayList<PolicyEntry>();
> > PolicyEntry conf = new PolicyEntry();
> > conf.setMemoryLimit(5000000);
> > conf.setQueue("myQueue");
> > entries.add(conf);
> > policyMap.setPolicyEntries(entries);
> > jmsBroker.setDestinationPolicy(policyMap);
> >
> > This is the first problem: if setPersistent(false) it works, but if
> > setPersistent(true) the broker ignores the memory limit, when the memory
> is
> > full starts spooling to disk. It is an undesired behavior, persistence
> and
> > spooling are two logical separate concepts.  Is there a way to set a
> memory
> > limit and persistence without enabling spooling?
> >
> > - When the memory limit is reached, by default the producer is blocked
> (if
> > persistence is false) or slowed (if persistence is true). There are two
> > undesired behaviors, my producer cannot be blocked or slowed by the queue
> (I
> > think it is a typical asynchronous scenario). If the queue is full, I can
> > choose two options, both valid for my requirements:
> >
> >    - Throwing an exception in producer code, so I can take actions in
> case
> > of full queue.
> >    - Discard oldest messages from the queue, accepting the new ones from
> > the producer, without blocking.
> >
> > For the first scenario, I haven't found any suitable configuration on
> > ActiveMQ.
> > For the secondo scenario, I've tryed with this code:
> >
> > OldestMessageEvictionStrategy strategy = new
> > OldestMessageEvictionStrategy();
> > conf.setMessageEvictionStrategy(strategy);
> > ...
> >
> > But it seems to be completely ignored. Any idea?
> >
> >
> > Thanks.
> >
>
>
>
> --
> Stan Lewis
> FuseSource
> Email: slewis@fusesource.com
> Web: http://fusesource.com
> Twitter: gashcrumb
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message