public class PulsarConsumerInterceptor extends Object implements InstanceMethodsAroundInterceptor
Here is the intercept process steps:
1. Record the service url, topic name and subscription name through this(ConsumerImpl) 2. Create the entry span when callmessageProcessedmethod 3. Extract all theTrace Contextwhen callmessageProcessedmethod 4. Capture trace context and set into SkyWalkingDynamic field if consumer has a message listener whenmessageProcessedmethod finished 5. Stop the entry span.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONSUMER_OPERATE_NAME |
static String |
OPERATE_NAME_PREFIX |
| Constructor and Description |
|---|
PulsarConsumerInterceptor() |
| 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 CONSUMER_OPERATE_NAME
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.