public class PulsarProducerInterceptor extends Object implements InstanceMethodsAroundInterceptor
Here is the intercept process steps:
1. Record the service url, topic name through this(ProducerImpl) 2. Create the exit span when the producer invokesendAsyncmethod 3. Inject the context toMessage.getProperties()4. CreateSendCallbackEnhanceRequiredInfowithContextManager.capture()and set the callback enhanced instance skywalking dynamic field to the created required info. 5. Stop the exit span whensendAsyncmethod finished.
| Modifier and Type | Field and Description |
|---|---|
static String |
OPERATE_NAME_PREFIX |
static String |
PRODUCER_OPERATE_NAME_SUFFIX |
| Constructor and Description |
|---|
PulsarProducerInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
Object |
afterMethod(EnhancedInstance objInst,
Method method,
Object[] allArguments,
Class<?>[] argumentsTypes,
Object ret) |
void |
beforeMethod(EnhancedInstance objInst,
Method method,
Object[] allArguments,
Class<?>[] argumentsTypes,
MethodInterceptResult result) |
void |
handleMethodException(EnhancedInstance objInst,
Method method,
Object[] allArguments,
Class<?>[] argumentsTypes,
Throwable t) |
public static final String OPERATE_NAME_PREFIX
public static final String PRODUCER_OPERATE_NAME_SUFFIX
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable
beforeMethod in interface InstanceMethodsAroundInterceptorThrowablepublic Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable
afterMethod in interface InstanceMethodsAroundInterceptorThrowablepublic void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t)
handleMethodException in interface InstanceMethodsAroundInterceptorCopyright © 2023 The Apache Software Foundation. All rights reserved.