You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "art.licis" <ar...@gmail.com> on 2017/06/21 15:09:24 UTC

StorePercentUsage not reported when running Broker embedded

Hi All,

I'm pretty new to ActiveMQ. I'm trying to make a demo with resource usage
notifications, and therefore was looking into stats one can read from JMX
MBeans. In my demo I'm creating a simple fast producer to write to queue and
leave it running without consumers (memory and store limits are set to
really low value ~ 5 and 10 Mb).

When starting ActiveMQ standalone app, everything works as expected:
MemoryPercentUsage grows until hits some number (69%) and stops, then
StorePercentUsage keeps growing until 100%, and then producer is blocked.

However, when starting broker embedded in my code, I can only observe
MemoryPercentUsage growing up to 69% while StorePercentUsage remains 0 all
the time. Broker just keeps storing undelivered messages as the KahaDB store
keeps growing (TotalEnqueueCount grows and I can observe how KahaDB files
are growing on a filesystem).

I have a feeling that some more settings should be provided through API.
Anyone can explain what exactly I'm doing wrong with embedded broker? For
clarity, attaching my broker code.

Thanks,
Art
EmbeddedBroker.java
<http://activemq.2283324.n4.nabble.com/file/n4727662/EmbeddedBroker.java>  



--
View this message in context: http://activemq.2283324.n4.nabble.com/StorePercentUsage-not-reported-when-running-Broker-embedded-tp4727662.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: StorePercentUsage not reported when running Broker embedded

Posted by "art.licis" <ar...@gmail.com>.
Yes, that was my mistake -- now it works. Thank you!



--
View this message in context: http://activemq.2283324.n4.nabble.com/StorePercentUsage-not-reported-when-running-Broker-embedded-tp4727662p4727669.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: StorePercentUsage not reported when running Broker embedded

Posted by Gary Tully <ga...@gmail.com>.
there are some smarts in xbean that set the persistence adapter reference
for the storeUsage. I think in your case that link is lost.

Start with:
SystemUsage usage = org.apache.activemq.broker.BrokerService#getSystemUsage

then make your mods to the members in that and there necessary associations
will be in place.



On Wed, 21 Jun 2017 at 16:26 art.licis <ar...@gmail.com> wrote:

> Hi All,
>
> I'm pretty new to ActiveMQ. I'm trying to make a demo with resource usage
> notifications, and therefore was looking into stats one can read from JMX
> MBeans. In my demo I'm creating a simple fast producer to write to queue
> and
> leave it running without consumers (memory and store limits are set to
> really low value ~ 5 and 10 Mb).
>
> When starting ActiveMQ standalone app, everything works as expected:
> MemoryPercentUsage grows until hits some number (69%) and stops, then
> StorePercentUsage keeps growing until 100%, and then producer is blocked.
>
> However, when starting broker embedded in my code, I can only observe
> MemoryPercentUsage growing up to 69% while StorePercentUsage remains 0 all
> the time. Broker just keeps storing undelivered messages as the KahaDB
> store
> keeps growing (TotalEnqueueCount grows and I can observe how KahaDB files
> are growing on a filesystem).
>
> I have a feeling that some more settings should be provided through API.
> Anyone can explain what exactly I'm doing wrong with embedded broker? For
> clarity, attaching my broker code.
>
> Thanks,
> Art
> EmbeddedBroker.java
> <http://activemq.2283324.n4.nabble.com/file/n4727662/EmbeddedBroker.java>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/StorePercentUsage-not-reported-when-running-Broker-embedded-tp4727662.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>