Jennifer88huang opened a new issue #9423:
URL: https://github.com/apache/pulsar/issues/9423


   Hi, about the listener threads.
   I have pulsar client in java configured like this:
   ```
   PulsarClient.builder()
         .serviceUrl(config.getServiceUrl())
         .operationTimeout(config.getOperationTimeout(), TimeUnit.SECONDS)
         .listenerThreads(5)
         .statsInterval(config.getStatsIntervalInSeconds(), TimeUnit.SECONDS)
         .build();
   ```
   But client appears to be using just a single thread while reading messages 
(i am using the reader not consumer)
   When looking at java threads i can see only one
   ```
   konrad@MBP-Konrad ~ % kubectl exec -n konrad konrad-admin-7b956bf74d-m7hnb  
-- jstack 6 | grep "pulsar-external-listener" 
   OpenJDK 64-Bit Server VM warning: ignoring option PermSize=256m; support was 
removed in 8.0
   OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support 
was removed in 8.0
   "pulsar-external-listener-9-1" #133 daemon prio=5 os_prio=0 
tid=0x00007fd7c005a800 nid=0x89 waiting on condition [0x00007fd796da5000]
   ```
   What am i doing wrong? (edited) 
   
   sijieg  
   listener thread is used for MessageListener. If you are using reader, I 
don’t think you will use MessageListener. What you are trying to optimize with 
listenerThreads?
   
   Konrad Łyś  
   i were trying to get multiple readers per subscription without having 
persistent subscription, but after digging out through code i got that a reader 
is strictly single-threaded and i switched to consumers
   
   Konrad Łyś  
   it would be nice to have that behaviour more explicitly documented
   
   Question from slack 
https://apache-pulsar.slack.com/archives/C5Z4T36F7/p1611739883167300


----------------------------------------------------------------
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.

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


Reply via email to