Question 1
What is not a valid authentication mechanism in Kafka?
Learn more about security herehttps://kafka.apache.org/documentation/#security
What is not a valid authentication mechanism in Kafka?
Learn more about security herehttps://kafka.apache.org/documentation/#security
You want to perform table lookups against a KTable everytime a new record is received from the KStream. What is the output of KStream-KTable join?
Here KStream is being processed to create another KStream.
You are using JDBC source connector to copy data from 3 tables to three Kafka topics. There is one connector created with max.tasks equal to 2 deployed on a cluster of 3 workers. How many tasks are launched?
here, we have three tables, but the max.tasks is 2, so that's the maximum number of tasks that will be created
What isn't an internal Kafka Connect topic?
connect-configs stores configurations, connect-status helps to elect leaders for connect, and connect-offsets store source offsets for source connectors
Two consumers share the same group.id (consumer group id). Each consumer will
Each consumer is assigned a different partition of the topic to consume.
A Zookeeper ensemble contains 5 servers. What is the maximum number of servers that can go missing and the ensemble still run?
majority consists of 3 zk nodes for 5 nodes zk cluster, so 2 can fail
A bank uses a Kafka cluster for credit card payments. What should be the value of the property unclean.leader.election.enable?
Setting unclean.leader.election.enable to true means we allow out-of-sync replicas to become leaders, we will lose messages when this occurs, effectively losing credit card payments and making our customers very angry.
StreamsBuilder builder = new StreamsBuilder();
KStream
KTable
.mapValues(textLine -> textLine.toLowerCase())
.flatMapValues(textLine -> Arrays.asList(textLine.split("\W+")))
.selectKey((key, word) -> word)
.groupByKey()
.count(Materialized.as("Counts"));
wordCounts.toStream().to("word-count-output", Produced.with(Serdes.String(), Serdes.Long()));
builder.build();
What is an adequate topic configuration for the topic word-count-output?
Result is aggregated into a table with key as the unique word and value its frequency. We have to enable log compaction for this topic to align the topic's cleanup policy with KTable semantics.
What is true about replicas ?
Replicas are passive - they don't handle produce or consume request. Produce and consume requests get sent to the node hosting partition leader.
What exceptions may be caught by the following producer? (select two)
ProducerRecord
new ProducerRecord<>("topic1", "key1", "value1");
try {
producer.send(record);
} catch (Exception e) {
e.printStackTrace();
}
These are the client side exceptions that may be encountered before message is sent to the broker, and before a future is returned by the .send() method.