Multi topics subscription using topic pattern over lot of topics
See original GitHub issueHi, Describe the bug I’m trying start (in server side-back end) a consumer that should subscribe to a topic Pattern. This consumer should be able to handle all incoming message from all connected client ( remote client) through pulsar broker. Until now, i worked with few remote client, no more 50 clients and 4 topics by clients. so 200 topics. Now, i have a lot of client (50000) * 4 = 200000 topics and i’m going to increase this number to 300k client. When i try (in server side back-end) to start a consumer with multi topics subscription using a topics pattern, it seems nothing happen.
Is threre any limitations using multi topics subscription using topics pattern with a lot of topics ?
Thanks 😃
To Reproduce
-
Create a lot of topics. As we should subscribe to a topic pattern, create a topic name “my-topics-<number_to_increment>”
-
Create a program that should start a client and subscribe to a broker as following: ` PulsarClient client = null;
try { client = PulsarClient.builder().serviceUrl(PULSAR_HOST) .authentication(AuthenticationFactory.token(PULSAR_TOKEN)).build(); } catch (PulsarClientException e) { LOGGER.error("{}", Arrays.toString(e.getStackTrace())); } // Build consumer Consumer<byte[]> deviceConsumer = null; StringBuilder fullTopic = new StringBuilder().append(PULSAR_TENANT).append("/").append(PULSAR_NAMESPACE) .append("/").append(PULSAR_TOPIC).append("-.*"); Pattern allTopicsInNamespace = Pattern.compile(fullTopic.toString()); try { deviceConsumer = Objects.requireNonNull(client).newConsumer().topicsPattern(allTopicsInNamespace) .subscriptionName("data_subscription").subscriptionType(SubscriptionType.Shared) .messageListener(listener).subscribe(); LOGGER.info("Created consumer on topic {}",fullTopic); } catch (PulsarClientException e) { LOGGER.error("Error while subscribing to topics", e); }`
-
set log to debug level if needed
-
log info level: 2020-10-26 17:47:05,932 INFO [pulsar-client-io-1-1] org.apache.pulsar.client.impl.ConnectionPool: [[id: 0xeedd9a3c, L:/192.168.1.15:61572 - R:pulsar.domaine_name.local/192.168.244.189:30590]] Connected to server ==> Nothing happen after this latest log, i’m stuck. (if needed, i can share debug level log)
Expected behavior I expect to be able to consume as if i would manage 200 topics.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- pulsar version: 2.6.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
@lhotari Questions are encouraged in Github. Because they are searchable on the public internet rather than in Slack.
I don’t think multi topics subscription is meant to be used for thousands of topics. It’s better to join Pulsar Slack and discuss use cases and recommended solutions there, instead of creating Github issues. Please describe your use case and ask your question on Slack instead. Since this is not a bug, please close this issue.