/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns partition commit(); }
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns partition commit(); }
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns parittion commit(); }
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns partition commit(); }
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns partition commit(); }
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns partition commit(); }
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns parittion commit(); }
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns partition commit(); }
/** * Kafka will call this method whenever it is about to rebalance the * consumers for the given partitions. We'll simply take this to mean that * we need to quickly commit what we've got and will return the consumer to * the pool. This method will be called during the poll() method call of * this class and will be called by the same thread calling poll according * to the Kafka API docs. After this method executes the session and kafka * offsets are committed and this lease is closed. * * @param partitions partitions being reassigned */ @Override public void onPartitionsRevoked(final Collection<TopicPartition> partitions) { logger.debug("Rebalance Alert: Paritions '{}' revoked for lease '{}' with consumer '{}'", new Object[]{partitions, this, kafkaConsumer}); //force a commit here. Can reuse the session and consumer after this but must commit now to avoid duplicates if kafka reassigns partition commit(); }
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();
lease.poll(); if (this.isScheduled() && !lease.commit()) { context.yield();