Class LambdaCustomizerWarnLogger

java.lang.Object
org.springframework.pulsar.support.internal.logging.LambdaCustomizerWarnLogger

public class LambdaCustomizerWarnLogger extends Object
Log a warning when a Lambda is used as a producer builder customizer.

For each encountered Lambda customizer, the log is sampled on a frequency to avoid flooding the logs. The warning is logged on the very first occurrence and then every nth time thereafter.

Since:
1.2.0
Author:
Chris Bono
  • Constructor Details

    • LambdaCustomizerWarnLogger

      public LambdaCustomizerWarnLogger(LogAccessor logger, long frequency)
      Construct an instance.
      Parameters:
      logger - the backing logger
      frequency - how often to log the warning (i.e. every nth occurrence)
      See Also:
      • EveryNthSampler
  • Method Details

    • maybeLog

      public void maybeLog(ProducerBuilderCustomizer<?> producerCustomizer)
      Log a warning if the given customizer is implemented as a Lambda.

      Note that the log is sampled and will be logged on the very first and every nth occurrence thereafter.

      Parameters:
      producerCustomizer - the customizer