---
schema_version: "1"
id: 9f84d7ab2c7ebbf374db286492a4c1ef75955259891622f06d0638a460e76e27
title: 再配信ポリシーの設定
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mule-runtime/4.3/redelivery-policy.md
canonical_url: https://docs.mulesoft.com/jp/mule-runtime/4.3/redelivery-policy
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 9885f1a391c7f3419091f17cf02d5c9908e674a7a28b88c11321e2b1e2670252
description: MuleSoft Documentation Site
release: "4.3"
latest: false
---
# 再配信ポリシーの設定

再配信ポリシーとは、エラーを発生するメッセージを Mule Runtime Engine (Mule) で実行する回数を制限することでリソースを節約するのに役立つ検索条件です。再配信ポリシーは、フロー内の任意のソースに追加できます。

再配信ポリシーをフローのソースに追加すると、Mule によってフローのコンポーネントが実行される前に受信データが評価されます。指定した回数メッセージ配信に失敗すると、再配信ポリシーによってフローで受信データの処理が防止され、​REDELIVERY\_EXHAUSTED​ エラーが生成されます。

## [](#再配信ポリシーの設定パラメーター)再配信ポリシーの設定パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 50.0002%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">項目</th>
<th class="tableblock halign-left valign-top">型</th>
<th class="tableblock halign-left valign-top">デフォルト値</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><strong>Max Redelivery Count (最大再配信数)</strong></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Number (数値)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>5</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>MULE:REDELIVERY_EXHAUSTED​ エラーが生成される前に、失敗してもメッセージをフローに再配信して処理できる最大回数。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><strong>Use Secure Hash (セキュアハッシュを使用)</strong></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Boolean (ブール)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>True</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>再配信されたメッセージの識別にセキュアハッシュアルゴリズムを使用するかどうかを示します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><strong>Message Digest Algorithm (メッセージダイジェストアルゴリズム)</strong></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>String (文字列)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>SHA-256</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>メッセージに使用するセキュアハッシュアルゴリズム。メッセージのペイロードが Java オブジェクトの場合、Mule では ​<strong>[Message Digest Algorithm (メッセージダイジェストアルゴリズム)]</strong>​ 値が無視され、ペイロードの ​<code>hashCode()</code>​ が返した値を返します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><strong>ID Expression (ID の式)</strong></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Expression (式)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>-</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>メッセージがいつ再配信されたのかを判断する 1 つ以上の式を定義します。このプロパティは、​<strong>[Use Secure Hash (セキュアハッシュを使用)]</strong>​ の値が False の場合にのみ設定できます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><strong>Object Store</strong></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>String (文字列)</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>Mule のデフォルトの ​<code>ObjectStoreManager</code>​ によって作成される Object Store。永続的ではなく、​<code>entryTtl</code>​ は 300 秒、​<code>expirationInterval</code>​ は 6 秒です。</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>各メッセージの再配信カウンターが保存される Object Store。Object Store は参照または内部要素として設定できます。</p>
</div>
<div class="paragraph">
<p>詳細は、​<a href="https://docs.mulesoft.com/object-store-connector/latest/" class="xref page">「Object Store Connector ドキュメント」</a>​を参照してください。</p>
</div></div></td>
</tr>
</tbody>
</table>

## [](#再配信ポリシーのしくみ)再配信ポリシーのしくみ

ソースが新しいメッセージを受信するたびに、Mule はそのキーを生成してメッセージを識別します。

- 処理フローで例外が発生すると、Mule は、メッセージキーに関連付けられているカウンターを増分します。カウンター値が、設定されている ​**maxRedeliveryCount**​ の値を超えると、Mule で MULE:REDELIVERY\_EXHAUSTED​ エラーがスローされます。
- 処理フローで例外が発生しなければ、カウンターがリセットされます。

## [](#エラー)エラー

- MULE:REDELIVERY\_EXHAUSTED
    
    エラーが発生した実行回数が設定されている ​**maxRedeliveryCount**​ 値より大きい場合にスローされます。

## [](#例)例

次の例では、​**maxRedeliveryCount**​ である 2 を超えた場合に Mule で ​`Redelivery exhausted in http listener`​ メッセージが含まれるエラーが記録されます。

```xml
<flow name="logOnRedeliveryExhausted">
    <http:listener path="test" config-ref="listenerConfig">
        <redelivery-policy maxRedeliveryCount="2" useSecureHash="true"/>
    </http:listener>
    <flow-ref name="processData"/>
    <error-handler>
        <on-error-continue type="MULE:REDELIVERY_EXHAUSTED">
            <logger message="Redelivery exhausted in http listener" level="ERROR"/>
        </on-error-continue>
    </error-handler>
</flow>
```

## [](#関連情報)関連情報

- [Mule の概要](https://docs.mulesoft.com/jp/mule-runtime/4.3/)
- [Flow および Subflow スコープ](https://docs.mulesoft.com/jp/mule-runtime/4.3/flow-component)