Kafka timeouts now throw an exception instead of marking the batch complete #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
KafkaWriterFilter will now throw an RuntimeException instead of failing silently (only with a log message) and marking the batch as complete.
Calling get() on the Future is necessary because producer.close() doesn't do anything on timeout.
This is the result after this patch:
`[data-116] - NetworkClient - [Producer clientId=SymmetricDS] Connection to node -1 could not be established. Broker may not be available.
[data-116] - NetworkClient - [Producer clientId=SymmetricDS] Connection to node -1 could not be established. Broker may not be available.
[data-116] - NetworkClient - [Producer clientId=SymmetricDS] Connection to node -1 could not be established. Broker may not be available.
[data-116] - NetworkClient - [Producer clientId=SymmetricDS] Connection to node -1 could not be established. Broker may not be available.
[data-116] - NetworkClient - [Producer clientId=SymmetricDS] Connection to node -1 could not be established. Broker may not be available.
[data-116] - NetworkClient - [Producer clientId=SymmetricDS] Connection to node -1 could not be established. Broker may not be available.
[data-116] - NetworkClient - [Producer clientId=SymmetricDS] Connection to node -1 could not be established. Broker may not be available.
[data-116] - IDatabaseWriterFilter - Unable to write batch to Kafka batch-000-143
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
...
[data-116] - ManageIncomingBatchListener - Failed to load batch 000-143
java.lang.RuntimeException: Unable to write batch to Kafka batch-000-143
...
[data-116] - DataLoaderService - 1 data and 1 batches loaded during push request from 166:000:000. There were 1 batches in error
[data-166] - AcknowledgeService - The outgoing batch 001-143 failed: Failed to update metadata after 60000 ms.
[data-116] - IncomingBatchService - Retrying batch 000-143
`