Class SentryKafkaRecordInterceptor<K,V>

java.lang.Object
io.sentry.spring7.kafka.SentryKafkaRecordInterceptor<K,V>
All Implemented Interfaces:
org.springframework.kafka.listener.RecordInterceptor<K,V>, org.springframework.kafka.listener.ThreadStateProcessor

@Internal public final class SentryKafkaRecordInterceptor<K,V> extends Object implements org.springframework.kafka.listener.RecordInterceptor<K,V>
A RecordInterceptor that creates queue.process transactions for incoming Kafka records with distributed tracing support.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SentryKafkaRecordInterceptor(@NotNull io.sentry.IScopes scopes)
     
    SentryKafkaRecordInterceptor(@NotNull io.sentry.IScopes scopes, @Nullable org.springframework.kafka.listener.RecordInterceptor<K,V> delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterRecord(@NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
     
    void
    clearThreadState(@NotNull org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
     
    void
    failure(@NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull Exception exception, @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
     
    @Nullable org.apache.kafka.clients.consumer.ConsumerRecord<K,V>
    intercept(@NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
     
    void
    setupThreadState(@NotNull org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
     
    void
    success(@NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SentryKafkaRecordInterceptor

      public SentryKafkaRecordInterceptor(@NotNull @NotNull io.sentry.IScopes scopes)
    • SentryKafkaRecordInterceptor

      public SentryKafkaRecordInterceptor(@NotNull @NotNull io.sentry.IScopes scopes, @Nullable @Nullable org.springframework.kafka.listener.RecordInterceptor<K,V> delegate)
  • Method Details

    • intercept

      @Nullable public @Nullable org.apache.kafka.clients.consumer.ConsumerRecord<K,V> intercept(@NotNull @NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
      Specified by:
      intercept in interface org.springframework.kafka.listener.RecordInterceptor<K,V>
    • success

      public void success(@NotNull @NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
      Specified by:
      success in interface org.springframework.kafka.listener.RecordInterceptor<K,V>
    • failure

      public void failure(@NotNull @NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull @NotNull Exception exception, @NotNull @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
      Specified by:
      failure in interface org.springframework.kafka.listener.RecordInterceptor<K,V>
    • afterRecord

      public void afterRecord(@NotNull @NotNull org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record, @NotNull @NotNull org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
      Specified by:
      afterRecord in interface org.springframework.kafka.listener.RecordInterceptor<K,V>
    • setupThreadState

      public void setupThreadState(@NotNull @NotNull org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Specified by:
      setupThreadState in interface org.springframework.kafka.listener.ThreadStateProcessor
    • clearThreadState

      public void clearThreadState(@NotNull @NotNull org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Specified by:
      clearThreadState in interface org.springframework.kafka.listener.ThreadStateProcessor