Github user hmcl commented on a diff in the pull request:
https://github.com/apache/storm/pull/1924#discussion_r107536862
--- Diff:
external/storm-kafka-client/src/test/java/org/apache/storm/kafka/spout/SingleTopicKafkaSpoutTest.java
---
@@ -266,4 +269,36 @@ public void shouldReplayFirstTupleFailedOutOfOrder()
throws Exception {
verifyAllMessagesCommitted(messageCount);
}
}
+
+ @Test
+ public void shouldReplayAllFailedTuplesWhenFailedOutOfOrder() throws
Exception {
+ int messageCount = 10;
+ initializeSpout(messageCount);
+
+ //play all tuples
+ for (int i = 0; i < messageCount; i++) {
+ spout.nextTuple();
+ }
+ ArgumentCaptor<KafkaSpoutMessageId> messageIds =
ArgumentCaptor.forClass(KafkaSpoutMessageId.class);
+ verify(collector, times(messageCount)).emit(anyObject(),
anyObject(), messageIds.capture());
+ reset(collector);
+ //Fail tuple 5 and 3, call nextTuple, then fail tuple 2
+ List<KafkaSpoutMessageId> capturedMessageIds =
messageIds.getAllValues();
+ spout.fail(capturedMessageIds.get(5));
+ spout.fail(capturedMessageIds.get(3));
+ spout.nextTuple();
--- End diff --
What's the relation between this call to nextTuple and the failed messages?
Why is it needed?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---