klarna/brod with azure/event hub. How to Set up?

Hi we are currently migrating our applications from our own servers to Microsoft Azure and thus replacing kafka by event hub. Currently I try to connect to it, but constantly getting crashes when starting the brod client.
This is how I start it:

endpoints = [{
  "some_dummy_endpoint.windows.net",
  9094
}],
brod_client_config = [{:sasl, {
  :plain,
  "$User",
  "Endpoint=sb://some_dummy_endpoint.windows.net;with_a_lot_of_other_chars",
}}],

:brod.start_client(
        endpoints,
        :some_id,
        brod_client_config
      )

This results in the mentioned crash:

{“crash_reason”:"{[{{“some_dummy_endpoint.windows.net”, 9094}, {{{:kpro_req, #Reference<0.2235917605.3298295810.118099>, :api_versions, 0, false, “”}, :closed}, [{:kpro_lib, :send_and_recv_raw, 4, [file: ‘src/kpro_lib.erl’, line: 71]}, {:kpro_lib, :send_and_recv, 5, [file: ‘src/kpro_lib.erl’, line: 82]}, {:kpro_connection, :query_api_versions, 4, [file: ‘src/kpro_connection.erl’, line: 246]}, {:kpro_connection, :init_connection, 2, [file: ‘src/kpro_connection.erl’, line: 233]}, {:kpro_connection, :init, 4, [file: ‘src/kpro_connection.erl’, line: 170]}, {:proc_lib, :init_p_do_apply, 3, [file: ‘proc_lib.erl’, line: 249]}]}}], [{:brod_client, :ensure_metadata_connection, 1, [file: ‘src/brod_client.erl’, line: 548]}, {:brod_client, :handle_info, 2, [file: ‘src/brod_client.erl’, line: 298]}, {:gen_server, :try_dispatch, 4, [file: ‘gen_server.erl’, line: 637]}, {:gen_server, :handle_msg, 6, [file: ‘gen_server.erl’, line: 711]}, {:proc_lib, :init_p_do_apply, 3, [file: ‘proc_lib.erl’, line: 249]}]}",“erlang_pid”:"#PID<0.5099.0>",“file”:“gen_server.erl”,“function”:“error_info/7”,“hostname”:“aca2d00fc651”,“level”:50,“line”:889,“module”:“gen_server”,“msg”:“GenServer :my_app_kafka_client terminating\n** (stop) [{{“some_dummy_endpoint.windows.net”, 9093}, {{{:kpro_req, #Reference<0.2235917605.3298295810.118099>, :api_versions, 0, false, “”}, :closed}, [{:kpro_lib, :send_and_recv_raw, 4, [file: ‘src/kpro_lib.erl’, line: 71]}, {:kpro_lib, :send_and_recv, 5, [file: ‘src/kpro_lib.erl’, line: 82]}, {:kpro_connection, :query_api_versions, 4, [file: ‘src/kpro_connection.erl’, line: 246]}, {:kpro_connection, :init_connection, 2, [file: ‘src/kpro_connection.erl’, line: 233]}, {:kpro_connection, :init, 4, [file: ‘src/kpro_connection.erl’, line: 170]}, {:proc_lib, :init_p_do_apply, 3, [file: ‘proc_lib.erl’, line: 249]}]}}]\n (brod) src/brod_client.erl:548: :brod_client.ensure_metadata_connection/1\n (brod) src/brod_client.erl:298: :brod_client.handle_info/2\n (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4\n (stdlib) gen_server.erl:711: :gen_server.handle_msg/6\n (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3\nLast message: :init”,“name”:“My_App”,“pid”:1,“registered_name”:“my_app_kafka_client”,“time”:“2019-09-20T08:41:18.971Z”,“v”:0}

Is there something I need to keep in mind to get this working? Are there ans known incompatibilities?

Thanks in advance

1 Like