-
Notifications
You must be signed in to change notification settings - Fork 15
Producing and consuming messages tw review #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Consuming-Messages.md
Outdated
Karafka framework has a long-running server process responsible for fetching and consuming messages. Consumers should inherit from the **ApplicationConsumer**. You need to define a ```#consume``` method that will execute your business logic code against a batch of messages. Karafka fetches and consumes messages in batches by default. | ||
|
||
Karafka fetches and consumes messages in batches by default. | ||
### Consuming Messages in Batches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my mistake here, it will be changed to H2
Consuming-Messages.md
Outdated
``` | ||
**Result:** The `#consume_one` method will be called for each message in the batch, allowing you to process messages individually while maintaining the benefits of Karafka's batch fetching. | ||
|
||
### Accessing Topic Details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, in Wiki it is H3 displayed under the Consuming Messages Topic. Is it a subsection? Or can I move it/treat it as H2 in TOC? I understood, it is a separate procedure from Consuming Messages (in batches or individually) per se.
@@ -1,22 +1,33 @@ | |||
Consumers should inherit from the **ApplicationConsumer**. You need to define a ```#consume``` method that will execute your business logic code against a batch of messages. | |||
Karafka framework has a long-running server process responsible for fetching and consuming messages. Consumers should inherit from the **ApplicationConsumer**. You need to define a ```#consume``` method that will execute your business logic code against a batch of messages. Karafka fetches and consumes messages in batches by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by "define a consume method"? Where is it done/shown? Is it a step?
I wrote: Select one of two processing approaches based on your use case:
Is it when a consume method is defined?
With [Long-Running Jobs](Pro-Long-Running-Jobs), the `#revoked?` method still updates automatically, even when messages remain unmarked for extended periods. | ||
|
||
|
||
## Consumer Persistence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to rename it to "Buffering Messages with Consumer Persistence" - this signals both the technique (buffering) and the enabling mechanism (persistence).
What's your preference? Do you want developers to understand the broader concept, or focus on the buffering pattern?
This configuration ensures that as soon as the end of a partition is reached, any accumulated messages are immediately processed, enhancing the system responsiveness and efficiency. | ||
|
||
## Inline API Based Consumption | ||
## Inline API-Based Consumption |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better alternatives that align with Karafka's style:
"Iterator API" (simple, feature-focused). It matches the pattern of other feature sections.
"Consuming with the Iterator API" (procedural gerund).
@mensfeld let me know which title is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have finished the first round of the whole "Consuming Messages" chapter. Please, go through the changes and reply to my comments :-).
No description provided.