@@ -24,10 +24,6 @@ namespace KAFKA_API {
2424class  KafkaConsumer : public  KafkaClient 
2525{
2626protected: 
27-     using  RebalanceEventType    = Consumer::RebalanceEventType;
28-     using  RebalanceCallback     = Consumer::RebalanceCallback;
29-     using  OffsetCommitCallback  = Consumer::OffsetCommitCallback;
30- 
3127    //  Default value for property "max.poll.records" (which is same with Java API)
3228    static  const  constexpr  char * DEFAULT_MAX_POLL_RECORDS_VALUE = " 500"  ;
3329
@@ -75,7 +71,7 @@ class KafkaConsumer: public KafkaClient
7571     * An exception would be thrown if assign is called previously (without a subsequent call to unsubscribe()) 
7672     */  
7773    void  subscribe (const  Topics&               topics,
78-                    Consumer::RebalanceCallback cb      = Consumer::RebalanceCallback() ,
74+                    Consumer::RebalanceCallback cb      = Consumer::NullRebalanceCallback ,
7975                   std::chrono::milliseconds   timeout = std::chrono::milliseconds(DEFAULT_SUBSCRIBE_TIMEOUT_MS));
8076    /* *
8177     * Get the current subscription. 
@@ -293,7 +289,7 @@ class KafkaConsumer: public KafkaClient
293289    //  Rebalance Callback (for class instance)
294290    void  onRebalance (rd_kafka_resp_err_t  err, rd_kafka_topic_partition_list_t * rk_partitions);
295291
296-     RebalanceCallback _rebalanceCb;
292+     Consumer:: RebalanceCallback _rebalanceCb;
297293};
298294
299295
@@ -360,7 +356,7 @@ KafkaConsumer::close()
360356
361357//  Subscription
362358inline  void 
363- KafkaConsumer::subscribe (const  Topics& topics, RebalanceCallback cb, std::chrono::milliseconds timeout)
359+ KafkaConsumer::subscribe (const  Topics& topics, Consumer:: RebalanceCallback cb, std::chrono::milliseconds timeout)
364360{
365361    std::string topicsStr = toString (topics);
366362
@@ -746,8 +742,8 @@ KafkaConsumer::onRebalance(rd_kafka_resp_err_t err, rd_kafka_topic_partition_lis
746742
747743    if  (_rebalanceCb)
748744    {
749-         RebalanceEventType et =
750-             (err == RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS ? RebalanceEventType::PartitionsAssigned : RebalanceEventType::PartitionsRevoked);
745+         Consumer:: RebalanceEventType et =
746+             (err == RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS ? Consumer:: RebalanceEventType::PartitionsAssigned : Consumer:: RebalanceEventType::PartitionsRevoked);
751747        _rebalanceCb (et, tps);
752748    }
753749}
@@ -895,17 +891,17 @@ class KafkaManualCommitConsumer: public KafkaConsumer
895891     * Commit offsets returned on the last poll() for all the subscribed list of topics and partition. 
896892     * Note: If a callback is provided, it's guaranteed to be triggered (before closing the consumer). 
897893     */  
898-     void  commitAsync (const  Consumer::OffsetCommitCallback& cb = OffsetCommitCallback() );
894+     void  commitAsync (const  Consumer::OffsetCommitCallback& cb = Consumer::NullOffsetCommitCallback );
899895    /* *
900896     * Commit the specified offsets for the specified records 
901897     * Note: If a callback is provided, it's guaranteed to be triggered (before closing the consumer). 
902898     */  
903-     void  commitAsync (const  ConsumerRecord& record, const  Consumer::OffsetCommitCallback& cb = OffsetCommitCallback() );
899+     void  commitAsync (const  ConsumerRecord& record, const  Consumer::OffsetCommitCallback& cb = Consumer::NullOffsetCommitCallback );
904900    /* *
905901     * Commit the specified offsets for the specified list of topics and partitions to Kafka. 
906902     * Note: If a callback is provided, it's guaranteed to be triggered (before closing the consumer). 
907903     */  
908-     void  commitAsync (const  TopicPartitionOffsets& tpos, const  Consumer::OffsetCommitCallback& cb = OffsetCommitCallback() );
904+     void  commitAsync (const  TopicPartitionOffsets& tpos, const  Consumer::OffsetCommitCallback& cb = Consumer::NullOffsetCommitCallback );
909905
910906    /* *
911907     * Call the OffsetCommit callbacks (if any) 
@@ -968,16 +964,16 @@ KafkaManualCommitConsumer::commitSync(const TopicPartitionOffsets& tpos)
968964}
969965
970966inline  void 
971- KafkaManualCommitConsumer::commitAsync (const  TopicPartitionOffsets& tpos, const  OffsetCommitCallback& cb)
967+ KafkaManualCommitConsumer::commitAsync (const  TopicPartitionOffsets& tpos, const  Consumer:: OffsetCommitCallback& cb)
972968{
973969    auto  rk_tpos = rd_kafka_topic_partition_list_unique_ptr (tpos.empty () ? nullptr  : createRkTopicPartitionList (tpos));
974970
975-     rd_kafka_resp_err_t  err = rd_kafka_commit_queue (getClientHandle (), rk_tpos.get (), getCommitCbQueue (), &KafkaConsumer::offsetCommitCallback, new  OffsetCommitCallback (cb));
971+     rd_kafka_resp_err_t  err = rd_kafka_commit_queue (getClientHandle (), rk_tpos.get (), getCommitCbQueue (), &KafkaConsumer::offsetCommitCallback, new  Consumer:: OffsetCommitCallback (cb));
976972    KAFKA_THROW_IF_WITH_RESP_ERROR (err);
977973}
978974
979975inline  void 
980- KafkaManualCommitConsumer::commitAsync (const  ConsumerRecord& record, const  OffsetCommitCallback& cb)
976+ KafkaManualCommitConsumer::commitAsync (const  ConsumerRecord& record, const  Consumer:: OffsetCommitCallback& cb)
981977{
982978    TopicPartitionOffsets tpos;
983979    //  committed offset should be "current received record's offset" + 1
@@ -986,7 +982,7 @@ KafkaManualCommitConsumer::commitAsync(const ConsumerRecord& record, const Offse
986982}
987983
988984inline  void 
989- KafkaManualCommitConsumer::commitAsync (const  OffsetCommitCallback& cb)
985+ KafkaManualCommitConsumer::commitAsync (const  Consumer:: OffsetCommitCallback& cb)
990986{
991987    commitAsync (TopicPartitionOffsets (), cb);
992988}
0 commit comments