Package io.sentry.spring7.kafka
Class SentryKafkaProducerBeanPostProcessor
java.lang.Object
io.sentry.spring7.kafka.SentryKafkaProducerBeanPostProcessor
- All Implemented Interfaces:
BeanPostProcessor,Ordered,PriorityOrdered
@Internal
public final class SentryKafkaProducerBeanPostProcessor
extends Object
implements BeanPostProcessor, PriorityOrdered
Installs a
ProducerPostProcessor on every ProducerFactory bean so that each
Producer created by Spring Kafka is wrapped via SentryKafkaProducer.wrap(Producer).
The wrapper records a queue.publish span around each send(...) that finishes
when the broker ack callback fires, giving a real producer-send lifecycle span.
KafkaTemplate beans are left untouched, so all customer-configured listeners, interceptors and
observation settings are preserved.
Note: ProducerFactory.addPostProcessor(ProducerPostProcessor) is a default method on
the interface that is a no-op unless overridden. Custom factories that do not extend
DefaultKafkaProducerFactory will not receive Sentry producer instrumentation; a warning is
logged at startup in that case.
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()@NotNull ObjectpostProcessAfterInitialization(@NotNull Object bean, @NotNull String beanName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.config.BeanPostProcessor
postProcessBeforeInitialization
-
Constructor Details
-
SentryKafkaProducerBeanPostProcessor
public SentryKafkaProducerBeanPostProcessor()
-
-
Method Details
-
postProcessAfterInitialization
@NotNull public @NotNull Object postProcessAfterInitialization(@NotNull @NotNull Object bean, @NotNull @NotNull String beanName) throws BeansException - Specified by:
postProcessAfterInitializationin interfaceBeanPostProcessor- Throws:
BeansException
-
getOrder
public int getOrder()
-