private final String id;
private final String topic;
private final Consumer<String, Message> consumer;
+ private final MessageHandler messageHandler;
private long consumed = 0;
}
catch(Exception e)
{
- log.error("{} - Unexpected error: {}, unsubscribing!", id, e.toString());
- consumer.unsubscribe();
+ log.error("{} - Unexpected error: {}!", id, e.toString());
return 1;
}
finally
{
consumed++;
log.info("{} - {}: {}/{} - {}={}", id, offset, topic, partition, key, value);
+ messageHandler.handle(key, value);
}
}