Allen123Hao opened a new issue, #11028:
URL: https://github.com/apache/skywalking/issues/11028

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   I use pulsar,set consumer config。add negativeAckRedeliveryDelay,like this:
   ` 
   
              consumer = pulsarClient.newConsumer(Schema.STRING)
                       .consumerName("order-payment")
                       .topic(TOPIC_PAYMENT)
                       .subscriptionName("order-payment-sub")
                       .subscriptionType(SubscriptionType.Shared)
                       .enableRetry(true)
                       .negativeAckRedeliveryDelay(30, TimeUnit.SECONDS)
                       .deadLetterPolicy(DeadLetterPolicy.builder()
                               .maxRedeliverCount(3)
                               .retryLetterTopic(RETRY_LETTER_TOPIC_PAYMENT)
                               .deadLetterTopic(DEAD_LETTER_TOPIC_PAYMENT)
                               .build())
                       .messageListener(orderConsumer)
                       .subscribe();
   
   `
   when send message, the error occur:
   
   java.lang.ClassCastException: class java.lang.String cannot be cast to class 
org.apache.skywalking.apm.plugin.pulsar.common.MessageEnhanceRequiredInfo 
(java.lang.String is in module java.base of loader 'bootstrap'; 
org.apache.skywalking.apm.plugin.pulsar.common.MessageEnhanceRequiredInfo is in 
unnamed module of loader 
org.apache.skywalking.apm.agent.core.plugin.loader.AgentClassLoader @2e4262d2)
   \tat 
org.apache.skywalking.apm.plugin.pulsar.common.PulsarConsumerListenerInterceptor.lambda$afterMethod$cf935be7$1(PulsarConsumerListenerInterceptor.java:60)
   \tat 
org.apache.pulsar.client.impl.ConsumerBase.callMessageListener(ConsumerBase.java:1147)
   \tat 
org.apache.pulsar.client.impl.ConsumerBase.lambda$triggerListener$10(ConsumerBase.java:1113)
   \tat 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
   \tat 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
   \tat 
org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   \tat java.base/java.lang.Thread.run(Thread.java:833)
   
   ### What you expected to happen
   
   if i not use skywalking locally, the application is normal。but when use 
skywalking,the error appearance.
   my pulsar client is 3.0.0
   
   ### How to reproduce
   
   use pulsar client 3.0.0, set consumer config lilke this:
   
   `
   
          Consumer<String> consumer;
           try {
               consumer = pulsarClient.newConsumer(Schema.STRING)
                       .consumerName("order-payment")
                       .topic(TOPIC_PAYMENT)
                       .subscriptionName("order-payment-sub")
                       .subscriptionType(SubscriptionType.Shared)
                       .enableRetry(true)
                       .negativeAckRedeliveryDelay(30, TimeUnit.SECONDS)
                       .deadLetterPolicy(DeadLetterPolicy.builder()
                               .maxRedeliverCount(3)
                               .retryLetterTopic(RETRY_LETTER_TOPIC_PAYMENT)
                               .deadLetterTopic(DEAD_LETTER_TOPIC_PAYMENT)
                               .build())
                       .messageListener(orderConsumer)
                       .subscribe();
           } catch (PulsarClientException e) {
               log.error("init payment consumer exception",e);
               throw new BizException("init payment consumer exception",e);
           }
   
   `
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to