Interface ClaimCheckRepository
- All Superinterfaces:
AutoCloseable, Service
Storage repository for the Claim Check EIP, which
temporarily parks a message payload so that a lighter message can travel through an intermediate part of a route.
The Claim Check pattern solves the problem of passing large payloads through components that have size limits or
performance concerns. The producing side stores the payload under a unique key (the "claim check") using
add(String, Exchange) or push(Exchange), replacing the message body with just the key. The
consuming side later retrieves the payload with get(String) or pop() and restores it to the
exchange.
The interface exposes two access styles:
- keyed (
add(String, Exchange),contains(String),get(String),getAndRemove(String)) — operates like aMap; the caller controls the key. - stack (
push(Exchange),pop()) — operates like aDeque; Camel manages the key internally, useful for nested claim checks.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the exchange to the repository.voidclear()Clear the repository.booleanReturns true if this repository contains the specified key.@Nullable ExchangeGets the exchange from the repository.@Nullable ExchangegetAndRemove(String key) Gets and removes the exchange from the repository.@Nullable Exchangepop()Pops the repository and returns the latest.voidPushes the exchange on top of the repository.
-
Method Details
-
add
-
contains
Returns true if this repository contains the specified key.- Parameters:
key- the claim check key- Returns:
- true if this repository contains the specified key
-
get
-
getAndRemove
-
push
Pushes the exchange on top of the repository. -
pop
@Nullable Exchange pop()Pops the repository and returns the latest. Or returns null if the stack is empty. -
clear
void clear()Clear the repository.
-