> Is there anything I can do to encourage Artemis to perform a "recount" of
the messages that actually are persisted in the queues?

The broker should recount the messages every time it starts and loads the
journal from disk. You could use the `artemis data print` command to take a
close look at the journal while the broker is shutdown, e.g.:

  /artemisHome/bin$ ./artemis data print --journal
/path/to/journalDirectory --paging /path/to/pagingDirectory
--large-messages /path/to/largeMessageDirectory --bindings
/path/to/bindingsDirectory

Out of curiosity, why does it appear that those message counts are
inaccurate? If you attach a consumer to that queue do you not get any
messages even though the message count is > 0?

Would you be willing to upload your data directory somewhere so I could
take a look?


Justin

On Wed, Jan 4, 2023 at 1:33 PM Fredrik Jonson <fred...@jonson.org> wrote:

> Hi,
>
> I have an embedded Artemis 2.27.1 broker with jvm local connections in a
> spring boot app. I believe that the metrics for artemis_message_count of
> two queues are wrong. They never go below a certain base threshold, in one
> case 146, in the other 86. Not much, but annoying nontheless.
>
> The problem has persisted over several jvm restarts and for several weeks
> now.
> I see nothing relevant in the logs. It started when I was running 2.26.0,
> have upgraded to 2.27.1 and started using libaio instead of Nio since then.
> The server is running Openjdk Temurin 19.0.1.
>
> Is there anything I can do to encourage Artemis to perform a "recount" of
> the messages that actually are persisted in the queues?
>
> Here's my full configuration of the broker.
>
>   var dataDir = "/srv/activemq-data"
>   var metricsPlugin = new JmsMetricsPlugin(meterRegistry);
>   var config = new ConfigurationImpl()
>           .setPersistenceEnabled(true)
>           .setCreateJournalDir(true)
>           .setJournalDirectory("%s/journal".formatted(dataDir))
>           .setCreateBindingsDir(true)
>           .setBindingsDirectory("%s/bindings".formatted(dataDir))
>           .setPagingDirectory("%s/paging".formatted(dataDir))
>           .setLargeMessagesDirectory("%s/largemessages".formatted(dataDir))
>           .setJournalCompactMinFiles(2)
>           .setJournalPoolFiles(10)
>           .setJournalCompactPercentage(50)
>           .setSecurityEnabled(false)
>           .addAcceptorConfiguration("in-vm", "vm://0");
>   config.setMetricsConfiguration(
>            new MetricsConfiguration().setPlugin(metricsPlugin));
>   var settings = new AddressSettings()
>           .setAutoCreateDeadLetterResources(true)
>           .setAutoCreateExpiryResources(true)
>           .setAutoDeleteAddresses(false)
>           .setAutoDeleteCreatedQueues(false)
>           .setAutoDeleteQueues(false)
>           .setDeadLetterQueueSuffix(new SimpleString("dlq"))
>           .setExpiryQueueSuffix(new SimpleString("expiry"));
>   broker = ActiveMQServers.newActiveMQServer(config);
>   broker.getAddressSettingsRepository().setDefault(settings);
>   broker.start();
>
> --
> Fredrik Jonson
>
>

Reply via email to