This issue builds on
OF-1200, and is closely related. OF-1200 applied a mechanism to write data-to-be-accessed-through-archiving-functionality to the database nearly instantly, as opposed to batching these for long amounts of time (which causes queries for data to miss elements that were pending, in a batch). OF-1200 applied this to the monitoring plugin only. As the monitoring plugin uses data written by Openfire core (and not only written by the plugin itself, as was previously assumed), OF-1200 didn't resolve the larger issue.
A similar mechanism as introduced to the Monitoring plugin in
OF-1200 should be applied to the MUC message history mechanism.
Then, the Monitoring plugin can be modified to make use of this new functionality (see https://github.com/igniterealtime/openfire-monitoring-plugin/issues/38 )