You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "xuesongxs (via GitHub)" <gi...@apache.org> on 2024/03/04 09:27:51 UTC
Re: [I] [Bug] Pulsar Client failed to subscribe to Topic when multithreading is concurrent [pulsar]
xuesongxs commented on issue #21617:
URL: https://github.com/apache/pulsar/issues/21617#issuecomment-1976110161
@Test
public void testSub() throws PulsarClientException, InterruptedException {
String serviceUrl = "pulsar://172.32.149.121:6650,172.32.148.243:6650";
PulsarClient client = PulsarClient.builder().serviceUrl(serviceUrl).lookupTimeout(-1, TimeUnit.SECONDS).build();
CountDownLatch countDownLatch = new CountDownLatch(1);
List<ConsumerThread> consumers = new ArrayList<>();
int consumerCount = 20;
ExecutorService executor = Executors.newFixedThreadPool(20, new ThreadFactoryBuilder().setNameFormat("PulsarTest").build());
for (int i = 41; i <= 60; i++) {
ConsumerThread consumerThread = new ConsumerThread(client, i);
executor.execute(consumerThread);
consumers.add(consumerThread) ;
}
countDownLatch.await();
}
By using this test case, the problem can be reproduced.
@hangc0276 @Technoboy-
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org