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.

Consume Multiple Messages at once

See original GitHub issue

Is it possible to do something like this in Confluent .NET API?

  public void run() {
    try {
      consumer.subscribe(topics);

      while (!shutdown.get()) {
        ConsumerRecords<K, V> records = consumer.poll(500);
        records.forEach(record -> process(record));
      }
    } finally {
      consumer.close();
      shutdownLatch.countDown();
    }
  }

This is taken from Java Documentation from docs.confluent.io.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mhowlettcommented, Sep 28, 2020

sorry for the terseness, was on my phone.

the consumer delivers messages to your application from a cache - behind the scenes messages are retrieved from brokers in batches. There might be a slight improvement to be had by returning batches to the application because of reduced marshaling overhead between librdkafka and the C# layer, but I doubt it is very much. The consume benchmark (in the tests folder) can do about 1M msg/s on my machine (has comparable performance to the java consumer).

0reactions
mhowlettcommented, Oct 31, 2020

it’s quite a lot of effort to build this and v. unlikely we’ll ever do it as we view this as an inferior API

Read more comments on GitHub >

github_iconTop Results From Across the Web

Consume multiple messages at a time - python
The advantage here is that you can fetch five messages on five different threads and combine the data if needed.
Read more >
Consume multiple messages · Issue #1164
The API provides you messages one at a time, but this is from an internal queue on the client, and behind the scenes...
Read more >
[rabbitmq-discuss] Consuming multiple messages at a time
Hi, We have an application where in for each client we create a Queue in RabbitMQ. (i.e. we create a binding with client...
Read more >
Subscriber vs Consume - Process Multiple Messages
Once the number of messages in a queue is obtained you can create a for each loop and iterate until the no of...
Read more >
Consume multiple messages from RabbitMQ in CAI - HOW TO
To increase the performance and to consume more messages at a time, do the following: Open the "RabbitMQ connection" and go to the...
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