use of org.apache.kafka.connect.runtime.standalone.StandaloneConfig in project kafka by apache.
the class ConnectUtilsTest method testAddMetricsContextPropertiesStandalone.
@Test
public void testAddMetricsContextPropertiesStandalone() {
Map<String, String> props = new HashMap<>();
props.put(StandaloneConfig.OFFSET_STORAGE_FILE_FILENAME_CONFIG, "offsetStorageFile");
props.put(StandaloneConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
props.put(StandaloneConfig.KEY_CONVERTER_CLASS_CONFIG, "org.apache.kafka.connect.json.JsonConverter");
props.put(StandaloneConfig.VALUE_CONVERTER_CLASS_CONFIG, "org.apache.kafka.connect.json.JsonConverter");
StandaloneConfig config = new StandaloneConfig(props);
Map<String, Object> prop = new HashMap<>();
ConnectUtils.addMetricsContextProperties(prop, config, "cluster-1");
assertNull(prop.get(CommonClientConfigs.METRICS_CONTEXT_PREFIX + WorkerConfig.CONNECT_GROUP_ID));
assertEquals("cluster-1", prop.get(CommonClientConfigs.METRICS_CONTEXT_PREFIX + WorkerConfig.CONNECT_KAFKA_CLUSTER_ID));
}
use of org.apache.kafka.connect.runtime.standalone.StandaloneConfig in project kafka by apache.
the class FileOffsetBackingStoreTest method setup.
@Before
public void setup() throws IOException {
store = new FileOffsetBackingStore();
tempFile = File.createTempFile("fileoffsetbackingstore", null);
props = new HashMap<>();
props.put(StandaloneConfig.OFFSET_STORAGE_FILE_FILENAME_CONFIG, tempFile.getAbsolutePath());
props.put(StandaloneConfig.KEY_CONVERTER_CLASS_CONFIG, "org.apache.kafka.connect.json.JsonConverter");
props.put(StandaloneConfig.VALUE_CONVERTER_CLASS_CONFIG, "org.apache.kafka.connect.json.JsonConverter");
config = new StandaloneConfig(props);
store.configure(config);
store.start();
}
Aggregations