@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }
@OnUnscheduled public void interruptActiveThreads() { // There are known issues with the Kafka client library that result in the client code hanging // indefinitely when unable to communicate with the broker. In order to address this, we will wait // up to 30 seconds for the Threads to finish and then will call Consumer.wakeup() to trigger the // thread to wakeup when it is blocked, waiting on a response. final long nanosToWait = TimeUnit.SECONDS.toNanos(5L); final long start = System.nanoTime(); while (System.nanoTime() - start < nanosToWait && !activeLeases.isEmpty()) { try { Thread.sleep(100L); } catch (final InterruptedException ie) { Thread.currentThread().interrupt(); return; } } if (!activeLeases.isEmpty()) { int count = 0; for (final ConsumerLease lease : activeLeases) { getLogger().info("Consumer {} has not finished after waiting 30 seconds; will attempt to wake-up the lease", new Object[] {lease}); lease.wakeup(); count++; } getLogger().info("Woke up {} consumers", new Object[] {count}); } activeLeases.clear(); }