@Override public void process(TopicPartition topicPartition, List<ConsumerRecord<String, byte[]>> records) { try { attemptToProcess(topicPartition, records); getConsumer().commitAsync(new OffsetCommitCallback() { public void onComplete(Map<TopicPartition, OffsetAndMetadata> offsets, Exception e) { if (e != null) { getLogger().error("Commit failed for offsets " + offsets, e); } } }); } catch (SiteWhereException e) { getLogger().error("Exception in consumer processing.", e); } catch (Throwable e) { getLogger().error("Unhandled exception in consumer processing.", e); } }