Class DefaultTransactionIdSuffixStrategy

java.lang.Object
org.springframework.kafka.core.DefaultTransactionIdSuffixStrategy
All Implemented Interfaces:
TransactionIdSuffixStrategy

public class DefaultTransactionIdSuffixStrategy extends Object implements TransactionIdSuffixStrategy
The TransactionIdSuffixStrategy implementation for managing transactional producer suffixes. If the maxCache is greater than 0, the suffixes will be cached and reused. Otherwise, the suffixes will be generated on the fly.

The cache is per `transactional.id` prefix. The cache size is limited by the maxCache. A value of 0 means no caching and restriction, so the `transactional.id` will be generated on the fly.

Since:
3.2
Author:
Ilya Starchenko
  • Constructor Details

    • DefaultTransactionIdSuffixStrategy

      public DefaultTransactionIdSuffixStrategy(int maxCache)
      Construct a transaction id suffix strategy with the provided size of the cache.
      Parameters:
      maxCache - the maximum size of the cache.
  • Method Details