How to get message count from Mosquitto broker which is installed in windows or can we access and query on the broker database?
Have a look under the section broker status in the manual, as there are a number of topics that you can check depending on what you are after, for example...
$SYS/broker/load/messages/received/+ The moving average of the number of all types of MQTT messages received by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of messages received in 1 minute, averaged over 1, 5 or 15 minutes.
$SYS/broker/load/messages/sent/+ The moving average of the number of all types of MQTT messages sent by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned rep resents the number of messages send in 1 minute, averaged over 1, 5 or 15 minutes.