Class BasePulsarProducerInstrumentation
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.apache.skywalking.apm.agent.core.plugin.AbstractClassEnhancePluginDefine
CONTEXT_ATTR_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.skywalking.apm.agent.core.plugin.match.ClassMatchorg.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint[]protected abstract StringGet producer constructor intercept pointorg.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint[]Methods inherited from class org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
getStaticMethodsInterceptPointsMethods inherited from class org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassEnhancePluginDefine
enhanceClass, enhanceInstance, getInstanceMethodsInterceptV2Points, getStaticMethodsInterceptV2PointsMethods inherited from class org.apache.skywalking.apm.agent.core.plugin.AbstractClassEnhancePluginDefine
define, enhance, isBootstrapInstrumentation, witnessClasses, witnessMethods
-
Field Details
-
INTERCEPTOR_CLASS
- See Also:
-
ENHANCE_CLASS
- See Also:
-
ENHANCE_METHOD
- See Also:
-
ENHANCE_METHOD_TYPE
- See Also:
-
CONSTRUCTOR_INTERCEPTOR_FLAG
- See Also:
-
-
Constructor Details
-
BasePulsarProducerInstrumentation
public BasePulsarProducerInstrumentation()
-
-
Method Details
-
getConstructorsInterceptPoints
public org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint[] getConstructorsInterceptPoints()- Specified by:
getConstructorsInterceptPointsin classorg.apache.skywalking.apm.agent.core.plugin.AbstractClassEnhancePluginDefine
-
getCustomConstructorInterceptor
Get producer constructor intercept point- Returns:
- producer interceptor
-
getInstanceMethodsInterceptPoints
public org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()- Specified by:
getInstanceMethodsInterceptPointsin classorg.apache.skywalking.apm.agent.core.plugin.AbstractClassEnhancePluginDefine
-
enhanceClass
protected org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch enhanceClass()- Specified by:
enhanceClassin classorg.apache.skywalking.apm.agent.core.plugin.AbstractClassEnhancePluginDefine
-