Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/twill/pull/16#discussion_r94551508
  
    --- Diff: 
twill-core/src/main/java/org/apache/twill/internal/kafka/client/SimpleKafkaConsumer.java
 ---
    @@ -273,17 +274,19 @@ private MessageCallback wrapCallback(final 
MessageCallback callback,
           final AtomicBoolean stopped = new AtomicBoolean();
           return new MessageCallback() {
             @Override
    -        public void onReceived(final Iterator<FetchedMessage> messages) {
    +        public long onReceived(final Iterator<FetchedMessage> messages) {
               if (stopped.get()) {
    -            return;
    +            return Long.MIN_VALUE;
    --- End diff --
    
    Using special value is an anti-pattern. Since you are changing the 
`MessageCallback` API already, probably better to have the offset being used 
for the fetching call being passed to the `onReceived` method.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to