storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srihar...@apache.org
Subject [1/2] storm git commit: STORM-693: when bolt fails to write tuple, it should report error instead of silently acking.
Date Sun, 08 Mar 2015 17:31:56 GMT
Repository: storm
Updated Branches:
  refs/heads/master 07098e8eb -> 9f57ba9bb


STORM-693: when bolt fails to write tuple, it should report error instead of silently acking.


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/aadccb4c
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/aadccb4c
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/aadccb4c

Branch: refs/heads/master
Commit: aadccb4cb2a6602651d31542ecf2c96d72a0edfa
Parents: 559f0f2
Author: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Authored: Mon Mar 2 16:06:58 2015 -0800
Committer: Parth Brahmbhatt <brahmbhatt.parth@gmail.com>
Committed: Mon Mar 2 16:06:58 2015 -0800

----------------------------------------------------------------------
 external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java  | 7 +++----
 .../storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java  | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/aadccb4c/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
index b6c3de4..cf169dc 100644
--- a/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
+++ b/external/storm-kafka/src/jvm/storm/kafka/bolt/KafkaBolt.java
@@ -101,11 +101,10 @@ public class KafkaBolt<K, V> extends BaseRichBolt {
             } else {
                 LOG.warn("skipping key = " + key + ", topic selector returned null.");
             }
-        } catch (Exception ex) {
-            LOG.error("Could not send message with key = " + key
-                    + " and value = " + message + " to topic = " + topic, ex);
-        } finally {
             collector.ack(input);
+        } catch (Exception ex) {
+            collector.reportError(ex);
+            collector.fail(input);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/storm/blob/aadccb4c/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
----------------------------------------------------------------------
diff --git a/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java b/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
index 2a56f84..c30cba1 100644
--- a/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
+++ b/external/storm-kafka/src/test/storm/kafka/bolt/KafkaBoltTest.java
@@ -143,7 +143,7 @@ public class KafkaBoltTest {
         String message = "value-234";
         Tuple tuple = generateTestTuple(message);
         bolt.execute(tuple);
-        verify(collector).ack(tuple);
+        verify(collector).fail(tuple);
     }
 
 


Mime
View raw message