@Override public void stop() { if (!stopped.compareAndSet(false, true)) { LOG.warn("{}: Attempting to stop stopped consumer.", this); return; } LOG.info("{}: Stopping Samza kafkaConsumer ", this); // stop the proxy (with 1 minute timeout) if (proxy != null) { LOG.info("{}: Stopping proxy {}", this, proxy); proxy.stop(TimeUnit.SECONDS.toMillis(60)); } try { synchronized (kafkaConsumer) { LOG.info("{}: Closing kafkaSystemConsumer {}", this, kafkaConsumer); kafkaConsumer.close(); } } catch (Exception e) { LOG.warn("{}: Failed to stop KafkaSystemConsumer.", this, e); } }
@Override public void stop() { if (!stopped.compareAndSet(false, true)) { LOG.warn("{}: Attempting to stop stopped consumer.", this); return; } LOG.info("{}: Stopping Samza kafkaConsumer ", this); // stop the proxy (with 1 minute timeout) if (proxy != null) { LOG.info("{}: Stopping proxy {}", this, proxy); proxy.stop(TimeUnit.SECONDS.toMillis(60)); } try { synchronized (kafkaConsumer) { LOG.info("{}: Closing kafkaSystemConsumer {}", this, kafkaConsumer); kafkaConsumer.close(); } } catch (Exception e) { LOG.warn("{}: Failed to stop KafkaSystemConsumer.", this, e); } }
@Override public void stop() { if (!stopped.compareAndSet(false, true)) { LOG.warn("{}: Attempting to stop stopped consumer.", this); return; } LOG.info("{}: Stopping Samza kafkaConsumer ", this); // stop the proxy (with 1 minute timeout) if (proxy != null) { LOG.info("{}: Stopping proxy {}", this, proxy); proxy.stop(TimeUnit.SECONDS.toMillis(60)); } try { synchronized (kafkaConsumer) { LOG.info("{}: Closing kafkaSystemConsumer {}", this, kafkaConsumer); kafkaConsumer.close(); } } catch (Exception e) { LOG.warn("{}: Failed to stop KafkaSystemConsumer.", this, e); } }