question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multi topics subscription using topic pattern over lot of topics

See original GitHub issue

Hi, 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

  1. Create a lot of topics. As we should subscribe to a topic pattern, create a topic name “my-topics-<number_to_increment>”

  2. 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);
     }`
    
  3. set log to debug level if needed

  4. 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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
sijiecommented, Oct 27, 2020

@lhotari Questions are encouraged in Github. Because they are searchable on the public internet rather than in Slack.

2reactions
lhotaricommented, Oct 27, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Look at Multi-Topic Subscriptions with Apache Pulsar
This is a sister post to one I have written about multi-topic subscriptions with Apache Kafka that you can read on the CloudKarafka...
Read more >
Spring Kafka, subscribing to large number of topics using topic ...
Our use case is that we need to subscribe to a large number of topics (potentially few thousands of topics). All the topics...
Read more >
A Dive into Multi-Topic Subscriptions with Apache Kafka
Apache Kafka allows a single consumer to subscribe to multiple topics at the same time and process both in a combined stream of...
Read more >
Messaging Concepts - Apache Pulsar
In this pattern, producers publish messages to topics. ... If more than one consumer attempts to subscribe to a topic using the same...
Read more >
Subscriptions: Multiple Groups of Consumers on a Pulsar Topic
The first thing to understand is that Pulsar manages consumers on topics using subscriptions. A subscription keeps track of the messages in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found