Class LambdaCustomizerWarnLogger
java.lang.Object
org.springframework.pulsar.support.internal.logging.LambdaCustomizerWarnLogger
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 Summary
ConstructorDescriptionLambdaCustomizerWarnLogger
(LogAccessor logger, long frequency) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
maybeLog
(ProducerBuilderCustomizer<?> producerCustomizer) Log a warning if the given customizer is implemented as a Lambda.
-
Constructor Details
-
LambdaCustomizerWarnLogger
Construct an instance.- Parameters:
logger
- the backing loggerfrequency
- how often to log the warning (i.e.every nth occurrence
)- See Also:
-
EveryNthSampler
-
-
Method Details
-
maybeLog
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
-