Delete messages from NServiceBus and ServiceInsight

2.2k Views Asked by At

According to the documentation, NServiceBus persists messages via the Management Service in a RavenDB stored in C:\ProgramData\Particular\ServiceBus.Management\Data. See Working with Error and Audit queues.

Ayende has confirmed that the database can only increase in size, never return the allocated disk space.

My problem is that the Data-file is now exceeding 20GB with +3 million messages.

Note that these messages are in the management DB, not in any of the message queue databases, which are stored in C:\Program Files\NServiceBus.Persistence.v4\Database\Databases.

The three million messages can be viewed in ServiceInsight, but I cannot delete them. All MSMQ queues are empty, and the queue-databases are around 1MB in size.

Question: How can I purge the Management Service / Particular Management database?

Sub-question: How can I prevent this form happening again? Is there a setting I'm missing?

2

There are 2 best solutions below

0
On

You can force a compaction on the db.

http://localhost:8080/admin/compact?database=YOUR_DB_NAME

0
On

The older version of ServiceControl used to be called Particular Management Service and the data file you mention was for that. If you've uninstalled the old version (The NServiceBus installer used to install this windows service), then it is no longer necessary. You can remove that.

More on the latest version of ServiceControl's data file here: http://docs.particular.net/ServiceControl/configure-ravendb-location

Also, using the latest version of ServiceControl, here's how to set expiration policies: http://docs.particular.net/ServiceControl/how-purge-expired-data

Get the latest here: http://particular.net/downloads