Match Kafka records with node JS?

Viewed 23

I mean, I know about brokers, producers, consumers and topics in Kafka. If I had made a user and stored in producer in Kafka with username:person12 and password: person12, how can I retrieve it from the consumer and match it with the user Input? I am not new to Node JS but I can't figure it out for the last 10 days.

1 Answers

First, you shouldn't store plaintext passwords on Kafka topics without some encryption. (You should also limit who can access those topics using authorization.)

But, also, you wouldn't typically have passwords separate from usernames, so use a structured format like JSON, Avro, or Protobuf to create a User object inclusive of the password.

There is a nodefluent/kafka-streams library that exists, that I haven't used, but Kafka Streams allows for key value lookups using KTable, so with a username/ID as a key, you could lookup a password, or the whole user object, depending on the value of the record

Related