1

According to Kafka Documentation

Connector configurations are simple key-value mappings. For standalone mode these are defined in a properties file and passed to the Connect process on the command line.

Most configurations are connector dependent, so they can't be outlined here. However, there are a few common options:

name - Unique name for the connector. Attempting to register again with the same name will fail.

I have 10 connectors running in standalone mode like this:

bin/connect-standalone.sh config/connect-standalone.properties connector1.properties connector2.properties ...

My question is can a connector load its own name at runtime?

Thanks in advance.

Bartosz Wardziński
  • 6,185
  • 1
  • 19
  • 30
Novemberland
  • 530
  • 3
  • 8
  • 25

1 Answers1

1

Yes, you can get the name of the connector at runtime.

When connector starts all properties are passed to Connector::start(Map<String, String> props). Connector can read those properties, validate them, save and later pass to Task. It depends on Connector implementation if he use it or not.

Connector name property is name.

Bartosz Wardziński
  • 6,185
  • 1
  • 19
  • 30