Class OpenTelemetryInterceptorVersion

java.lang.Object
io.debezium.tracing.OpenTelemetryInterceptorVersion

public class OpenTelemetryInterceptorVersion extends Object
This class represents a specific version of the OpenTelemetry interceptor by its class name.

An instance of this class attempts to dynamically load the OpenTelemetry interceptor class from the provided class name. If the class is present in the classpath (meaning that the relevant version of OpenTelemetry is being used), it gets loaded and methods can be retrieved from it for further invocation. If the class is not present, all operations gracefully degrade to return null, indicating that the version is not available.

This dynamic approach allows the Debezium Kafka Connector to interact with different versions of the OpenTelemetry interceptor, without having a direct compile-time dependency. It provides a level of abstraction over the changes in the OpenTelemetry interceptor's class name and package between different versions of OpenTelemetry.

  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • className

      private final String className
    • interceptorClass

      private Class<?> interceptorClass
  • Constructor Details

    • OpenTelemetryInterceptorVersion

      public OpenTelemetryInterceptorVersion(String className)
  • Method Details

    • createInstance

      public Object createInstance()
    • getMethod

      public Method getMethod(String name, Class<?>... parameterTypes)