[
https://issues.apache.org/jira/browse/ARTEMIS-2745?focusedWorklogId=429233&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-429233
]
ASF GitHub Bot logged work on ARTEMIS-2745:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 30/Apr/20 19:54
Start Date: 30/Apr/20 19:54
Worklog Time Spent: 10m
Work Description: jbertram commented on a change in pull request #3109:
URL: https://github.com/apache/activemq-artemis/pull/3109#discussion_r418252356
##########
File path:
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java
##########
@@ -198,6 +199,36 @@ public void testForBasicMetricsPresenceAndValue() throws
Exception {
checkMetric(metrics, "artemis.consumer.count", "queue", queueName, 0.0);
}
+ @Test
+ public void testMessageCountWithPaging() throws Exception {
+ final String data = "Simple Text " + UUID.randomUUID().toString();
+ final String queueName = "simpleQueue";
+ final String addressName = "simpleAddress";
+
+
server.getAddressSettingsRepository().getMatch(addressName).setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE).setMaxSizeBytes(1024
* 10).setPageSizeBytes(1024 * 5);
+
+ session.createQueue(new
QueueConfiguration(queueName).setAddress(addressName).setRoutingType(RoutingType.ANYCAST));
+ ClientProducer producer = session.createProducer(addressName);
+ ClientMessage message = session.createMessage(true);
+ message.getBodyBuffer().writeString(data);
+ int messageCount = 0;
+ while (!server.getPagingManager().getPageStore(new
SimpleString(addressName)).isPaging()) {
+ producer.send(message);
+ messageCount++;
+ }
+
+ assertEquals(messageCount,
server.locateQueue(queueName).getMessageCount());
+ checkMetric(getMetrics(), "artemis.message.count", "queue", queueName,
Double.valueOf(messageCount));
+
+ for (int i = 0; i < messageCount; i++) {
+ producer.send(message);
+ }
+ producer.close();
+
+ assertEquals(messageCount * 2,
server.locateQueue(queueName).getMessageCount());
Review comment:
Done. I ran the test 500 times with no failures.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 429233)
Time Spent: 40m (was: 0.5h)
> Queue registering wrong metrics
> -------------------------------
>
> Key: ARTEMIS-2745
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2745
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> The wrong metrics are being registered by the queue with the
> {{MetricsManager}} which means that paged messages aren't being tracked.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)