Skip to content

Commit

Permalink
Check for failure of rd_kafka_poll_set_consumer()
Browse files Browse the repository at this point in the history
  • Loading branch information
resuna committed Sep 11, 2018
1 parent ffcdff6 commit 9b78874
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions generic/kafkatcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4386,8 +4386,12 @@ kafkatcl_createSubscriberObjectCommand (kafkatcl_objectClientData *ko, char *cmd
return TCL_ERROR;
}

// Need to do this OR call rd_kafka_poll() periodically.
rd_kafka_poll_set_consumer(rk);
// After this do not call rd_kafka_poll(), call rd_kafka_consumer_poll() instead
if(rd_kafka_poll_set_consumer(rk) != RD_KAFKA_RESP_ERR_NO_ERROR) {
// Only possible error is RD_KAFKA_RESP_ERR__UNKNOWN_GROUP
Tcl_SetObjResult (interp, Tcl_NewStringObj("Unexpected failure from rd_kafka_poll_set_consumer", -1));
return TCL_ERROR;
}

// finished kafka setup, save state

Expand Down

0 comments on commit 9b78874

Please sign in to comment.