Class PulsarConsumerInterceptor

java.lang.Object
org.apache.skywalking.apm.plugin.pulsar.common.PulsarConsumerInterceptor
All Implemented Interfaces:
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor

public class PulsarConsumerInterceptor extends Object implements org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
Interceptor for pulsar consumer enhanced instance

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 call messageProcessed method
  3. Extract all the Trace Context when call messageProcessed method
  4. Capture trace context and set into SkyWalkingDynamic field if consumer has a message listener when messageProcessed method finished
  5. Stop the entry span.
 
  • Field Details

  • Constructor Details

    • PulsarConsumerInterceptor

      public PulsarConsumerInterceptor()
  • Method Details

    • beforeMethod

      public void beforeMethod(org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult result) throws Throwable
      Specified by:
      beforeMethod in interface org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
      Throws:
      Throwable
    • afterMethod

      public Object afterMethod(org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable
      Specified by:
      afterMethod in interface org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
      Throws:
      Throwable
    • handleMethodException

      public void handleMethodException(org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t)
      Specified by:
      handleMethodException in interface org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor