[ https://issues.apache.org/jira/browse/JAMES-3841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17624447#comment-17624447 ]
ouvtam commented on JAMES-3841: ------------------------------- I'm running into a deadlock because I implemented the example code provided by https://activemq.apache.org/statisticsplugin.html in ActiveMQHealthCheck#check(). Basically, it creates a temporary queue and "waits" for the response in the replyTo queue (similar to ActiveMQCacheableMailQueue#getSize). When calling MessageConsumer#receive(timeout) it still can end in a deadlock when prefetchSize is zero (see org.apache.activemq.ActiveMQMessageConsumer#receive). That would explain some observed deadlocks in disabled tests in the test package org.apache.james.queue.activemq, but thats a story for another time. {code:java} MessageDispatch md; if (info.getPrefetchSize() == 0) { md = dequeue(-1); // We let the broker let us know when we timeout. } else { md = dequeue(timeout); } {code} So, I set the prefetchSize to 1 in order to avoid the deadlock. Now, I receive a InterruptedException caused by the timeout in MessageConsumer#receive(timeout). I enabled statistics in EmbeddedActiveMQ by calling brokerService.setEnableStatistics(true); Somebody has an idea or knows any caveats when running an embedded ActiveMQ? > ActiveMQ: Collect statistics and publish metrics > ------------------------------------------------ > > Key: JAMES-3841 > URL: https://issues.apache.org/jira/browse/JAMES-3841 > Project: James Server > Issue Type: Improvement > Components: Queue > Reporter: ouvtam > Priority: Minor > > Currently, only some James metrics are available for ActiveMQ which are > exposed in WebAdmin. Namely, enqueuedMail and dequeuedMail for each > registered queue (i.e. spool and outgoing). Some ActiveMQ broker stats > (memoryUsage, memoryLimit, storeUsage, storeLimit, maxEnqueueTime, etc.) are > currently not available. > According to [https://activemq.apache.org/statisticsplugin.html] ActiveMQ > Metrics can be obtained through subscription or by polling regularly. At the > moment the statistics plugin is only used to get the size of a queue. > I propose to poll ActiveMQ statistics via ActiveMQHealthCheck and publish > those as metrics. Currently, the health check creates a session and checks if > no exception occurred. > What do you think? > -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org