Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How do I subscribe to future topics using a pattern? #1685

Closed
dulguun0225 opened this issue May 16, 2024 · 0 comments
Closed

[Question] How do I subscribe to future topics using a pattern? #1685

dulguun0225 opened this issue May 16, 2024 · 0 comments

Comments

@dulguun0225
Copy link

dulguun0225 commented May 16, 2024

I'm subscribing to topics like this:

const consumer = kafka.consumer({
  groupId: 'consumergroup0',
  allowAutoTopicCreation: true,
  metadataMaxAge: 10_000,
});

const run = async () => {
  await consumer.connect();
  console.log('consumer connected');
  await consumer.subscribe({
    topic: /mongo\.somedb.*?\.bbb/,
    fromBeginning: true,
  });
// ...
}

Let's say topics mongo.somedb_0.bbb mongo.somedb_1.bbb existed before consumer.subscribe is called. It can consume message on mongo.somedb_0.bbb mongo.somedb_1.bbb, but not any other topic that's created and matches the regex after subscribe is called. What option am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant