Patent ID: 8370847

Claim:
A method in a data processing system for managing persistence within a messaging system, the method comprising: evaluating a level of exposure of the messaging system to a risk of losing a plurality of nominally-persistent messages stored within a volatile storage of the messaging system in the event of a failure of the messaging system, wherein the plurality of nominally-persistent messages are candidates for saving to a non-volatile storage, wherein the evaluating further comprises: monitoring a set of metrics related to a processing of messages by the messaging system, wherein the monitoring further comprises monitoring the number M within one or more queues at the messaging system; and comparing monitored values for the set of metrics with a set of threshold values to determine whether the monitored values are within acceptable risk thresholds, wherein the comparing further comprises comparing the number M with the threshold number N; in response to the evaluating, determining whether the risk of losing a plurality of nominally-persistent messages exceeds at least one risk threshold by evaluating whether a number M is greater than a threshold number N, wherein the number M is one or more nominally-persistent messages have not yet been saved to the persistent storage, and wherein the threshold number N represents a defined acceptable number of nominally-persistent messages held within one or more queues at the messaging system which nominally-persistent messages have not yet been saved to the persistent storage; and in response to determining that the risk of losing the plurality of nominally-persistent messages exceeds the at least one risk threshold, saving the plurality of nominally-persistent messages to a persistent storage of the messaging system, wherein the persistent storage is a non-volatile storage.