karafka / wiki Goto Github PK
View Code? Open in Web Editor NEWWiki of the main Karafka repository
Home Page: https://karafka.io
Wiki of the main Karafka repository
Home Page: https://karafka.io
Stopping Karafka server
^CReceived SIGINT system signal
Stopping Karafka server
^Z^X^CStopping Karafka server
Received SIGINT system signal
^CStopping Karafka server
Received SIGINT system signal
^A^Z^CReceived SIGINT system signal
Stopping Karafka server
^Z^X^Z^CStopping Karafka server
Received SIGINT system signal
^XForceful Karafka server stop
I think there will be some false positives as there is no code, but I think it would be still good to have it under control.
Coming to Karafka with only a very rudimentary understanding of Kafka, I was very confused at first on how to get the same topic to be processed by different consumers in the same application. (Our use case is wanting to reformat and deliver events to 3 different external services, 2 of which are being handled in the same Karafka app.)
I finally got the hint I needed in this FAQ: https://karafka.io/docs/FAQ/#what-are-consumer-groups-used-for
Unfortunately, it doesn't have a code example currently!
Do you think it would be beneficial to write an entire advanced doc on consumer groups, both in general for Kafka, as well as use in Karafka code and best practices recommendations? (for example: where do I put topic config when it appears multiple times in the routes?)
We have something like
class ApplicationConsumer < Karafka::BaseConsumer
def self.on_unknown(message)
…
end
def consume
messages.each { |message| consume_single(message) }
end
def consume_single(message)
return self.class.on_unknown(message) unless validate(message)
MyApp::Metrics.with_context(**metrics_context(message)) do
process(message)
end
end
with a bunch of code handling unknown messages, errors and adding some context for metrics and error reporting in AppicationConsumer
and all other consumers inherited from this one.
In specs it's tested (or was tested in karafka-1) like
RSpec.describe ApplicationConsumer do
let(:consumer) do
Class.new(described_class) do
def initialize; end # rubocop:disable Style/RedundantInitialize required to avoid exception with different arity
end.new
end
end
and with karafka-2 it fails because karafka-testing implies that consumer has topic set, for example here and here.
It could be workarounded by
before
consumer_group = Karafka::Routing::ConsumerGroup.new('foo')
consumer.topic = Karafka::Routing::Topic.new('foo', consumer_group)
end
but would be good to retain the ability to test topic-less consumers or at least simplify/document how consumer group should be created.
First of all: great gen. Love working with karafka.
I think I found an error on a rakafka-testing` example.
Line 126 in 62335a8
Apparently Karafka::Routing::Topic
has a method #find
.
Change suggestion:
- let(:topic) { group.topics.find { |ts| ts.name == 'xml_data' } }
+ let(:topic) { group.topics.find('xml_data' ) }
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.