Skip to content

Refactor KafkaConsumerActor event handling from Mailbox to direct method call#418

Merged
Aaronontheweb merged 9 commits into
akkadotnet:devfrom
Arkatufus:Refactor-event_handling
Jan 22, 2025
Merged

Refactor KafkaConsumerActor event handling from Mailbox to direct method call#418
Aaronontheweb merged 9 commits into
akkadotnet:devfrom
Arkatufus:Refactor-event_handling

Conversation

@Arkatufus
Copy link
Copy Markdown
Contributor

@Arkatufus Arkatufus commented Jan 16, 2025

Possible fix for #414 and #415

Changes

  • Refactor KafkaConsumerActor event handling from using Self.Tell() to direct method call
  • Implement missing OnPartitionsLost handler

@Arkatufus Arkatufus marked this pull request as ready for review January 22, 2025 18:24
Copy link
Copy Markdown
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM

.RunWith(Sink.Last<int>(), Materializer);

var consumedMessages = await consumedMessagesTask.ShouldCompleteWithin(10.Seconds());
var consumedMessages = await consumedMessagesTask.ShouldCompleteWithin(60.Seconds());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

public void OnLost(IImmutableSet<TopicPartitionOffset> revokedTopicPartitions,
IRestrictedConsumer consumer)
{
RevokeEventsCounter.IncrementAndGet();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

return true;

// Rebalance callbacks
case PartitionAssigned evt:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM - this has all be moved to the event-handler code

@Aaronontheweb Aaronontheweb merged commit 92c4600 into akkadotnet:dev Jan 22, 2025
Arkatufus added a commit to Arkatufus/Akka.Streams.Kafka that referenced this pull request Feb 28, 2025
Arkatufus added a commit to Arkatufus/Akka.Streams.Kafka that referenced this pull request Feb 28, 2025
# Conflicts:
#	src/Akka.Streams.Kafka/Extensions/CollectionExtensions.cs
#	src/Akka.Streams.Kafka/Stages/Consumers/Actors/KafkaConsumerActor.cs
@Arkatufus Arkatufus mentioned this pull request Feb 28, 2025
Aaronontheweb added a commit to Arkatufus/Akka.Streams.Kafka that referenced this pull request Mar 3, 2025
Aaronontheweb added a commit that referenced this pull request Mar 3, 2025
* Implement OnPartitionsLost event handler from #418

* Bump AkkaVersion to 1.5.37 (#422)

(cherry picked from commit d2aa70f)

* Implement dual targeting for netstandard2.0 and net6.0 (#424)

(cherry picked from commit 6c895c5)

* Cleanup linq by introducing Partition (#425)

* Make sure that we prevent downstream to propagate null completion exception (#427)

(cherry picked from commit 562212d)

* Update RELEASE_NOTES.md for 1.5.37 release (#423)

* Update RELEASE_NOTES.md for 1.5.37 release

* Update RELEASE_NOTES.md

(cherry picked from commit d6b0a42)

* Bump Confluent.Kafka to 2.8.0 (#428)

(cherry picked from commit 02c002e)

* Make sure that restricted consumer is populated properly (#429)

(cherry picked from commit 8e41f71)

* Add CancellationToken support to MockCustomer (#430)

(cherry picked from commit 2d11235)

* Fix missing OnPartitionLost handler

* Simplify exception handling

---------

Co-authored-by: Aaron Stannard <[email protected]>
Aaronontheweb added a commit that referenced this pull request Mar 3, 2025
This reverts commit 73f788a.
Aaronontheweb added a commit that referenced this pull request Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants