Background
We are trying to connect to Kafka using kafka_ex
but we are running into some issues with the setting up a basic example.
Configuration
I have read the configuration files, and all we need is a producer. Our application won’t consume anything, it will simply produce data to kafka.
So our config file looks like this:
config :kafka_ex,
brokers: [
{"localhost", 9092}
],
kafka_version: "0.10.1"
Issue
The problem here is that upon running the app, it raises an exception:
12:50:55.791 [info] Application kafka_ex exited: KafkaEx.start(:normal, []) returned an error: an exception was raised:
** (FunctionClauseError) no function clause matching in KafkaEx.Protocol.ApiVersions.parse_response/2
(kafka_ex) lib/kafka_ex/protocol/api_versions.ex:62: KafkaEx.Protocol.ApiVersions.parse_response(nil, 0)
(kafka_ex) lib/kafka_ex/server_0_p_10_and_later.ex:178: KafkaEx.Server0P10AndLater.kafka_api_versions/1
(kafka_ex) lib/kafka_ex/server_0_p_10_and_later.ex:99: KafkaEx.Server0P10AndLater.kafka_server_init/1
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
** (Mix) Could not start application kafka_ex: KafkaEx.start(:normal, []) returned an error: an exception was raised:
** (FunctionClauseError) no function clause matching in KafkaEx.Protocol.ApiVersions.parse_response/2
(kafka_ex) lib/kafka_ex/protocol/api_versions.ex:62: KafkaEx.Protocol.ApiVersions.parse_response(nil, 0)
(kafka_ex) lib/kafka_ex/server_0_p_10_and_later.ex:178: KafkaEx.Server0P10AndLater.kafka_api_versions/1
(kafka_ex) lib/kafka_ex/server_0_p_10_and_later.ex:99: KafkaEx.Server0P10AndLater.kafka_server_init/1
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Questions
- What does this mean?
- How can I fix it?