You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/12/10 12:17:37 UTC
[camel-kafka-connector] branch master updated: Send
S3ObjectSerializer I/O error to the LOG instead of stdout
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git
The following commit(s) were added to refs/heads/master by this push:
new 9fc9797 Send S3ObjectSerializer I/O error to the LOG instead of stdout
new 6424438 Merge pull request #33 from orpiske/io-error-to-log
9fc9797 is described below
commit 9fc97973b75781ceddcee436893d66bd234b34a6
Author: Otavio Rodolfo Piske <op...@redhat.com>
AuthorDate: Mon Dec 9 20:30:58 2019 +0100
Send S3ObjectSerializer I/O error to the LOG instead of stdout
---
.../apache/camel/kafkaconnector/converters/S3ObjectSerializer.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/core/src/main/java/org/apache/camel/kafkaconnector/converters/S3ObjectSerializer.java b/core/src/main/java/org/apache/camel/kafkaconnector/converters/S3ObjectSerializer.java
index f68b484..fbfac33 100644
--- a/core/src/main/java/org/apache/camel/kafkaconnector/converters/S3ObjectSerializer.java
+++ b/core/src/main/java/org/apache/camel/kafkaconnector/converters/S3ObjectSerializer.java
@@ -22,8 +22,11 @@ import java.io.InputStream;
import java.util.Map;
import com.amazonaws.services.s3.model.S3ObjectInputStream;
import org.apache.kafka.common.serialization.Serializer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class S3ObjectSerializer implements Serializer<S3ObjectInputStream> {
+ private static final Logger LOG = LoggerFactory.getLogger(S3ObjectSerializer.class);
@Override
public void configure(Map<String, ?> configs, boolean isKey) {
@@ -42,7 +45,7 @@ public class S3ObjectSerializer implements Serializer<S3ObjectInputStream> {
buffer.write(byteArray, 0, nRead);
}
} catch (IOException e1) {
- e1.printStackTrace();
+ LOG.warn("I/O error while serializing data from topic {}: {}", topic, e1.getMessage(), e1);
}
return buffer.toByteArray();