Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Simplify the consumer. #33

Merged
merged 1 commit into from Sep 12, 2015
Merged

Conversation

eliaslevy
Copy link
Contributor

A proposed simplification of the consumer (see #32 for a discussion of the problem with the current design). It drops the unnecessary queue nor those it force the user to use a thread pool. It is just a shallow Ruby layer over the Kafka high-level consumer. Like it exposes the message streams to the user and allows him to select how many streams he wants. If the user wants the old behavior of all messages multiplexed into a single queue, all they have to do is choose a single stream. The Kafka consumer group example can then be easily reproduced by the user, outside of the library.

@eliaslevy eliaslevy mentioned this pull request Sep 2, 2015
msg_decoder_i = Java::JavaClass.for_name(@msg_decoder).
constructor('kafka.utils.VerifiableProperties').new_instance nil

if @topic

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be worth turning @topic into an attr_reader since that field should be immutable once the class is initialized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way to change @topic from outside class, as @topic is not an attribute. You could make use of attr_reader and only use the topic attribute within the class, but that just seems like wearing suspenders with a belt. @topic is for all intents and purposes already immutable since its not modified after initialization.

joekiller added a commit that referenced this pull request Sep 12, 2015
@joekiller joekiller merged commit e292175 into joekiller:master Sep 12, 2015
@joekiller
Copy link
Owner

Thanks for the contribution!

@eliaslevy eliaslevy deleted the consumer-refactor branch June 15, 2016 01:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants