Skip to content

Instantly share code, notes, and snippets.

@skynyrd
Created December 16, 2017 12:39
Show Gist options
  • Save skynyrd/06752b809813b18b209bcab70c7b8005 to your computer and use it in GitHub Desktop.
Save skynyrd/06752b809813b18b209bcab70c7b8005 to your computer and use it in GitHub Desktop.
kafka_connect_put
@Override
public void put(Collection<SinkRecord> collection) {
try {
Collection<String> recordsAsString = collection.stream().map(r -> String.valueOf(r.value())).collect(Collectors.toList());
elasticService.process(recordsAsString);
}
catch (Exception e) {
log.error("Error while processing records");
log.error(e.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment