Interface ClaimCheckRepository

All Superinterfaces:
AutoCloseable, Service

public interface ClaimCheckRepository extends 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:

See Also:
  • invalid reference
    org.apache.camel.processor.ClaimCheckProcessor
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(String key, Exchange exchange)
    Adds the exchange to the repository.
    void
    Clear the repository.
    boolean
    Returns true if this repository contains the specified key.
    @Nullable Exchange
    get(String key)
    Gets the exchange from the repository.
    @Nullable Exchange
    Gets and removes the exchange from the repository.
    @Nullable Exchange
    pop()
    Pops the repository and returns the latest.
    void
    push(Exchange exchange)
    Pushes the exchange on top of the repository.

    Methods inherited from interface Service

    build, close, init, start, stop
  • Method Details

    • add

      boolean add(String key, Exchange exchange)
      Adds the exchange to the repository.
      Parameters:
      key - the claim check key
      Returns:
      true if this repository did not already contain the specified key
    • contains

      boolean contains(String key)
      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

      @Nullable Exchange get(String key)
      Gets the exchange from the repository.
      Parameters:
      key - the claim check key
    • getAndRemove

      @Nullable Exchange getAndRemove(String key)
      Gets and removes the exchange from the repository.
      Parameters:
      key - the claim check key
      Returns:
      the removed exchange, or null if the key did not exists.
    • push

      void push(Exchange exchange)
      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.