consumeKafka is the newer one and will replace getKafka. However, it also depends on the version of Kafka broker you are using.
If you are using 0.9/0.10 version of Kafka then you should use consumeKafka. This corresponds to HDP version 2.4 and 2.5.
for HDP 2.3 and 2.4 for both kerberized and non kerberized clusters without SSL, you should use getKafka. Please see the accepted answer on the following link. Basically getKafka won't work if you have SSL enabled and it wouldn't work with newer versions.