/** * Will call {@link Closeable#close()} on the target resource after which * the target resource will be set to null. Should only be called when there * are no more threads being executed on this processor or when it has been * verified that only a single thread remains. * * @see KafkaPublisher * @see KafkaConsumer */ @OnStopped public void close() { try { if (this.kafkaResource != null) { try { this.kafkaResource.close(); } catch (Exception e) { this.getLogger().warn("Failed while closing " + this.kafkaResource, e); } } } finally { this.kafkaResource = null; } }
this.acceptTask = false; session.rollback(true); this.getLogger().error("{} failed to process due to {}; rolling back session", new Object[] { this, e }); } finally { synchronized (this) { this.getLogger().debug("Task was not accepted due to the processor being in 'reset' state. It will be re-submitted upon completion of the reset."); context.yield();