Skip to content

Conversation

sabinaptas
Copy link
Collaborator

No description provided.

@sabinaptas sabinaptas marked this pull request as draft October 7, 2025 16:20
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
Copy link
Collaborator Author

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

```
**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
Copy link
Collaborator Author

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.
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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?

Copy link
Collaborator Author

@sabinaptas sabinaptas left a 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 :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant