Skip to content

PartitionAssigned/Revoked handler #228

Closed Answered by LGouellec
AndreasKorn asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @AndreasKorn ,

You can try something like that :

        public class MyOwnConsumerListener : IConsumerRebalanceListener
        {
            private readonly IConsumerRebalanceListener wrapper;

            public MyOwnConsumerListener(IConsumerRebalanceListener wrapper)
            {
                this.wrapper = wrapper;
            }

            public void PartitionsAssigned(IConsumer<byte[], byte[]> consumer, List<TopicPartition> partitions)
            {
                wrapper.PartitionsAssigned(consumer, partitions);
                // do what you want
            }

            public void PartitionsRevoked(IConsumer<byte[], byte[]> consumer, List<TopicPartitionOffset> par…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@AndreasKorn
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by LGouellec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants