ClaimCheck
Overview
How can we reduce the data volume of a message sent across the system without sacrificing information content?
Store message data in a persistent store and pass a Claim Check to subsequent components. These components can use the Claim Check to retrieve the stored information.
https://www.enterpriseintegrationpatterns.com/patterns/messaging/StoreInLibrary.html
Examples
Check data
Config
name: claim_check
nodes:
- id: start
operator: HTTPIn
method: POST
routes:
- /claim_check
- id: b2j
operator: BufferToJSON
- id: claim_check
operator: ClaimCheck
edges:
- { from: start, to: b2j }
- { from: b2j, to: claim_check }Request
curl -v http://localhost:2243/claim_check -d '{"name": "Bill Smith"}'Response
{"claim_type":"filesystem","claim_value":"d936de4a-fa43-4cc9-a852-1bf655de6521"}Claim data
Config
name: claim_check_get
nodes:
- id: start
operator: HTTPIn
method: GET
routes:
- /claim_check/{id}
- id: translate
operator: MessageTranslator
mode: json
template: |
{
"claim_id": temp.http_in.params.id
}
- id: claim_check
operator: ClaimCheck
action: Get
- id: b2j
operator: BufferToJSON
edges:
- { from: start, to: translate }
- { from: translate, to: claim_check }
- { from: claim_check, to: b2j }Request
curl -v http://localhost:2243/claim_check/{id}Response
{
"name": "Bill Smith"
}Configuration Reference
name
Must be 'ClaimCheck'
Stringrequiredengine
What implementation is used (i.e./ filesystem, redis).
FileSystemoptionalDefault: "FileSystem"action
Action to take related to the claim check.
Get|Put|ClearoptionalDefault: "Put"