--- url: "https://www.enterpriseintegrationpatterns.com/patterns/conversation/RenewalReminder.html" titulek: "Renewal Reminder - Enterprise Integration Patterns 2" h1: "" popis: "Enterprise Integration Patterns" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-15 14:54:18" znaku: 3869 slov: 585 kodovani: "utf-8" sha256: "907d7cda49af3377b1395238d1f26e74609c5c5689efb257ff921036b5287503" --- | | Renewal Reminder[Conversation Patterns](index.html) » [Resource Management](ResourceIntro.html) | [Contents](toc.html)[⇐ Prev](Lease.html)[Next ⇒](EnsuringConsistencyIntro.html) | | --- | --- | --- | A provider engages in long-running conversations with multiple partners. Each of these conversations requires the provider to allocate resources. How can a service provider avoid holding resources for clients who are no longer interested? A [*Lease*](Lease.html) allows the provider to set the length of the resource allocation at the time of the request but it has no means to shorten or rescind allocations for example when it experiences a shortage of resources. In such a case it can only reject new requestors.A [*Lease*](Lease.html) requires the lease holder to actively monitor the duration of the lease to renew in time. This might be cumbersome for some clients.In ditributed systems clocks may get out of sync, causing a lease holder to believe the lease is still valid, while the lease grantor already expired the lease. Have the provider periodically check whether the requestor still requires the resource. If the requestor answers "no" or is unreachable, the provider relinquishes the resource. The *Renewal Reminder* conversation involves the following participants: - The *Requestor* initiates the conversation by *Request* ing a resource. In return he receives a message containing a *Reference* to the allocated resource. Periodically, the *Requestor* receives a *Ping* from the provider. In order to retain the resource it must *Confirm* the ping. - The *Provider* accepts *Request* messages for resources and grants them if resources are available, returning the *Reference* to the resource. Periodically, or when resources are tight, the *Provider* sends a *Ping* to one or more *Requestor* s. It expects to receive a *Confirm* message in order to retain the resource. *Renewal Reminder* consists of multiple [*Asynchronous Request-Response*](RequestResponse.html) conversations, one initiated by the *Requestor* and recurring instances initiated by the *Provider*. For both occasions, the participants may use [*Request-Response with Retry*](RequestResponseRetry.html). Especially for the *Ping* message, through, retry counts will be low as its purpose is to detect unresponsive *Requestor*s. *Renewal Reminder* gives the provider more control but also burdens it with more house keeping. In the flip side the consumer can be simpler as it does not have to track the expiration of the lease or initiate renewals. It does, however have to be able to respond to incoming request messages to process the *Ping* message. If resources are plentiful, this conversation can result in very low traffic as the provider will have little need to ping requestors. As the provider gets into a space crunch it can react by pinging, hoping that some clients are no longer present or no longer need their resource. If a client is unreachable, the *Provider* can decide to retry the request or relinquish the resource on the spot. This can leave provider and consumer in an inconsistent state: the consumer, not aware that the provider tried to contact it, might be under the impression that the resource is still available whereas the provider has already cancelled it. Generally, *Renewal Reminder* exhibits more coupling between participants than : the provider has to track all requestors and their addresses as message exchange occurs in both directions. ## Example: Magazine Subscription In this case the provider is eager to have the requestor renew the resource because it is paid. It uses the *Renewal Reminder* conversation but with a [*Request-Response with Retry*](RequestResponseRetry.html) conversation for the *Ping* with often an (annoyingly) high retry count. **Related patterns:**[*Lease*](Lease.html), [*Asynchronous Request-Response*](RequestResponse.html), [*Request-Response with Retry*](RequestResponseRetry.html) ---