Comments (10)
Do you know how do kafka-clients of other language such as Java, Python implement this function?
from ruby-kafka.
The Java client has a background thread, I believe. However, I'd like to make the Ruby version more composable.
from ruby-kafka.
@dasch you can take a look into celluloid - it might help you out to provide an abstraction layer for that
from ruby-kafka.
@mensfeld I'd like to avoid adding heavy dependencies (such as Celluloid) to this library. I think I'm going to punt on this for a while.
from ruby-kafka.
@dasch you could also do what newrelic is doing for their monitoring stuff - they spin up a thread and push stuff there that gets flushed to their servers from time to time
from ruby-kafka.
Yeah, that's my plan. I think I'll add something to our web app first, see how it fares, and then maybe extract it into ruby-kafka. My main concerns are getting the periodic wakeup to work and ensuring that messages are sent on shutdown.
from ruby-kafka.
ensuring that messages are sent on shutdown.
You could just expose a trigger for that action and the shutdown implementation could differ for apps that use it. Something like (naming taken from newrelic rpm): Kafka.harvester.flush!
from ruby-kafka.
We have a similar abstraction in our code base: KafkaLog. It's a singleton and you call flush
on it.
from ruby-kafka.
@dasch just remember to add a mutex (probably don't have to tell you that but oh well ;) ) - so a multiple flash from many threads won't occur
from ruby-kafka.
Yeah, the flush would happen from the background thread itself, so that wouldn't be an issue. I think I'll just add a thread-safe queue between the main and the background threads, that usually makes things simpler.
from ruby-kafka.
Related Issues (20)
- Support Reporting Metrics to OpenTelemetry HOT 5
- Update latest release on repo landing page. HOT 1
- Offset is getting reset to earliest after getting an "invalid offset" error HOT 1
- Support for KAFKA-4148 / KIP-79 / search offsets by timestamp in Consumer HOT 1
- EOFError when connecting with SCRAM authentication HOT 2
- Extra space in `[Producer ]` prefix of async producer logs HOT 1
- Join request timeout doesn't consider rebalance_timeout HOT 2
- MSK IAM: add support for AssumeRole auto refresh HOT 12
- Kafka emit to Datadog is broken under ruby 3 HOT 2
- Create new configuration to be able to disable '[Producer] Sending' logs. HOT 1
- Why "consumer.each_message..." not looping indefinitely HOT 1
- OutOfOrderSequenceNumberError for async idempotent producer HOT 1
- Infinite loop in Cluster.get_coordinator if CoordinatorNotAvailable occurs HOT 1
- parameter "ssl_verify_hostname" is not used HOT 1
- Unexpected failure during shutdown after disconnect from a restarting Broker HOT 1
- Help: Kafka topics are deleted automatically after sudo systemctl stop kafka is done. HOT 2
- Long term plan for ruby-kafka HOT 1
- https://ruby-kafka-slack.herokuapp.com is not working. HOT 4
- Ruby Kafka Issues with MessageBufferOverFlow HOT 2
- Add support for using ssl_ca_cert as string HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-kafka.