public abstract class BasePulsarProducerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine
The pulsar producer instrumentation use ProducerImpl as an enhanced class.
Producer is a user-oriented interface and the implementations of the Producer
are PartitionedProducerImpl and ProducerImpl.
And the PartitionedProducerImpl is a complex type with multiple ProducerImpl to support uses send messages to multiple partitions. As each ProducerImpl has it's own topic name and it is the initial unit of a single topic to send messages, so use ProducerImpl as an enhanced class is an effective way.
About the enhanced methods, currently use ProducerImpl.sendAsync(
org.apache.pulsar.client.api.Message, org.apache.pulsar.client.impl.SendCallback) as the enhanced method. Pulsar
provides users with two kinds of methods for sending messages sync methods and async methods. The async method use
as the method result, if use this method as the enhanced method is
hard to pass the snapshot of span, because can't ensure that the CompletableFuture is completed after the skywalking
dynamic field was updated. But execution time of sync method will be inaccurate.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONSTRUCTOR_INTERCEPTOR_FLAG |
static String |
ENHANCE_CLASS |
static String |
ENHANCE_METHOD |
static String |
ENHANCE_METHOD_TYPE |
static String |
INTERCEPTOR_CLASS |
CONTEXT_ATTR_NAME| Constructor and Description |
|---|
BasePulsarProducerInstrumentation() |
| Modifier and Type | Method and Description |
|---|---|
protected ClassMatch |
enhanceClass() |
ConstructorInterceptPoint[] |
getConstructorsInterceptPoints() |
protected abstract String |
getCustomConstructorInterceptor()
Get producer constructor intercept point
|
InstanceMethodsInterceptPoint[] |
getInstanceMethodsInterceptPoints() |
getStaticMethodsInterceptPointsenhanceClass, enhanceInstance, getInstanceMethodsInterceptV2Points, getStaticMethodsInterceptV2Pointsdefine, enhance, isBootstrapInstrumentation, witnessClasses, witnessMethodspublic static final String INTERCEPTOR_CLASS
public static final String ENHANCE_CLASS
public static final String ENHANCE_METHOD
public static final String ENHANCE_METHOD_TYPE
public static final String CONSTRUCTOR_INTERCEPTOR_FLAG
public ConstructorInterceptPoint[] getConstructorsInterceptPoints()
getConstructorsInterceptPoints in class AbstractClassEnhancePluginDefineprotected abstract String getCustomConstructorInterceptor()
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()
getInstanceMethodsInterceptPoints in class AbstractClassEnhancePluginDefineprotected ClassMatch enhanceClass()
enhanceClass in class AbstractClassEnhancePluginDefineCopyright © 2022 The Apache Software Foundation. All rights reserved.