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.

Producer best practice

See original GitHub issue

What’s the best practice for producer creation in things like web requests? I believe we should be using one producer for multiple requests, i.e. create a singleton that always provides the same object and going by this question that seems correct?

So say if we have a singleton class that creates a producer with new ProducerBuilder<string, string>(config).Build() Will the GC be able to handle this or do we need to dispose when app is ending? So if we kill/restart the app, would it leak? Possibly prematurely worrying here but thought it would be worth asking.

Cheers

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
mhowlettcommented, May 10, 2021

no blog post on this but there is a web example now: https://github.com/confluentinc/confluent-kafka-dotnet/tree/master/examples/Web

3reactions
mhowlettcommented, Jun 3, 2019

sorry, haven’t done it yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kafka Best Practices-Topic, Partitions, Consumers, Producers ...
Best Practices for Producers in Kafka · 7. Setup Producers To Wait For Acknowledgements · 8. Configure “retires” On Your Producers · 9....
Read more >
ApsaraMQ for Kafka:Best practices for producers
This topic describes the best practices for ApsaraMQ for Kafka producers. The information described in this topic can help you reduce errors ...
Read more >
20 best practices for Apache Kafka at scale
Best practices for working with producers · 7. Configure your producer to wait for acknowledgments · 8. Configure retries on your producers. ·...
Read more >
Supercharge your Kafka Clusters with Consumer Best Practices
Kafka Consumer best practices · #1. Choose the right number of Partitions · #2. Maintain Consumer count consistency · #3. Use a replication...
Read more >
12 Best Practices For Using Kafka In Your Architecture
To design a durable system, ensure a high replication factor is set in the Kafka setting. Kafka replicates the log for each topic's...
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